Here are the examples of the csharp api class System.Windows.Forms.ComboBox.IsSelectedValueNull() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Example
0
1. Example
View licensepublic static T GetSelectedValue<T>(this ComboBox cbo) { if (!cbo.IsSelectedValueNull()) { if (cbo.SelectedValue.GetType() == typeof(T)) return (T)cbo.SelectedValue; } else if(cbo.SelectedItem != null && !cbo.ValueMember.IsNullOrWhiteSpace()) { var pi = cbo.SelectedItem.GetType().GetProperty(cbo.ValueMember, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); if (pi != null && pi.PropertyType == typeof(T)) return (T)pi.GetValue(cbo.SelectedItem, null); } return default(T); }