hi there...
I want to ask, how to get a value from hidden column in gridview?
I create a gridview with five column and the 4th and 5th column, i set not visible.
CODE
<asp:GridView ID="gv_sisd" runat="server" BackColor="White" BorderColor="White" BorderWidth="2px" CellPadding="3"
GridLines="None" AutoGenerateColumns="False" Width="360px" BorderStyle="Ridge" CellSpacing="1">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<SelectedRowStyle BackColor="#9471DE" ForeColor="White" Font-Bold="True" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<HeaderStyle BackColor="#A6A6A6" Font-Bold="True" ForeColor="Black" />
<Columns>
<asp:BoundField HeaderText="No." />
<asp:BoundField HeaderText="Wilayah" DataField="kode_wilayah" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="nama" HeaderText="Nama" >
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="lambang" HeaderText="Lambang" Visible="False" />
<asp:BoundField DataField="peta" HeaderText="Peta" Visible="False" />
</Columns>
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>
and then i create procedure to modifie the value in gv.
In this procedure, i want to get value from 4th column and store in variabel (lambang).
But, it get nothing....
Can you help me tp solve this problem?
thank you...
CODE
Protected Sub gv_sisd_RowDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gv_sisd.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim i As Byte = e.Row.Cells(1).Text.Trim.Length()
Dim IDwil As String = e.Row.Cells(1).Text
Dim lambang As String = e.Row.Cells(3).Text
Dim peta As String = e.Row.Cells(4).Text
Dim isinya As String = ""
e.Row.Cells(0).Text = e.Row.RowIndex.ToString() + 1
If i = 2 Then
isinya = "PROVINSI"
ElseIf i = 4 Then
If e.Row.Cells(2).Text.Trim.Substring(0, 4) = "KOTA" Then
isinya = "KOTA"
Else
isinya = "KABUPATEN"
End If
End If
e.Row.Cells(1).Text = isinya
'---------------------------------------
e.Row.Cells(2).Text = "<a href=""masuk.aspx?dimana=" & isinya & "&IDwil=" & IDwil & "&nama=" & e.Row.Cells(2).Text & "&lambang=" & lambang & """ target=""_self"" style=""text-decoration: none;color:black"">" & e.Row.Cells(2).Text & "</a>"
End If
End Sub