radfileexplorer custom column sorting

4 posts, 0 answers
  1. Billy
    Billy avatar
    1 posts
    Member since:
    Jul 2013

    Posted 05 Jul 2013 Link to this post

    I have a radfileexplorer with three custom columns that are created like this: 

    // Sets up a gridTemplateColumn for the Owner

    GridTemplateColumn gtcOwner = new GridTemplateColumn();

    gtcOwner.HeaderText = "Owner Name";

    gtcOwner.UniqueName = "Owner";

    gtcOwner.DataField = "Owner";

    gtcOwner.SortExpression = "Owner";

    rfe.Grid.Columns.Add(gtcOwner);

    // Set up a gridTemplateColumn for the upload date

    GridTemplateColumn gtcDate = new GridTemplateColumn();

    gtcDate.HeaderText = "Date";

    gtcDate.UniqueName = "Date";

    gtcDate.DataField = "Date";

    gtcDate.SortExpression = "Date";

    rfe.Grid.Columns.Add(gtcDate);

    //Sets up gridTemplateColumn for Visibility

    GridTemplateColumn gtcPermission = new GridTemplateColumn();

    gtcPermission.HeaderText = "Permission";

    gtcPermission.UniqueName = "Visibility";

    gtcPermission.DataField = "Visibility";

    gtcPermission.SortExpression = "Visibility";

    gtcPermission.HeaderStyle.Width = Unit.Pixel(72);

    rfe.Grid.Columns.Add(gtcPermission);

    When I click the column header the sort icon changes and the content sorts once. Subsequent clicks produce no change. The filename and size columns sort as expected.

  2. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 10 Jul 2013 Link to this post

    Hello Billy,

    When creating template columns programmatically, you must create the templates dynamically in the code-behind and assign them to the ItemTemplate and EditItemTemplate properties of the column. I would recommend you to review the following help article which elaborates more on this matter.

    Regards,
    Kostadin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. Billy
    Billy avatar
    1 posts
    Member since:
    Jul 2013

    Posted 19 Jul 2013 Link to this post

    I believe the problem is because I'm not creating the grid template columns in the Page_Init() method. Is there a way to grab a column click event and sort client side?
  4. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 24 Jul 2013 Link to this post

    Hi Billy,

    Client side sorting is supported only with client side databinding. Please check out the following demos:
    Grid - Declarative Binding
    Grid - Client-Side Binding and Caching
    If you want only to fire the sort command on the client you could use the client side sort() method.

    Regards,
    Kostadin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top