This is a migrated thread and some comments may be shown as answers.

Telerik radGrid sorting issue with sorting icon

13 Answers 762 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ganesh g
Top achievements
Rank 1
ganesh g asked on 28 Oct 2010, 01:48 PM

I am using telerik grid internal sorting functionality.

 

I have set following properties -

AllowNaturalSort="false"

radGrid.MasterTableView.AllowSorting = true;

 

Issue -

If I click on header text of column, data get sorted but if I try to click on image for sorting, sorting is not working only page get postbacks.

13 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 28 Oct 2010, 05:13 PM
Hi Ganesh,

I am afraid we are not able to reproduce this issue locally. Can you please try reproducing the same problem in this online example.

Greetings,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ganesh g
Top achievements
Rank 1
answered on 01 Nov 2010, 03:46 PM

Hi,

Can you provides us demo application for RadGrid with sorting?

We need to set following properties –

AllowNaturalSort ="false"

radGrid.MasterTableView.AllowSorting = true;

radGrid.datasource at runtime.

radGrid.Columns[index].SortAscImageUrl at runtime.

radGrid.Columns[index].SortDescImageUrl at runtime.

Also we have following queries -

Can we need to set DataSource & DataBind again after sort click on any column?

 

Same code works when we set datasource at desing time.

Please support us on this issue.

Regards,

Ganesh

0
Pavlina
Telerik team
answered on 01 Nov 2010, 04:42 PM
Hello,

Attached to this message is a simple working project which handles the desired functionality. Give it a try and let me know if it helps.

Greetings,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ganesh g
Top achievements
Rank 1
answered on 04 Nov 2010, 12:42 PM

Thanks for your reply

As per your sample application we have attached “Office2007” Skin to radGrid.

We have following observations

1)We are got following rendered HTML for Office2007 skin.


<input type="button" class="rgSortAsc" title="Sorted asc" onclick="javascript:__doPostBack('accountUserDetails$GrdGroup$ctl00$ctl02$ctl00$ctl01','')" value=" " name="accountUserDetails$GrdGroup$ctl00$ctl02$ctl00$ctl01"/>

In above case sorting working fine on icon as well as  header text

2) We are got following rendered HTML when we attached our custom skin.

<input type="image" alt="Sorted asc" src="/sorteduparrow.gif" title="Sorted asc" name="accountUserDetails$grdAccount$ctl00$ctl02$ctl00$ctl02"/>

In above case onclick is not rendered which was rendered in previous case as shown in red.

Also note that  input type attribute also rendered not similler.

0
Pavlina
Telerik team
answered on 04 Nov 2010, 04:47 PM
Hello Ganesh,

Most probably there is  something wrong with the custom skin. Please send it (including the CSS file and images) if you need further assistance.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ganesh g
Top achievements
Rank 1
answered on 08 Nov 2010, 08:34 AM

Hello

Another observations regarding this issue are:

1)      If I custom sort using OnSortCommand of telerik sorting on header image works fine.

2)      But if I sort telerik inbuilt sorting without using OnSortCommand sorting not working on header image.

3)      In both above cases sorting image rendered as input type=”image” only.

But its works only in 1st case. 



Regards,

Ganesh Gaikwad


0
Pavlina
Telerik team
answered on 10 Nov 2010, 04:59 PM
Hi Ganesh,

Based on the provided information I am not sure what could have gone wrong in your case. Therefore I suggest that you open a formal support ticket and either send us a runnable project or at least the problematic pages, and code files for further research.

All the best,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Doug Beard
Top achievements
Rank 1
answered on 14 Dec 2010, 05:23 PM
I have exactly the same issue.
If I assign an Image for the header, sorting is broken. Ajax Requests are not fired when the image is clicked, just a post back with no sorting.
If the column has a sort indicator, and one clicks the sort indicator instead of the header image, it works properly.
0
Pavlina
Telerik team
answered on 15 Dec 2010, 01:48 PM
Hi,

As I said in the previous post, it is hard to determine what is causing this problem. In any case, to properly address the issue, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior. We will debug it locally, and get back to you with more information on the matter.

All the best,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Chanda
Top achievements
Rank 1
answered on 16 May 2012, 02:30 PM
Hi,

We are facing same issue but want to highlight that we have disabled ViewState of Rad Grid and are using NeedDatasource event. It we are enabling ViewState of RadGrid it is working fine. Is there something that Headertext viewstate is maintained and not for the sort icon.

Thanks,
Chanda.
0
Pavlina
Telerik team
answered on 17 May 2012, 09:12 AM
Hello Chanda,

For more information about grid ViewState you can check the help article below:
http://www.telerik.com/help/aspnet-ajax/grid-viewstate-optimization.html

Kind regards,
Pavlina
the Telerik team
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 their blog feed now.
0
Ajish
Top achievements
Rank 1
answered on 10 Sep 2012, 06:54 AM
When i am applying sorting on grid outside from a dropdown (sorting grid not by clicking on the grid header)

how  can i change the corresponding column header in the grid to show the  SortIcon

i have already tried

radgrid.Columns[3].SortAscImageUrl="image url";

 

radgrid.Columns[3].ShowSortIcon=true;

but this is only applying when the normal grid header sort event fires

not from outside of the grid (from dropdown)

please provide a solution for this ASAP

0
Pavlina
Telerik team
answered on 11 Sep 2012, 04:06 PM
Hello Ajish,

To achieve your goal you can handle ItemCreated server side event and set sort icon for the corresponding sort order as shown below:
protected void grid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridHeaderItem)
    {
        GridHeaderItem header = (GridHeaderItem)e.Item;
        Image img = new Image();
        img.ID = "Image1";
        img.ImageUrl = "~/Images/SortAsc.gif";
        header["CustomerID"].Controls.AddAt(1, img);
        if (grid.MasterTableView.SortExpressions.Count > 0 && grid.MasterTableView.SortExpressions[0].FieldName == "CustomerID")
        {
            if (grid.MasterTableView.SortExpressions[0].SortOrder != GridSortOrder.Ascending)
            {
                header["CustomerID"].Controls.Remove(img);
            }
        }
 
    }
}

I hope this works for you.

Regards,
Pavlina
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
ganesh g
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
ganesh g
Top achievements
Rank 1
Doug Beard
Top achievements
Rank 1
Chanda
Top achievements
Rank 1
Ajish
Top achievements
Rank 1
Share this question
or