Improvement 'patch' for client-side binding works ok, but not when doing sorting

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 15 Dec 2010 Link to this post


    i've made change in radgrid javascript events to overcome limitations of dealing with ID="data field name" and it works nice for initial load:
    <asp:HyperLink runat="server" Text="{Name}" bindfield="Name,ID" exportformats="html" OnPreRender="hlName_PreRender" />
    <asp:Label runat="server" Text="{Name} for PDF" exportformats="pdf" bindfield="Name" />
    <asp:Label runat="server" Text="{Name} for Excel" exportformats="excel" bindfield="Name" />
    As you can see, i need more flexible way to manage fields. In your case, I cannot created 2 fields referencing the same datafield in the same ItemTemplate. Here I am having separate field sets for exporting into various formats. { } stands for Eval :)

    I wonder why you have not used any custom attribute for WebControl, which would stand for DataField - you may add any - but instead sticked to ID and made serious usability limitations... :(

    Anyway, now i have the problem with this: if I use ID="data field name" - sorting works as expected, but if I use my approach, without ID, correct data is returned from webmethod as before and dataSource is ok, but the grid is NOT sorted. Please, tell me what should i change in order it did sorting! :) I need it very much, but I don't have idea,  where in the code you check for ID to use it somehow for sorting...
  2. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 16 Dec 2010 Link to this post

    Time is running out :( I will try to use server-side properties to create HTML markup instead :)
    <asp:Label ID="Url" runat="server"/>
    Url = string.Format("<a href='Pages/Company.aspx?ID={0}'>{1}</a>", companyInfo.Name, companyInfo.ID)
    inside WCF service. I will also use Attributes for markup of all fields and use them in server-side events for export preparation, etc.
Back to Top