Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
Serverside column positioning
posted

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?

Parents
No Data
Reply
  • 45049
    Verified Answer
    posted

    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.

Children