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

Telerik grid sorting from an outside combobox

2 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ajish
Top achievements
Rank 1
Ajish asked on 10 Sep 2012, 06:51 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

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Sep 2012, 07:35 AM
Hi,

Here is the sample code that I tried based on your scenario. Try rebinding the radgrid after sorting.
C#:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
  GridSortExpression expression = new GridSortExpression();
  expression.FieldName = "Name";
  expression.SortOrder = GridSortOrder.Ascending;
  radgrid.Columns[0].SortAscImageUrl = "~/Images/img.gif";
  radgrid.MasterTableView.SortExpressions.AddSortExpression(expression);
  radgrid.MasterTableView.Rebind();
}

Thanks,
Shinu.
0
Ajish
Top achievements
Rank 1
answered on 10 Sep 2012, 08:53 AM
Thanks shinu
it helped me solved the issue
Tags
Grid
Asked by
Ajish
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ajish
Top achievements
Rank 1
Share this question
or