Click here to Skip to main content
15,900,906 members

Comments by Sam 9100 (Top 22 by date)

Sam 9100 30-Apr-15 17:01pm View    
//
Sam 9100 30-Apr-15 15:31pm View    
//
Sam 9100 30-Apr-15 12:10pm View    
I have a normal dropdown combobox, not a dropdownlist box
Sam 9100 30-Apr-15 11:57am View    
I appreciate your professional and courteous answer Unkownwar.

I replace the line 'if(cb.SelectedItem== null) portion, but it still did not work. I add it here because it renders my pick list item whether one is selected or not.
//In my comboboxExtension class
public static int? SelectedPicklistNullableID(this ComboBox cb)
{
//if (cb.SelectedItem == null) return null;

//added here
if (cb.SelectedIndex.Equals(-1)) return null;
return ((PickListItem)cb.SelectedItem).ID;
}
public static int SelectedPicklistID(this ComboBox cb)
{
return cb.SelectedPicklistNullableID().Value;

My combobox still defaults to the last item of the dropdown list. it is getting overriden everytime.
Sam 9100 30-Apr-15 10:13am View    
Deleted
Why do you even reply to comments when all you do is lecture and talk down to others who are requesting assistance? The principles of working with combo boxes are similar for all combo boxes regardless of their type.