Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
protected
void
RadGrid1_SortCommand(
object
sender, GridSortCommandEventArgs e)
{
string
datafield = e.SortExpression;
//you will get the column Datafield
foreach
(GridColumn col
in
RadGrid1.MasterTableView.RenderColumns)
if
(col
is
GridBoundColumn && (col
as
GridBoundColumn).DataField == e.SortExpression)
uniquename = col.UniqueName;
//you will get the column uniqueName(of bound column for example)
}
RadGrid1_PreRender(
sender, EventArgs e)
GridSortExpression expression =
new
GridSortExpression();
expression.FieldName =
"UniqueName"
;
expression.SortOrder = GridSortOrder.Ascending;
RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression);
RadGrid1.MasterTableView.Rebind();