Hello,
I try to acheive a hierarchy of data, but it does not do what I expect.
I need the WinGrid not to show unncessary groups that already been shown in another group level and also use 1 single band if possible.
I have attached a sample project for demonstration.
You can see from the sample that the first column size is too big and cannot be resized. Also, most of the time the application freezes.
What do you mean by 'unnecessary groups'? Do you not want the headers to be shown repeatedly? If so, take a look at the HeaderPlacement property on the grid's Override object; you may want to try setting this to OncePerGroupedRowIsland. As for the column sizes, by default the grid will match the sizes to the child column sizes, so you could try setting the Override's AllowColSizing property to Free; you may want to call PerformAutoResize on each of the columns in InitializeLayout so that the text is visible.
-Matt
Thanks for your reply!
AllowColSizing was good, but after that the columns shrinked. I use PerformAutoResize in InitializeLayout, but nothing is happening. Also, it seems that there is a bug if there are multiple bands, because the application freezes after I use it for around 1 minutes. This is not my application, but it is the simple test application that you could create it yourself or use the one I am attaching.
{
col.PerformAutoResize();
}
I don't experience any issues with the application freezing, and I left your sample running for about 10 minutes (with a debugger attached). If you run it with a debugger and click on the "pause" button when it's frozen, what is the call stack (try repeating this until there is some Infragsitics code in the stack, if at all).
As for the column sizing, try using the overload that takes into account the header, i.e.:
col.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true);
The rows aren't available yet, so it won't be able to take those into account, but at the very least the headers won't be clipped.
Thanks for your prompt reply!
Also I did add the overload but it still does not work:
Try doing the PerformAutoResize logic at the end of button2_Click,after all the logic here has executed. At this point, the resizing worked for me.
As for the other issue, I still didn't have any trouble with the application freezing. I tried resizing columns, moving them around, and clicking into the cells, none of which had any effect. You may want to try downloading the latest hotfix to see if that resolved your issue.
Thank you!
The sizing worked!
Unfortunately I have the latest version of the components and there is no more hot fixes.