How to change the order of columns in Ultragrid?The scenario is, I have a table bind in the datasource. Example:The DataTable in dataSource bind in the ultragrid consist of column 1, column2, column3, column4 & column 5 and my Problem is i want to add an extra columns in between column3 & column4 but the extra columns I want to add is not part of a dataTable in dataSource. When I view the table in Ultragrid the extra columns i added appeared after column5 and i want to insert the extra columns between column3 & column 4. please help. tnx
Hi,
You can use the "VisiblePosition " property of the Header object of the desired column and set it to the desired value.
i.e.
ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.VisiblePosition = 1;
Hope it will help you.
I've been programmatically formatting some ultragrids using visibleposition and have been noticing some odd side effects, particularly with calculated object properties and button controls.
Does the Band insist the columns have a sequential VisiblePosition order under the hood? If I set a column to VisiblePosition 1000 will the Visible Position change to (maxcolumns-1)? If I change column 1's visible position to the same visible position of column 2, will column 2's visible position change to that of column 1? Is it safe to set visible positions starting with the left most column and working forwards?
Thanks
Jim