or
Please, note that the solutions above will not work for MOSS 2007 and MVC applications. To fix the problem:
<
radG:RadGrid
ID
=
"CustomerGrid"
runat
=
"server"
AutoGenerateColumns
=
"false"
Width
=
"100%"
EnableAJAX
=
"True"
OnPageIndexChanged
=
"SearchResults_PageIndexChanged"
Skin
=
"Office2007"
AllowFilteringByColumn
=
"False"
AllowPaging
=
"True"
PageSize
=
"35"
ShowStatusBar
=
"True"
ShowFooter
=
"False"
ShowGroupPanel
=
"False"
GridLines
=
"None"
CellPadding
=
"1"
AllowSorting
=
"True"
OnSortCommand
=
"RadGrid1_SortCommand"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
MasterTableView
EditMode
=
"InPlace"
ShowFooter
=
"True"
Width
=
"99%"
TableLayout
=
"Auto"
AllowMultiColumnSorting
=
"true"
AllowNaturalSort
=
"true"
>
<
Columns
>
<
radG:GridBoundColumn
DataField
=
"CustomerID"
HeaderText
=
"Customer Number"
SortExpression
=
"CustomerID"
UniqueName
=
"CustomerID"
>
</
radG:GridBoundColumn
>
<
radG:GridBoundColumn
DataField
=
"CustomerName"
HeaderText
=
"Customer Name"
SortExpression
=
"CustomerName"
UniqueName
=
"CustomerName"
>
</
radG:GridBoundColumn
>
<
radG:GridTemplateColumn
HeaderText
=
"Status"
HeaderStyle-Width
=
"160px"
ItemStyle-Width
=
"160px"
>
<
ItemTemplate
>
<%# GetStatus(Eval("CustomerID")) %>
</
ItemTemplate
>
</
radG:GridTemplateColumn
>
<
radG:GridBoundColumn
DataField
=
"Effective"
HeaderText
=
"Effective"
>
</
radG:GridBoundColumn
>
</
Columns
>
<
ExpandCollapseColumn
Visible
=
"False"
>
<
HeaderStyle
Width
=
"19px"
/>
</
ExpandCollapseColumn
>
<
RowIndicatorColumn
Visible
=
"False"
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
</
MasterTableView
>
<
ClientSettings
ReorderColumnsOnClient
=
"True"
AllowDragToGroup
=
"True"
AllowColumnsReorder
=
"True"
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
></
Scrolling
>
</
ClientSettings
>
</
radG:RadGrid
>
protected
void
SearchResults_PageIndexChanged(
object
source, Telerik.WebControls.GridPageChangedEventArgs e)
{
LoadData();
}
protected
void
RadGrid1_SortCommand(
object
source, Telerik.WebControls.GridSortCommandEventArgs e)
{
if
(!e.Item.OwnerTableView.SortExpressions.ContainsExpression(e.SortExpression))
{
GridSortExpression sortExpr =
new
GridSortExpression();
sortExpr.FieldName = e.SortExpression;
sortExpr.SortOrder = GridSortOrder.Ascending;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
}
}