Dear all,
I'm attempting to build an UltraWebGrid and I've noticed that it seems to want to be databound to a dataset. Since Datasets are not as performant as DataReaders and I'm planning to show read-only summary data, I have to build the grid manually.
What I'm stuck trying to understand is the method for creating multiple column headers. Some of the columns need to be grouped together, for example I have some columns relating to firstname and surname and I wish to have a "master" column header called "customer". I then wish to have a header called "Address" and under that the various address columns.
I note that columns have their own header text but no obvious means of adding extra columns. It's probably just me working late, but I can't see it. I glanced a screenshot which did this but I can't see the properties exposed clearly that I need to amend.
I hope this is an easy question for somebody and that a helpful someone can point me in the right direction.
Best,
Mike
This needs to be done programmatically. There is a sample that can be installed that shows the code to do this, if you are using the latest version you need to install the SDK, earlier versions of the product had the samples install automatically.
Anyway the sample can be seen online here:
http://samples.infragistics.com/2008.2/webfeaturebrowser/contents.aspx?showCode=True&t=WebGrid/MultiHeaders/MultiHeaders.aspx~srcview.aspx?path=../webfeaturebrowservb/WebGrid/MultiHeaders/MultiHeaders.src~srcview.aspx?path=WebGrid/MultiHeaders/MultiHeaders.src
there are tabs at the top which will show the ASPX and the code behind on how to code the multiheaders
The short of it is that each Header has a RowLayoutColumInfo object, which can be used to move the headers around. You can then add more headers (unbound headers we would call them) and then position them.
take a look at the code pages from the samples, its pretty self explanatory and the sample code is commented on what is going on.
Hi Daniel,
Thanks for responding quickly. I downloaded the SDK (for .NET 2.0 - also applies for VS2008/.NET3.5?) and notice a problem with the sample.
You see, I have an unbound data grid. The sample for multiple columns only works when you have a bound data grid since the code which sets up the multiple-headers is present in the InitializeLayout event of the datagrid, which only appears to be called if the grid is databound and occurs just before the data binding takes place.
Since I don't have any data binding, the event doesn't fire and the multiple headers don't run.
And there's no other way I can access:
Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e...
Please help! The documentation doesn't appear to say anything on this matter.
Is there some way to add a 2nd column header within the ASPX file (webgrid definition) instead of the code-behind?
The LayoutEventArgs e.Layout is just a reference to the grid.DisplayLayout.