Last post Jan 04, 2009 05:02 PM by aboreham
Dec 17, 2008 07:57 PM|aboreham|LINK
If you like this idea you can rate it here:
NOTE: I'm only using the GridView as an example. This would be useful for any templated control, e.g. Repeater, ListView, etc.
Imagine you have a GridView with a TemplateField containing a label called lblHelloWorld.
Now, at the moment, in code behind in the RowDataBound event of the GridView, to get this label you have to write:
Dim lblHelloWorld As Label = e.Row.FindControl("lblHelloWorld")
My suggestion is to do something like the Typed DataSets... and in the page's code behind (designer file / partial class), create a typed version of the Gridview with its containing controls all explicitly defined.
Ultimately, it would mean that in the RowDataBound event of the GridView, to get the label, you would simply use:
As the "Row" property would be a typed gridview row (like a typed datarow in ADO.NET)
This would be very useful. At the moment, you have to run the solution to work out if you misspelt the name of the control in the FindControl command. Having a "typed gridview" removes the need for FindControl and validates the code using intellisense.
Jan 04, 2009 05:45 AM|Joël Hébert|LINK
good idea, would be nice if there was a recursive find embedded in the design time so we never have to use
Jan 04, 2009 05:02 PM|aboreham|LINK
Microsoft won't consider this idea unless it gets a higher rating. I was wondering if you could rate it here: