Tuesday, June 11, 2013

Using empty value in a databound GridDropDownColumn



 In RadGrid if you want to use dropdown box (or the ComboBox) then  there is this  GridDropDownColumn.
And if you want to databind it just set the datasource .
Then the question comes to how to add the empty item to the dropdown
For ex you want 3 items in the combo and "--None--" as the default item in the dropdown box
And if "--None--" is selected it should return null as value.
The EmptyListItemValue  property comes to help, set these 3 properties as below 


EmptyListItemText="None" EmptyListItemValue="" EnableEmptyListItem="True"
 <telerik:GridDropDownColumn HeaderText="TargetOrganisation" 
ListValueField="ID" UniqueName="TargetOrganisationID" 
 DataField="TargetOrganisationID" 
ListTextField="Alias" DataSouceID="edsOrganisation"EmptyListItemText="None" EmptyListItemValue="" EnableEmptyListItem="True">
</telerik:GridDropDownColumn>

No comments:

Post a Comment