Hello,
I am having UltraWingrid wherein I am binding the hierarchical data using List<T>. The version of ultrawingrid is v10.3.
This list object is dynamically created which contains hierarchical data similar to a treeview. Currently we are creating the hierarchy using Employee - Manager concept. I have attached the Employee Class and EmployeeList class that we are using for this purpose along with the snapshot of how the grid looks when the list is bound.
The problem is that when I use the list object, the first column of the grid is having too much width. Also we are not able to find a way to resize this column programatically. I have attached sample windows application in which I am using the grid. You can execute the code and see the result to get what I am saying.
Any help regarding this would be appreciated. Its urgent.
Thanks,
Amit Waghchoure
Hi Mike,
Thanks for this, I was setting the MaxBandDepth in the initializeLayout event for the gird (way too late), now that I've set the MaxBandWidth before I bind the datasource to the gird, I now have my issue resolved.
I remember reading a while back that the MaxBandDepth has to be set before datasource binding to take affect, and your comment reminded me of this.
Thank you so much
Best Regards,
Gerald
Hi Gerald,
Gerald Benson said:I am having the same problem, I too have an ultragrid bound to a hierarchial BindingList<T> and when I have set the AllowColSizing property to AllowColSizing.Free, there appears a very wide horizontal scrollbar, and alot fo whitespace in the grid to the right hand side (seems to be setting the region based on the column widths as if I had set the AllowColSizing property to AllowColSizing.Synchronized).
That doesn't sound like the same issue at all. The spacing on the right exists to accommodate the expansion of the bands. MaxBandDepth should work, though - unless you are setting it too late, after the bands have already been created. When are you setting this property?
I am having the same problem, I too have an ultragrid bound to a hierarchial BindingList<T> and when I have set the AllowColSizing property to AllowColSizing.Free, there appears a very wide horizontal scrollbar, and alot fo whitespace in the grid to the right hand side (seems to be setting the region based on the column widths as if I had set the AllowColSizing property to AllowColSizing.Synchronized).
As mentioned, when I have the grid set to AllowColSizing.Synchronized, the first column is extremely wide.
I have tried to set the MaxBandDepth to a very low value, with no affect.
Thanks for any light you may be able to shed. I am using Version 10.2.
Regards,
Hello Mike,
Thank you very much for your prompt reply. The solution provided by you helped us a lot.
Thanks
Amit
Hi Amit,
By default, the grid synchronizes the column widths of every band. So in a case like this where you have a recursive data source, there are essentially an infinite number of bands and for each band the grid indents a little bit. This means that the first column gets very big in order to accommodate the indentation all the way down the hierarchy. The grid limits you to 100 bands of depth by default, but that still means 100 level of indentation.
So there are a number of ways you can handle this.