passing a gridview selected value

Discussion in 'ASP .Net Building Controls' started by jonefer, Apr 18, 2008.

  1. jonefer

    jonefer Guest

    I'd like to use the selected value from particular column of a gridview to
    determine a 'parameter' for another gridview control's dataset.

    Setting the dataset, is not the problem.
    getting the descrete value is...

    I thought it would be as simple as this (below)- just as to confirm the
    value is being passed.
    But my test label doesn't show a value.

    Protected Sub GridView3_SelectedIndexChanged(ByVal sender As Object, ByVal e
    As System.EventArgs)
    Dim strMeasureTitle As String
    strMeasureTitle = Me.GridView3.SelectedRow.Cells(0).Text
    Me.lblQualConfirm.Text = strMeasureTitle
    End Sub

    How can I make this work...?

    Also, I've named the CommandName for each column so that I can refer to
    whichever column returns the strMeasure's value so I can further isolate a
    particular dataset to the 2nd grid.

    Is this the approach for distinguishing which column sends a particular value?
     
    jonefer, Apr 18, 2008
    #1
    1. Advertising

  2. Jonefer,

    I guess the right format would be:
    strmeasuretitle= gridview3.selectedrow.cells[1].text

    strMeasureTitle = Me.GridView3.SelectedRow.Cells[1].Text to return what is
    in the first row if you used the select field then it is going to be
    strMeasureTitle = Me.GridView3.SelectedRow.Cells[2].Text

    I hope it will work for you
    PS: I don't use me and should work otherwise remove it.

    Regards
    "jonefer" wrote:

    > I'd like to use the selected value from particular column of a gridview to
    > determine a 'parameter' for another gridview control's dataset.
    >
    > Setting the dataset, is not the problem.
    > getting the descrete value is...
    >
    > I thought it would be as simple as this (below)- just as to confirm the
    > value is being passed.
    > But my test label doesn't show a value.
    >
    > Protected Sub GridView3_SelectedIndexChanged(ByVal sender As Object, ByVal e
    > As System.EventArgs)
    > Dim strMeasureTitle As String
    > strMeasureTitle = Me.GridView3.SelectedRow.Cells(0).Text
    > Me.lblQualConfirm.Text = strMeasureTitle
    > End Sub
    >
    > How can I make this work...?
    >
    > Also, I've named the CommandName for each column so that I can refer to
    > whichever column returns the strMeasure's value so I can further isolate a
    > particular dataset to the 2nd grid.
    >
    > Is this the approach for distinguishing which column sends a particular value?
     
    Jacques MUREKEZI, Jul 8, 2008
    #2
    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. =?Utf-8?B?Tkg=?=
    Replies:
    2
    Views:
    29,390
    =?Utf-8?B?Tkg=?=
    Mar 27, 2006
  2. =?Utf-8?B?Q29ycG9yYXRlQ29kZXI=?=

    selected value databinding for DropDownBox in gridview is Disabled

    =?Utf-8?B?Q29ycG9yYXRlQ29kZXI=?=, May 30, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    15,623
    bigdogpitbull
    Mar 15, 2010
  3. TNGgroup

    Passing a selected value to a form

    TNGgroup, Nov 24, 2004, in forum: ASP General
    Replies:
    8
    Views:
    224
    TNGgroup
    Nov 24, 2004
  4. maflu
    Replies:
    1
    Views:
    285
  5. PetroTiburcio

    Passing selected row from gridview to dropdown

    PetroTiburcio, May 17, 2013, in forum: C Programming
    Replies:
    0
    Views:
    290
    PetroTiburcio
    May 17, 2013
Loading...

Share This Page