Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

RadComboBox in Grid EditForm Template

$
0
0

I forgot to include the code of the ListHelp object and method that's in the ItemDataBound event.

publicstaticvoidFillEmployees(RadComboBox list, int? selectedId = null)
{
  var client = newUserServiceClient();
  var userList = client.GetSecurityUsers();
 
  list.ClearSelection();
  list.Items.Clear();
  list.Items.Add(newRadComboBoxItem("(Choose Employee)", "-1"));
 
  list.AppendDataBoundItems = true;
  list.DataSource = userList;
  list.DataValueField = "user_id";
  list.DataTextField = "full_name_last_first";
  list.DataBind();
 
  if(selectedId.HasValue && selectedId.Value > 0)
  {
    if(list.FindItemByValue(selectedId.Value.ToString()) != null)
    {
      list.FindItemByValue(selectedId.Value.ToString()).Selected = true;
    }
  }
}
I'll try moving the logic from ListHelper into the ItemDataBound event to see if that works. 

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>