G
Guest
I am using the DataGrid control from 4guys (http://aspnet.4guysfromrolla.com/demos/RowHighlighter.aspx). I want to display 2 columns and allow editing. The only column I want the user to be able to change is the second column. I made this work via ReadOnly="true" for the first column.
The second requirement is that the grid stores 2 table primary key values in columns 3 and 4. These columns will mean nothing to the user and could potentially confuse them. For this reason I need to hide the columns. So in the DataGrid definition on the .aspx page I added:
<asp:BoundColumn DataField="ProductId" Visible="false"></asp:BoundColumn>
<asp:BoundColumn DataField="CustomerId" Visible="false"></asp:BoundColumn>
Then in the update command I simply Response.Write out the values for now:
Dim s1 As String = e.Item.Cells(1).Text
Dim s2 As String = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Dim s3 As String = e.Item.Cells(3).Text
Response.Write(s1 + "__" + s2 + "::" + s3)
Doing this yields:
[correctColumn1]__[correctColumn2]:: <-s3 is blank
How do I get the values in the hidden third and fourth columns?
Thanks,
Ryan
The second requirement is that the grid stores 2 table primary key values in columns 3 and 4. These columns will mean nothing to the user and could potentially confuse them. For this reason I need to hide the columns. So in the DataGrid definition on the .aspx page I added:
<asp:BoundColumn DataField="ProductId" Visible="false"></asp:BoundColumn>
<asp:BoundColumn DataField="CustomerId" Visible="false"></asp:BoundColumn>
Then in the update command I simply Response.Write out the values for now:
Dim s1 As String = e.Item.Cells(1).Text
Dim s2 As String = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Dim s3 As String = e.Item.Cells(3).Text
Response.Write(s1 + "__" + s2 + "::" + s3)
Doing this yields:
[correctColumn1]__[correctColumn2]:: <-s3 is blank
How do I get the values in the hidden third and fourth columns?
Thanks,
Ryan