How to implement CustomSortType on server side

  1. #1

    How to implement CustomSortType on server side

    Hi guys,
    I'm facing a problem that I haven't been able to match in any of available examples on your website and forum.
    I have a data store that is being generated from the XML in order to be able to have dynamic column names, formatting and so on. Everything is working fine so far the only thing I'm not able to achieve is to attach dynamically based on column name or id a CustomSortType.
    I've tried doing the following:

                    
                    XmlDataSource1.Update();                
                    XmlDataSource1.DataBind();
                    mainStore.DataBind();
    
    
                    foreach (var currentField in mainStore.Reader[0].Fields)
                    {
                        if (currentField.Name.Contains("Cost_Status"))
                            currentField.CustomSortType.Fn = "sortingRAG";
                    }
    but it doesn't work I still get a column with normal sorting. Any ideas on how to make it work?

    Thanks
  2. #2
    Hi,

    Please clarify where do you call this code?
    foreach (var currentField in mainStore.Reader[0].Fields)
    {
        if (currentField.Name.Contains("Cost_Status"))
            currentField.CustomSortType.Fn = "sortingRAG";
    }
    If during DirectEvent, the changes won't affect to client side. In this case you should use the Store RemoveField and, then, AddField methods.

Similar Threads

  1. Implement waiting bar client/server
    By HaamSapTjai in forum 1.x Help
    Replies: 1
    Last Post: Mar 08, 2012, 3:04 PM
  2. Replies: 3
    Last Post: Dec 26, 2011, 2:32 PM
  3. Replies: 1
    Last Post: Dec 01, 2010, 6:14 PM
  4. Replies: 4
    Last Post: Mar 19, 2010, 12:35 PM
  5. Replies: 6
    Last Post: Sep 01, 2009, 2:06 PM

Tags for this Thread

Posting Permissions