D
daokfella
I have three datagrid template columns each with a radiobutton
assigned to the same group. If I determine that the third and only
third radiobutton should be selected, I'll select it in ItemDataBound
and then disable all three. However, when I loop through the datagrid
items after responding to a button click event on the page, it always
returns the first radiobutton as checked even though it isn't. It
looks like if the radiobuttons are enabled, it works fine. There's
just a problem if they are disabled. Anybody else encounter this? It
seems like an MS bug. If I change the order of the Case statements,
the very first is always seen as TRUE if the radiobutton is disabled
(even though it's not checked).
' Loop through datagrid updating Available Years.
For Each item As DataGridItem In dgrRegYear.Items
Dim rb1 As RadioButton
Dim rb2 As RadioButton
Dim rb3 As RadioButton
rb1 = CType(item.FindControl("rb1"), RadioButton)
rb2 = CType(item.FindControl("rb2"), RadioButton)
rb3 = CType(item.FindControl("rb3"), RadioButton)
Select Case True
Case rb1.Checked
' THIS IS ALWAYS HIT EVEN THOUGH THE RADIOBUTTON IS NOT CHECKED!
Case rb2.Checked
Case rb3.Checked
End Select
Next
assigned to the same group. If I determine that the third and only
third radiobutton should be selected, I'll select it in ItemDataBound
and then disable all three. However, when I loop through the datagrid
items after responding to a button click event on the page, it always
returns the first radiobutton as checked even though it isn't. It
looks like if the radiobuttons are enabled, it works fine. There's
just a problem if they are disabled. Anybody else encounter this? It
seems like an MS bug. If I change the order of the Case statements,
the very first is always seen as TRUE if the radiobutton is disabled
(even though it's not checked).
' Loop through datagrid updating Available Years.
For Each item As DataGridItem In dgrRegYear.Items
Dim rb1 As RadioButton
Dim rb2 As RadioButton
Dim rb3 As RadioButton
rb1 = CType(item.FindControl("rb1"), RadioButton)
rb2 = CType(item.FindControl("rb2"), RadioButton)
rb3 = CType(item.FindControl("rb3"), RadioButton)
Select Case True
Case rb1.Checked
' THIS IS ALWAYS HIT EVEN THOUGH THE RADIOBUTTON IS NOT CHECKED!
Case rb2.Checked
Case rb3.Checked
End Select
Next