From: Sze on
Private Sub GridViewLocalChargeDetail_RowUpdating(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridViewLocalChargeDetail.RowUpdating

Dim txtModBillingType As TextBox =
DirectCast(GridViewLocalChargeDetail.Rows(e.RowIndex).FindControl("txtBillingType"),
TextBox)
When I set the column 's visible = false
the txtModBillingtype.text become blank.

I don't want to display the column, but I need to get the value

Please help.
thanks in advance


From: Alexey Smirnov on
On Apr 28, 12:38 pm, "Sze" <a...(a)abc.com> wrote:
>  Private Sub GridViewLocalChargeDetail_RowUpdating(ByVal sender As Object,
> ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
> GridViewLocalChargeDetail.RowUpdating
>
>      Dim txtModBillingType As TextBox =
> DirectCast(GridViewLocalChargeDetail.Rows(e.RowIndex).FindControl("txtBilli ngType"),
> TextBox)
> When I set the column 's visible = false
>  the txtModBillingtype.text become blank.
>
> I don't want to display the column, but I need to get the value
>
> Please help.
> thanks in advance

You can get a datakey from the current row

GridViewLocalChargeDetail.DataKeys[e.RowIndex].Value

and use it to request the data from the datasource
From: Mark Rae [MVP] on
"Alexey Smirnov" <alexey.smirnov(a)gmail.com> wrote in message
news:28a25734-b405-4a0e-afdb-f6230983a6df(a)v14g2000yqb.googlegroups.com...

> You can get a datakey from the current row

Assuming you add it to the DataKeyNames property of the GridView first:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.datakeys.aspx


--
Mark Rae
ASP.NET MVP
http://www.markrae.net