Hello,
I'm using UltraWebGrid 7.2.20072.61 and I'm trying to add a checkbox in the column header (for typical check all functionality). The Problem is that the data I'm using is dynamic in that I've created a Pivot on dates using a stored procedure. What this means is that the columns that I need the checkbox header on could be anywhere in count from 1 to 180 so obviously I can't do this at the design level.
My first several columns are frozen and work great and I have a hidden DataKeyField Column for the userid. The problem comes when I try to cast the next columns as template columns. The cast is failing. I've tried creating a loop in the UltraWebGrid1_InitializeLayout based on the number of columns sent back (past the first five which will always be the same). I've also tried adding templated columns but they just appear after the bound columns and the header (using GridHeaderTemplate class with an InstantiateIn) isn't applied.
All of the samples I've found in the KB are for older versions and do not cover how to add checkbox headers for dynamically created columns.
Does UltraWebGrid 7.2 support this and if so how is this done?
Thanks for any help!
Hi,
I have downloaded and upgraded the sample and it is working with no issues. I am including the page's markup and the code behind.
Please send me regarding any questions.
Magued
Hi Magued,
The second link describes exactly what I'm trying to do, cast a bound column to a templated column at runtime. It results in:
Unable to cast object of type 'Infragistics.WebUI.UltraWebGrid.UltraGridColumn' to type 'Infragistics.WebUI.UltraWebGrid.TemplatedColumn'.
This was the reason for the original post i.e. the cast fails. I'm using UltraWebGrid 7.2.20072.61 if that helps (the example you linked to was for v3.0.20041 and may be deprecated in 7.2).
I am following up with you and if the issue had been resolved.
Hi Rowland,
Please have a look at the following link:
http://forums.infragistics.com/forums/p/1540/31497.aspx#31497
The link demonstrates adding a templated column to the webgrid with a header containing a checkbox. I am also including a sample that adds a hyperlink at runtime to a CellItem. Our knowledge base article:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=5207
Gives an example of how to cast a WebGrid's column into an object of Type TemplatedColumn.
Please update the forum if the information is helpful or if you would like to discuss the issue further
Any help would be appreciated here. Almost 3 months with NO answer from anyone at infragisitics.