Hi,
I'm hoping someone can explain how to do what seems like a relatively straightforward task.
I'm using radgrid to display a list of users bound to an Entitydatasource control . To insert or edit the users I am using a FormTemplate for the edit/insert.
One of the fields for the user data is gender. Rather than create a lookup table for this I wanted to create a combobox containing only the values (Not Selected, Male, Female). The default value displayed on the combo-box for an insert should be Not Selected. The default value
for an edit should be the underlying value from the db that has previously been selected.
If I bind the combo directly to the field I am given all the values that are currently in the table for that field (ie. Male, Male, Female, Not Selected).
Instead of this I want a combobox with only the above values, while it is also bound to the underlying entitydatasource and thus can have its selectedvalue set.
I've been through as many posts and articles as I can find that seem to be relevant but I still don't seem to be solving the problem some examples below.
http://www.telerik.com/help/aspnet-ajax/grid-with-combobox.html
http://www.telerik.com/help/aspnet-ajax/grid-operations-with-dropdownlist-in-edititemtemplate.html
If I implement the recommendation from the above article I do end up with a combo-box limited to the selected values but as it is not bound to the database I cannot retrieve the correct value on edit nor persist any selected values back the database using EF.
It seems I'm missing something obvious here so please feel free to point it out to me as any help on this would be welcome.
I'm hoping someone can explain how to do what seems like a relatively straightforward task.
I'm using radgrid to display a list of users bound to an Entitydatasource control . To insert or edit the users I am using a FormTemplate for the edit/insert.
One of the fields for the user data is gender. Rather than create a lookup table for this I wanted to create a combobox containing only the values (Not Selected, Male, Female). The default value displayed on the combo-box for an insert should be Not Selected. The default value
for an edit should be the underlying value from the db that has previously been selected.
If I bind the combo directly to the field I am given all the values that are currently in the table for that field (ie. Male, Male, Female, Not Selected).
Instead of this I want a combobox with only the above values, while it is also bound to the underlying entitydatasource and thus can have its selectedvalue set.
I've been through as many posts and articles as I can find that seem to be relevant but I still don't seem to be solving the problem some examples below.
http://www.telerik.com/help/aspnet-ajax/grid-with-combobox.html
http://www.telerik.com/help/aspnet-ajax/grid-operations-with-dropdownlist-in-edititemtemplate.html
If I implement the recommendation from the above article I do end up with a combo-box limited to the selected values but as it is not bound to the database I cannot retrieve the correct value on edit nor persist any selected values back the database using EF.
It seems I'm missing something obvious here so please feel free to point it out to me as any help on this would be welcome.