I am currently using infragistics v.6.3. I have a data bound web grid which I want to create a cell template with a text box in it. However my web grid is defined in InitializeLayout event in C# and I want to define the cell template there as well. I am not sure what the syntax is to define a cell template. Any suggestions?
Hello,
Yes, this is possible -- there is an interface called ITemplate that a custom class needs to implement at rutime.
There is a great thread on how this can be achieved, complete with full source code:
http://forums.infragistics.com/forums/t/2995.aspx
Hope this helps.
Hey thanks for the help! The only problem I am having now is that my grid is already data bound so the columns are already created. I don't want to add new ones and I'm not sure how to change the data bound columns to a templated column. Also I am not sure where to write the code for the RestoreTemplateColumn function. If you could help me out that would be awesome!
I really have no additional ideas for this scenario, and/or I am missing something in your setup. If the columns are already bound, then why are we in need for dynamic templates at runtime?
I am not sure I understand the complete scenario in details, but I think the following technique for getting controls inside template and switching them in IntislizeRow based on the runtime scenario will help:
http://forums.infragistics.com/forums/t/22474.aspx
The webgrid is bound on the PageLoad event to a dataset and therefore the columns are already created. However I want each of the cell templates for those columns to be a textbox for easier data entry into each cell. Is there any way to specify the cell template for these columns that are created when the webgrid is bound?