I do something similar with my GridViews. In view mode, I just have a
representaton of the value. When I switch to Edit mode is when I want
to show my checkboxes and such.
To get values out of them you need to handle the GridView.RowUpd ating
event. The code below (my GridView.RowUpd ating event) finds the
txtCareerHi control in the selected GridView row and mirrors it in a
TextBox control stored in memory. On my form, the TextBox is a multi-
line TextBox and I want to preserve the vbCrLf characters. The funny
thing is that in view mode, I need to render them as HTML "<br />"
tags while in the TextBox, I need vbCrLf. I store the <br /tags in
my database.
' converts vbCrLf to <br /tag for browser display. The <br /
tags are stored in the database
Dim career As TextBox
career =
CType(gridCaree r.Rows(e.RowInd ex).FindControl ("txtCareerHi") , TextBox)
Dim strCareer As String
strCareer = career.Text.Rep lace(vbCrLf, "<br />")
e.NewValues.Add ("career_hi" , strCareer)
gridCareer.Data Bind()
My problem is that the values I want for my RadioButtonList s and
DropDownLists are stored in my database. I need a value and text. How
can I bind the RadioButtonList with value and text properties? They
only exist when the row enters Edit mode.
Cheers
Mike