Can someone give me some direction on how to get a handle to control, say an asp.net label, inside a templated column on a webgrid that was constructed at design time?
In a templated column you can have any content - for example you can start with just a placeholder and then add controls there programmatically in the InitializeRow event. For example:
<igtbl:TemplatedColumn> <CellTemplate> <asp:placeholder runat="server" ID="Placeholder1'> </CellTemplate></igtbl:TemplatedColumn>
and then in InitializeRow, you can do something similar to this (pseudo code, just for reference)
Thanks for this info but it's not exactly what I was looking for..at least I don't think.
I have an existing webgrid that has a templatedcolumn. In this TC there are 3 .net controls all wired up for data. This was done in design mode. I don't want to change this.
I need to figure out how to get access to one of these controls, the label, and apply a nowrap and/or width attribute to it.
Are you saying I can use the psuedocode part above to get a handle to this control?
I was trying to look into the cellitems object from initlayout or before databind to get at this control but the control count was 0. Maybe initrow is the place to do it.