Tags

, , ,

I’m sure one of you might have trouble to get control’s instance in
template column of ultrawebgrid.

For example:

You have a ultrawebgrid on your page, and have a template column on it with “Fullname” as key, then you have a textbox control inside it and has id called “tbxFullname”.

Here is how you retrieve the textbox instance of tbxFullname:

Infragistics.WebUI.UltraWebGrid.TemplatedColumn myTmpCol = (Infragistics.WebUI.UltraWebGrid.TemplatedColumn)e.Row.Cells.FromKey(“Fullname”).Column;

Infragistics.WebUI.UltraWebGrid.CellItem myCellItem = (Infragistics.WebUI.UltraWebGrid.CellItem)myTmpCol.CellItems[e.Row.Index]; //e.Row.Index > row that you want to get tbxFullname’s control from.

TextBox txtBox = (TextBox) myCellItem.FindControl(“tbxFullname”);

That’s it… finally we can get the instance of textbox control.

Advertisements