How to change order layout of ColumnModel for all of app?

  1. #1

    How to change order layout of ColumnModel for all of app?

    I have about 20 columns in real model, but I can't seem to order it the why I want to. I want to order them how I have them in the list.

    <ColumnModel ID="colModel">
        <Columns>
            <ext:Column ID="firstColumn" runat="server" Text="ticket#" Width="85" Sortable="true" DataIndex="ticketID" />
            <ext:Column DataIndex="secondColumn" Text="value2#" ItemID="ValueNo" Visible="False" Width="85" />
            <ext:Column DataIndex="thirdColumn" Text="value3#" Width="75" ItemID="value3#" Visible="False" />
            <ext:Column DataIndex="fouthColumn" Text="value4#" ItemID="value3#" Flex="1" Visible="False" />
            <ext:Column DataIndex="fifthColumn" Text="value5#" />
            <ext:Column DataIndex="sixthColumn" Text="value6#" Flex="1" />
            <ext:Column DataIndex="seventhColumn" Text="value7#" Flex="1" />
            <ext:Column DataIndex="eighthColumn" Text="value8#" Flex="1" />
    </ColumnModel>
    Is this caused by the stateful of grid?
    Last edited by fabricio.murta; Jan 30, 2019 at 8:29 PM. Reason: Formats the code block (indent)
  2. #2
    Hello @Juan, and welcome to Ext.NET forums!

    We've edited your post to wrap the code in [code][/code] tags and reviewed the code block indentation for better reading. We kindly ask you to do so once you want to share code snippets, as that helps us quickly read the code and understand what's about.

    Please take your time to review our forums guidelines on posting new threads, it considerably helps us help you:
    - Tips for creating simplified code samples
    - More Information Required
    - Forum Guidelines

    Now, to your question.

    I notice at least a couple intellisense issues if I copypaste your code in a grid block under Visual Studio:
    - no closing </Columns> tag.
    - no runat="server" keyword in the column definition lines.

    But as you reported, you're getting the grid displayed and just the order of the columns is not how you wanted it to be. For your suspicion the answer is 'yes'. If you are saving the state, then if at some point you had the columns in a given order and opened it in the web browser, it would have been saved via cookies (or other method if you use a custom one).

    You can choose not to save the columns ordering with the stateful settings; depends on how you set it up. You can also reset/ignore saved states if they were saved prior to a certain date (would need some advanced client-side programming).

    But if you don't really want to reset what users have set up in their environment (for production), you may just open the page using an incognito/anonymous chrome/firefox (probably also Edge, not sure about IE), and it should load a fresh version of the grid with the columns in the order they appear in the ASPX markup. Notice you might need to close and reopen all incognito/anonymous tabs of a given browser in order to reset again anything cached during a session.

    Hope this helps, or at least guide you further in the scenario you're facing!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [GridPanel] Change column order
    By thece in forum 2.x Help
    Replies: 0
    Last Post: Oct 20, 2015, 8:55 AM
  2. [CLOSED] How to reconfigure the ColumnModel layout?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Apr 24, 2013, 12:03 PM
  3. Change Order Of GridPanel' Column in code behind
    By shaileshsakaria in forum 2.x Help
    Replies: 1
    Last Post: Feb 22, 2013, 4:03 AM
  4. Replies: 1
    Last Post: Aug 21, 2012, 9:43 AM
  5. [CLOSED] How to change column order in the grid.
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 15, 2009, 4:48 AM

Tags for this Thread

Posting Permissions