Hi, i have a hierarchical grid , i bind 2 datasets to a grid to display data. the creation of this grid works. but whats the best way to design the outfit of the columns of band 0 (parent) and band 1 (child)
i would set the width,format (like time), hide and so on...my my previous solution did not really work on a hierarchical grid.is it only possible in the
UltraGrid1_InitializeLayoutlikee.Layout.Bands(1).Columns("Field").Format = "dd.MM.yyyy HH:mm:ss"is there no other solution in the init of the grid, or elsewhere
greetings martin
Hello Martin,
If I understand correctly your requirement, the best place for such modifications would be the InitializeLayout event of the UltraGrid control. Once you bind your UltraGrid, the first event that will fire would be the InitializeLayout, so you would have an access to the Layout of the Grid, and you could modify it as you wish. If there are any other dynamic changes to the layout of the UltraGrid or to the data itself, you could still modify the layout through the UltraGrid1.DisplayLayout object once the other modifications are applied to your application.
I have tested the mentioned scenario and I do have an access to the second band. Also if the modifications are not applied you should verify that you are hooking to this event prior assigning the DataSource to your UltraGrid and also the data type of the desired "Field" column is DateTime.
Please feel free to let us know if you have any other questions with this matter.
How to format the grid column with commas and two places of decimal.
I am using the below code in grid initialize layout event but it is not working.
e.Layout.Bands[0].Columns[i].DataType ="System.Decimal";
e.Layout.Bands[0].Columns[i].Format ="###,#0.00";
Please provide me the correct code for formatting.
Thanks,
Ani
Hi Ani,
This code looks fine to me. I tried it out and it works fine for me. What's the problem?