Hi,
I have window form which contains ultragrid. Data for the ultragrid should be displayed as shown below.
Groupbox containing ultragrid, having two columns but rows being differentiated on category
Datasource for ulrtagrid is binded by a datatable.
Can someone help me with piece of code how to display data like above(i.e containing multiple row headers).
Thanks,
Shailaja
Hi Shailaja,
Thank you for posting in our forums.
You can achieve such layout using the “Group By” functionality of the grid. You can group the grid rows by the values in a column. You can do this by using this line of code:
ultraGrid1.DisplayLayout.Bands[0].SortedColumns.Add("Category", false, true);
For more information on this method please follow this link:
http://help.infragistics.com/Help/Doc/WinForms/2012.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v12.1~Infragistics.Win.UltraWinGrid.SortedColumnsCollection~Add(UltraGridColumn,Boolean,Boolean).html
I have attached a sample which demonstrates this suggestion.
Please let me know if you have any additional questions.
Thank you for the reply.
Seems like my purpose of achieving a grid containing multiple row headers won't be resolved by groupby functionality.
GroupBy functionality groups the rows of grid based on criteria/category applied, but my grid appearance is different here.
Its like a grid containing multiple rows where in few rows appear as cells being merged and bold.
Kindly recheck for the scenario described above and revert.
I still believe that using group by rows is the approach with which you can achieve the closest layout to your requirements. I have modified my sample to achieve a closer layout to the one from your screenshot, by removing the group by row indentation, changing the group by row appearance, removing the expansion indicators and the groupby box and placing the column headers only on the top of the band. The sample is attached to this post please take a look at it.
If this doesn’t fulfill your requirements please log a new product idea for this feature from our product ideas site: http://ideas.infragistics.com. Please include a link to this thread in your idea for further reference.
Hi Dimitar,
Thank you for the solution.
You are right, the approach will achieve the layout in another way.
But for my bad luck,I have to display the data in the same layout which I described earlier.
let me rephrase the problem. How to have colspan for particular row in Ultragrid. Hope this helps you in understanding my requirement here.
Thanks,Shailaja
As I noted in my previous reply, if the suggestion with group by rows doesn’t work for you, please log a new product idea for this feature from our product ideas site: http://ideas.infragistics.com. Please include a link to this thread in your idea for further reference.