GridView problem

Discussion in 'ASP .Net' started by Sze, Apr 28, 2010.

  1. Sze

    Sze Guest

    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
    Sze, Apr 28, 2010
    #1
    1. Advertising

  2. On Apr 28, 12:38 pm, "Sze" <> 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
    Alexey Smirnov, Apr 28, 2010
    #2
    1. Advertising

  3. Mark Rae [MVP], Apr 28, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nalaka

    GridView in a GridView

    Nalaka, Nov 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    6,586
    Nalaka
    Dec 5, 2005
  2. Replies:
    3
    Views:
    5,091
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,941
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. Vik
    Replies:
    1
    Views:
    508
  5. HeavyMetal

    GridView RowCommand problem: GridView Nested in Repeater

    HeavyMetal, Aug 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    773
    HeavyMetal
    Aug 8, 2006
Loading...

Share This Page