all groups > vb.net controls > october 2006 >
You're in the

vb.net controls

group:

gridview vs. datagrid


gridview vs. datagrid Swoosh
10/12/2006 2:26:54 AM
vb.net controls: Hi there

When I was using DataGrid control, i sometimes needed to use the
following code on databound:

Dim myDataRowView As DataRowView = CType(e.Item.DataItem, DataRowView)

and later on, i was getting one item out of the row like this:

something = myDataRowView.Row.Item("Project_ID")

i like to use it like this.

my question is: What similar thing can i use on gridview databound?

thanks
Re: gridview vs. datagrid Jay B. Harlow
10/12/2006 3:52:08 PM
Swoosh,
[quoted text, click to view]
ASP.NET or Windows Forms?

Your should be able to use the "same" code.

It really depends on what event your first statement is in, as to how it
changes. Generally it will be e.Row instead of e.Item.


--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


[quoted text, click to view]
Re: gridview vs. datagrid Swoosh
10/16/2006 8:45:32 AM
ok ... that sounds all right
but what exactly do you mean by "same" code?
inside databound i had e.item.dataitem

gridview's databound doesn't have row ...
should i try it on rowbound instead of databound?


On Oct 12, 11:52 pm, "Jay B. Harlow" <Jay_Harlow_...@tsbradley.net>
[quoted text, click to view]
Re: gridview vs. datagrid Swoosh
10/16/2006 8:45:59 AM
it is ASP.NET

On Oct 12, 11:52 pm, "Jay B. Harlow" <Jay_Harlow_...@tsbradley.net>
[quoted text, click to view]
Re: gridview vs. datagrid Jay B. Harlow
10/17/2006 6:23:05 AM
And the event?

Did you notice I suggested using e.Row instead of e.Item?

Such as:

Dim myDataRowView As DataRowView = CType(e.Row.DataItem, DataRowView)

Again how the above line changes really depends on what even you are in!
(both before & now).

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


[quoted text, click to view]
AddThis Social Bookmark Button