I am binding a radiobuttonlist to a data field in a database. If the field has a null value my application produces an error maybe because the null value wont be an item in the radio button list. What I want is the radiobuttonlist not to check any value if it is not in the list Please Help
Binding a Radiobuttonlist to a Database
Collapse
X
-
Originally posted by GarudzoI am binding a radiobuttonlist to a data field in a database. If the field has a null value my application produces an error maybe because the null value wont be an item in the radio button list. What I want is the radiobuttonlist not to check any value if it is not in the list Please Help
Validate the Input coming from database before assigning to the radiobuttonlist
if(Value!="")
{
//Include the binding code here
}
Siju -
Originally posted by GarudzoThanks for the advice but this assumes that I am doing the binding in code. In this case I just draged the control to a formview and set the databound property. Cant I do it without using code?
You can drag the RadioButtonList control onto your form...but you will have to customize the data source that you are binding it to.Comment
Comment