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

telerik:RadGrid Dynamic column sorting not working

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
harry
Top achievements
Rank 1
harry asked on 06 Jul 2016, 10:41 AM

Hi,

We are facing problem for column sorting in RadGrid. We are adding columns dynamically to grid. and values are set in Itemdata bound event.

can anyone help and provide suggestion on this? so that grid column sorting works on these dynamic generated columns once the data is loaded or bound in Itemdatabound.

 

Thanks

 

 

 

1 Answer, 1 is accepted

Sort by
0
umesh
Top achievements
Rank 2
answered on 07 Jul 2016, 07:26 AM

have you called rebind() method at end of sorting?

 Dim srtExp As New Telerik.WebControls.GridSortExpression
        srtExp.FieldName =fieldname  'columnname
        srtExp.SetSortOrder(assending/decending)
        Me.EmpGrid.MasterTableView.SortExpressions.AddSortExpression(srtExp)
        Me.EmpGrid.MasterTableView.Rebind()

Tags
Grid
Asked by
harry
Top achievements
Rank 1
Answers by
umesh
Top achievements
Rank 2
Share this question
or