Setting up an exposed filter to only filter conditionally I am trying to build a D7 view, and I have the view correctly only showing results using a contextual filter, but I am trying to build one more filter (an exposed one), to drill down even more. 

I have a list of students, each students assigned to different districts. A user is assigned to one (or multiple) districts, but should never be assigned to all (but could be). The contextual filter is checking the assigned_user field of the district using the logged in user, and that works.

I have the student and district relationship setup, and it pulls all data from both entities correctly.

Now I am trying to build an exposed filter so that the user can select which district they want to filter by, but ONLY list the districts they are assigned to. When using the 'expose filter' option on the district name, if I use 'Single Filter' it makes it a textbox instead of a select box, and if I use 'group filter', it makes a select box, but I have to manually put in each district. 

I am trying to #1, get the exposed filter to be a select list, 
and #2 ONLY the districts the user has access to (via the assigned_user contextual filter). The views UI doesn't appear to have a way to do this, so is it possible for me to write a hook to create the filter myself?
If the district is a term, entity reference, or a list field value, then you should be able to do this. Otherwise, You'll need to do something more involved (and honestly, at that point, you're probably better off just restructuring that data to work with views.

As far as only exposing options that will provide valid results, I'd recommend taking a look at Views Selective Filters (https://www.drupal.org/project/views_selective_filters). Be wary though, as the views_selective_filters module does an additional query, per selective filter as the view is loaded. Not a huge problem for 1 or 2 filters. But can start to cause performance issues if you're not careful.

Edit
The question as I (now) understand it: How do you change the options of a select list exposed filter based on an arbitrary value set against the currently logged in user?

First, hook into the exposed filter form and modify the district filter.

function mymodule_form_FORM_ID_alter(&amp;$form, &amp;$form_state) {
  $district_options = mymodule_get_district_options();

  if (!empty($district_options)) {
    $form['field_district']['#type'] = 'select';
    $form['field_district']['#options'] = $district_options;
  }
}


Next, you need to actually write mymodule_get_district_options().

function mymodule_get_district_options() {
  // Load the current user. 
  global $user;
  $account = user_load($user-&gt;uid);

  // Default to loading all districts.
  $district_ids = FALSE;

  // Get the districts value from the loaded account.
  if (!empty($account) &amp;&amp; !empty($account-&gt;field_districts)) {
    $district_values = $account-&gt;field_districts;
    foreach ($district_values[LANGUAGE_NONE] as $delta =&gt; $value) {
      $district_ids[] = $value['target_id'];
  }

  // Load the districts set on the current user, or ALL districts if none are set.
  $districts = entity_load('district', $district_ids);

  $options = [];
  if (!empty($districts)) {
    foreach ($districts as $district) {
      $options[$district-&gt;id] = $district-&gt;title;
    }
  }

  return $options;
}


Something along those lines should work. I haven't tested this.