I have a radgrid and a template column of country codes going out to a countries table and use a radcombobox in the insert/edit form for this.This is the code for the combobox in the grid:
I set the selected value to bind to the country_cd in the database, but this is really for update, not insert. For insert, I do not want to bind the selected value. I want it to be blank, but there is no blank item in the countries table. How can I make the first item blank so that I can validate it and make sure the user chooses a valid country on insert?
Thanks
<telerik:GridTemplateColumn DataField="country_cd" HeaderText="Country" display="false" EditFormColumnIndex="1"> |
<EditItemTemplate> |
<telerik:RadComboBox runat="server" ID="country_cd" DataValueField="country_cd" DataSourceID="ccCountries" |
DataTextField="country_name" OnSelectedIndexChanged="countryChanged" CausesValidation="false" |
onload="countryLoaded" AutoPostBack="true" MarkFirstMatch="True" SelectedValue='<%# Bind("country_cd") %>' |
IsCaseSensitive="false" > |
</telerik:RadComboBox> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
I set the selected value to bind to the country_cd in the database, but this is really for update, not insert. For insert, I do not want to bind the selected value. I want it to be blank, but there is no blank item in the countries table. How can I make the first item blank so that I can validate it and make sure the user chooses a valid country on insert?
Thanks