The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

GridPanel sorting null values - bad order

  1. #1

    GridPanel sorting null values - bad order

    In this Example, if I click on the Item Column then it's Short by ASC.
    in this case, all null and black come first, and I want all Null and blank come last.

    please suggest me what to do?


    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co", "9934" },
                    new object[] { "Alcoa Inc", null },
                    new object[] { "Altria Group Inc" },
                    new object[] { "American Express Company", "346" },
                    new object[] { "American International Group, Inc.", "44" },
                    new object[] { "AT&amp;T Inc.", "789" },
                    new object[] { "Boeing Co.", "654" },
                    new object[] { "Caterpillar Inc.", "666" },
                    new object[] { "Citigroup, Inc.", null }
                };
    
                this.Store1.DataBind();
            }
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Simple Array Grid - Coolite Toolkit Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="company" />
                            <ext:RecordField Name="item" Type="Int" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
            <ext:GridPanel 
                ID="GridPanel1" 
                runat="server" 
                StoreID="Store1" 
                StripeRows="true"
                Title="Array Grid" 
                TrackMouseOver="true"
                Width="600" 
                Height="350"
                AutoExpandColumn="Company">
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column ColumnID="Company" Header="Company" Sortable="true" DataIndex="company" />
                        <ext:Column ColumnID="Item" Header="Item" Sortable="true" DataIndex="item" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>          
        </form>
    </body>
    </html>
    Last edited by nikhilbh85; Apr 11, 2018 at 6:33 AM.

Similar Threads

  1. GridPanel sorting null values - bad order
    By gercas in forum 1.x Help
    Replies: 4
    Last Post: Apr 03, 2018, 10:17 AM
  2. [CLOSED] GridPanel null values and ModelField.UseNull
    By bbros in forum 3.x Premium Help
    Replies: 8
    Last Post: Dec 29, 2014, 10:55 AM
  3. [CLOSED] GridPanel - filtering by null values.
    By altranvfdev3 in forum 2.x Premium Help
    Replies: 1
    Last Post: Nov 28, 2014, 1:46 PM
  4. Replies: 1
    Last Post: Nov 07, 2013, 2:40 PM
  5. Replies: 2
    Last Post: Aug 15, 2011, 4:03 PM

Posting Permissions