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. Advertisements

  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.

    Jacques MUREKEZI, Jul 8, 2008
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.