C1Gridview Glyph on Sorting

Originally Posted 29 November 2013, 8:17 pm EST

  • Originally Posted 29 November 2013, 8:17 pm EST

    Hi

    I have a grid bound to an SQL data source (stored procedure), however when I click to sort a column I see "ng" followed by the sort direction glyph. So if my column was Transfer it would display "Transferng^". if the text is too long the ng underlies the existing text. It only seems to apply to Template columns. Version is 4.0.20133.145.


    <wijmo:C1GridView ID="C1GVHoldings" runat="server" AutogenerateColumns="False" AllowSorting="True"
    Style="top: 0px; left: 0px" OnRowCommand="C1GVHolding_RowCommand"
    DataSourceID="SDSHolding" ShowFooter="True"
    CallbackSettings-Action="Sorting" onrowcreated="C1GVHoldings_RowCreated"
    onrowdatabound="C1GVHoldings_RowDataBound" >
    <CallbackSettings Action="Sorting" />
    <Columns>
    <wijmo:C1BoundField DataField="Entity_Number" Visible="False">
    </wijmo:C1BoundField>
    <wijmo:C1ButtonField DataTextField="Entity_Name" SortExpression="Entity_Name" HeaderText="Fund"
    CommandName="Select" ButtonType="Link">
    <HeaderStyle HorizontalAlign="Left" />
    <ItemStyle HorizontalAlign="Left" />
    </wijmo:C1ButtonField>
    <wijmo:C1TemplateField HeaderText="Info">
    <ItemTemplate>
    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Details"
    Text="<img src='Images/info1.jpg' border=0>"></asp:LinkButton></ItemTemplate>
    <HeaderStyle HorizontalAlign="Center" />
    <ItemStyle HorizontalAlign="Center" />
    </wijmo:C1TemplateField>
    <wijmo:C1TemplateField HeaderText="Holding" SortExpression="Total_Shares">
    <ItemTemplate>
    <asp:Label ID="Label4" runat="server" CssClass="AlignRight" Text='<%# Acusoft.cls_GlobalUtilities.FormatValueDP(DataBinder.Eval(Container, "DataItem.Total_Shares"), DataBinder.Eval(Container, "DataItem.Round_Shares")) %>'
    Width="100%">
    </asp:Label></ItemTemplate>
    <HeaderStyle HorizontalAlign="Right" />
    <ItemStyle HorizontalAlign="Right" />
    </wijmo:C1TemplateField>
    <wijmo:C1BoundField DataField="Fund_Currency" SortExpression="Fund_Currency" ReadOnly="True"
    HeaderText="Currency">
    <HeaderStyle HorizontalAlign="Left" />
    <ItemStyle HorizontalAlign="Left" />
    </wijmo:C1BoundField>
    <wijmo:C1TemplateField SortExpression="Latest_Price" HeaderText="Price">
    <ItemTemplate>
    <asp:Label ID="Label5" runat="server" Text='<%# Acusoft.cls_GlobalUtilities.FormatValueDP(DataBinder.Eval(Container, "DataItem.Latest_Price"),DataBinder.Eval(Container, "DataItem.Round_Price")) %>'>
    </asp:Label>
    </ItemTemplate>
    <HeaderStyle HorizontalAlign="Right" />
    <ItemStyle HorizontalAlign="Right" />
    </wijmo:C1TemplateField>
    <wijmo:C1BoundField DataField="Pricing_Comment_Note" HeaderText="Price Info">
    <HeaderStyle HorizontalAlign="Left" />
    <ItemStyle HorizontalAlign="Left" />
    </wijmo:C1BoundField>
    <wijmo:C1BoundField DataField="Prices_Date" SortExpression="Prices_Date" HeaderText="Price Date"
    DataFormatString="dd/MM/yyyy" FooterText="Total">
    <HeaderStyle HorizontalAlign="Right" />
    <ItemStyle HorizontalAlign="Right" />
    </wijmo:C1BoundField>
    <wijmo:C1TemplateField SortExpression="Market_Value" HeaderText="Market Value">
    <ItemTemplate>
    <asp:Label ID="Label6" runat="server" Text='<%# Acusoft.cls_GlobalUtilities.FormatValueDP(DataBinder.Eval(Container, "DataItem.Market_Value"), 2) %>'>
    </asp:Label>
    </ItemTemplate>
    <HeaderStyle HorizontalAlign="Right" />
    <ItemStyle HorizontalAlign="Right" />
    </wijmo:C1TemplateField>
    </Columns>
    </wijmo:C1GridView>
    </div>
    <asp:SqlDataSource ID="SDSHolding" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
    SelectCommand="Web_Fund_Holdings" SelectCommandType="StoredProcedure">
    <SelectParameters>
    <asp:ProfileParameter Name="Contact_Code" PropertyName="Selected_Contact_Code" Type="String" />
    <asp:ControlParameter ControlID="C1IDAsAt" Name="Date_Selected"
    PropertyName="Date" Type="DateTime" />
    <asp:ProfileParameter DefaultValue="" Name="Funds" PropertyName="Funds" Type="String" />
    <asp:Parameter DefaultValue="0" Name="Option" Type="Int32" />
    </SelectParameters>
    </asp:SqlDataSource>
  • Reply

    Jamie,

    Unfortunately I could not replicate this issue at my end. I created template columns within GridView and on performing sorting on the columns, I could not notice ng being appended to the column headers. I am attaching the sample which I used to test this issue.

    Could you please take a look at it and let me know your observations? If you still face any issues then could you please modify my sample such that it replicates this issue and attach it here. I will take a look at it and will let you know about my findings.

    Regards,
    Sankalp
    2013/12/GridView_Template.zip
  • Reply

    Thank you for the sample. As noted I can't get it display the "ng" noted.

    Can I ask why you are binding manually using a dataset and Datasource over the automatic SQL DataSource and DatasourceID?

    I can see that binding manually would give you access to the dataset to update the headers based on row content prior to binding.



  • Reply

    Hi Sankalp

    Sample plus DB. You'll need to restore the db to an SQL instance and plug in the web.config details.

    Glyph is on last two columns when sorting.

    Also if I update the header it forces the grid to rebind which doubles the total in the footer (first pass only). Is there a better way to do this?

    Kind Regards
    Jamie
    2013/12/C1GridviewGlyph.zip
  • Reply

    Jamie,

    I think the issue is only reproduced when the header text alignment is set to "Right". Also I ran your sample and when I performed sorting on the right aligned column, I got some garbled text which resembled "ng". It seems that the sort icon is getting distorted when sorting is performed on a column whose header text is right aligned. I can replicate it in my sample as well once I make the specified changes.

    Could you please try changing the header text alignment for the last two columns to "left" or "center" and let me know the results. This looks like a bug to me; however I would like to know your observations before I actually escalate it to the devs.

    Regards,
    Sankalp
  • Reply

    Hi Sankalp,

    It definitely does it on a right align, but left and center were OK.

    Do you want me to raise a new question re changing the header/double binding?

    "Also if I update the header it forces the grid to rebind which doubles the total in the footer (initial load only). Is there a better way to do this/is this an issue?"

    Kind Regards
    Jamie

  • Reply

    Jamie,

    I have escalated the issue related to the garbled sort icon to the developers. We will get back to you as soon as there would be an update available.

    You may want to create a separate thread for the new issue with more description which also includes the steps or a sample to replicate it.

    Regards,
    Sankalp
  • Reply

    Jamie,

    There is no specific reason for creating a runtime binding for C1GridView. However as you might have noticed, I have not made any changes to formatting of the headers or columns. If the sample works fine for you then can you please modify it such that it mimics your implementation? Unfortunately I cannot replicate this issue at my end by either using runtime or design time binding.

    Regards,
    Sankalp
  • Marked as Answer

    Reply

    Hello,

    This issue is fixed in the latest build 3.5/4.0.20133.153 which is available at : http://prerelease.componentone.com/dotnet30/c1webwijmo.webforms/2013-t3/C1WebWijmo.Webforms_3.5.20133.153.zip

    Regards
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels