.Net problem...

Don
Joined
5 Oct 2005
Posts
11,239
Location
Liverpool
Hey there,

Any idea how to reference a GridView row when its embedded inside of a FormView... I thought that this might work...

GridViewRow row = (GridViewRow)((Control)e.CommandSource).Parent.Parent;

but it unfortunately doesnt :(

Any ideas?

Stelly
 
At the moment your code wouldn't work because the GridViewRow is part of a collection, and your aren't referencing it. If you wanted to take say a selected row. you could cast to the GridView and use the SelectedRow member which would then return a GridViewRow.

Something like this.
GridViewRow row = ((GridView)whatever needs to go in here!!!).SelectedRow;

Unfortunately actually know what ((Control)e.CommandSource).Parent.Parent; is.
 
Back
Top Bottom