Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > passing a gridview selected value

Reply
Thread Tools

passing a gridview selected value

 
 
jonefer
Guest
Posts: n/a
 
      04-18-2008
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?
 
Reply With Quote
 
 
 
 
Jacques MUREKEZI
Guest
Posts: n/a
 
      07-08-2008
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
selected value databinding for DropDownBox in gridview is Disabled =?Utf-8?B?Q29ycG9yYXRlQ29kZXI=?= ASP .Net 3 03-15-2010 04:58 PM
Getting the Value of a Checkbox in the GridView Selected Row Kirk ASP .Net 2 03-06-2007 03:37 PM
gridview: selected value of dropdownlist in edititemtemplate =?Utf-8?B?Tkg=?= ASP .Net 2 03-27-2006 12:43 PM
Passing a selected value to a form TNGgroup ASP General 8 11-24-2004 04:04 PM
Passing Drop Down List Selected Value maflu Javascript 1 11-20-2003 01:02 AM



Advertisments