Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Programatically reference GridView field?

Reply
Thread Tools

Programatically reference GridView field?

 
 
11D.Universe
Guest
Posts: n/a
 
      06-10-2007
I've got a datafield column named RecID in a GridView named
GridView2.

What's the correct vb syntax to reference the data field value in the
GridView2_SelectedIndexChanging sub?

I'm trying to do something like:

Protected Sub GridView2_SelectedIndexChanging(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewSelectEventArgs) Handles
GridView2.SelectedIndexChanging

if RecID is NULL then cancel the SelectedIndexChange

End Sub

 
Reply With Quote
 
 
 
 
Madison
Guest
Posts: n/a
 
      06-12-2007
Try
DataBinder.Eval(e.Row.DataItem, "RecID ")


"11D.Universe" wrote:

> I've got a datafield column named RecID in a GridView named
> GridView2.
>
> What's the correct vb syntax to reference the data field value in the
> GridView2_SelectedIndexChanging sub?
>
> I'm trying to do something like:
>
> Protected Sub GridView2_SelectedIndexChanging(ByVal sender As Object,
> ByVal e As System.Web.UI.WebControls.GridViewSelectEventArgs) Handles
> GridView2.SelectedIndexChanging
>
> if RecID is NULL then cancel the SelectedIndexChange
>
> End Sub
>
>

 
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
gridview update programatically =?Utf-8?B?SmF5RA==?= ASP .Net 1 08-28-2009 01:13 AM
Problem Adding Column Programatically to GridView Kbalz ASP .Net 2 10-04-2007 04:49 PM
How do I programatically reference controls inside a control template? Mark Micallef ASP .Net Web Controls 3 04-12-2007 01:27 AM
gridview row programatically set to edit mode =?Utf-8?B?R2VyaGFyZA==?= ASP .Net 2 09-29-2006 03:59 PM
How to invoke Edit mode in GridView when dataSource is set programatically? (ASP.NET 2.0) misiek ASP .Net 3 03-23-2006 10:50 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57