0 is displayed though the value is Null

  1. #1

    0 is displayed though the value is Null

    We have implemented the grid list. The int value seems to be displayed as 0 though the data is null in the database(SQL server).

    Are there any way to not display 0 when null other than changing to string value?
    We are using EXT.net 4.8.3.

    <ext:GridPanel ID="GridPanelA"
        runat="server" ColumnLines="true" TitleCollapse="true"
        Region="Center" EnableColumnMove="false" EnableColumnHide="false">
            <ext:Store ID="StoreId" runat="server" PageSize="20">
                    <ext:Model runat="server">
                            <ext:ModelField Name="Float1" Type="Float" />
                            <ext:ModelField Name="Float2" Type="Float" />
                            <ext:ModelField Name="Int1" Type="Int" />
                            <ext:ModelField Name="Int2" Type="Int" />
                            <ext:ModelField Name="Int3" Type="Int" />
        <ColumnModel runat="server">
                <ext:Column runat="server" Text="GroupA">
                        <ext:Parameter Name="Sortable" Value="true" />
                        <ext:Parameter Name="Align" Value="Center" />
                        <ext:Column runat="server" ID="FloatA" Text="FloatA" DataIndex="Float1" Width="150" />
                        <ext:Column runat="server" ID="FloatB" Text="FloatB" DataIndex="Float2" Width="150" />
                        <ext:Column runat="server" ID="IntA" Text="IntA" DataIndex="Int1" Width="100" />
                        <ext:Column runat="server" ID="IntB" Text="IntB" DataIndex="Int2" Width="100" />
                        <ext:Column runat="server" ID="IntC"Text="IntC"  DataIndex="Int3" Width="120" />
            <ext:PagingToolbar runat="server">
            <ext:CheckboxSelectionModel runat="server" Mode="Multi" />
    Last edited by fabricio.murta; May 25, 2020 at 5:19 PM. Reason: convert attachment into code block
  2. #2
    Hello @mkomiyama, and welcome to Ext.NET!

    Have you tried adding AllowNull="true" to your ext:ModelField lines?

    Here's a discussion that may interest you (although it is related to charts, it involves stores with null values):

    Handle null values as gaps in a Line Chart

    Hope this helps!

    p.s.: please do not attach code samples as .txt files (do not attach at all), add them as code blocks so we can see it; we almost missed your one here.
    Last edited by fabricio.murta; May 25, 2020 at 5:38 PM.
  3. #3

    0 is displayed though the value is Null

    Now we can show blank.
    Thank you for your help.

    Please mark as [CLOSED].

Similar Threads

  1. Replies: 2
    Last Post: Jun 16, 2016, 4:48 PM
  2. Replies: 1
    Last Post: Nov 07, 2013, 3:40 PM
  3. Replies: 0
    Last Post: Dec 01, 2011, 7:43 AM
  4. Replies: 1
    Last Post: Jun 08, 2010, 12:38 PM
  5. Replies: 0
    Last Post: Mar 05, 2010, 4:28 AM

Tags for this Thread

Posting Permissions