Hi,
I have a webgrid which is connected to a SQL-datasource, which in turn has it's SELECT statement set to a stored procedure.
This means (as far as I know) that the order of the columns is decided by the stored proc.
How can I rearrange the column positions on the server? In a winform grid I would use the visiblePosition property, but that is not available here.
How to solve this one?
You have two options.
One option is to define the layout ahead of time, to organize your columns as you choose. There are many different ways to accomplish this result - one is to define the layout in the designer, and another is to turn off AutoGenerateColumns and add the columns as you want them in the InitializeLayout event handler. There are likely other ways as well; these are the first two that come to mind.
The other option is to move the columns within their containing collection, which is what you specifically asked for. The UltraGridColumn class has a Move method, which repositions the column within its containing collection. The link leads to our online help documentation for this method in NetAdvantage for .NET 2009 Volume 1.
Super!
The initializeLayout option did the trick!
And since I now add the columns I want instead of hiding the others, my grid is so much faster!
Many thanks for the speedy reply!