RadioButtonList?

Topics: User Forum
Aug 1, 2007 at 2:59 PM
Is it possible to use a radio button list in the BulkEditGridView?
I have one that populates correctly but does not save the selections.
Aug 13, 2007 at 11:47 PM
Edited Aug 14, 2007 at 12:37 AM
Good question. I am running into the same issue.

It appears as tho the "dirty row" indicator is not tiggered on change of the a radion button selection. My BE-GV needs to update a single value, selected from the radio button list.

Feb 19, 2008 at 4:40 PM
I had the same problem, and there's a simple solution :) In the source code, go to BulkEditGridView.cs. You will find a function called AddChangedHandlers, which adds handlers for various controls. Just add an else if block for a radio button list and you're off and running:

private void AddChangedHandlers(ControlCollection controls)
{
foreach (Control ctrl in controls)
{
if (ctrl is TextBox)
{
((TextBox)ctrl).TextChanged += new EventHandler(this.HandleRowChanged);
}
else if (ctrl is CheckBox)
{
((CheckBox)ctrl).CheckedChanged += new EventHandler(this.HandleRowChanged);
}
else if (ctrl is DropDownList)
{
((DropDownList)ctrl).SelectedIndexChanged += new EventHandler(this.HandleRowChanged);
}
else if (ctrl is RadioButtonList)
{
((RadioButtonList)ctrl).SelectedIndexChanged += new EventHandler(this.HandleRowChanged);
}
////could add recursion if we are missing some controls.
//else if (ctrl.Controls.Count > 0 && !(ctrl is INamingContainer) )
//{
// AddChangedHandlers(ctrl.Controls);
//}
}
}