Dear there,
I am using radgrid control, everything was working well before i applied grouping, but afterthere sorting is not working.
here is my grid, my grid is simpy binding on pageload event. Do i need to write manual sortcommand on server side ?
I am using radgrid control, everything was working well before i applied grouping, but afterthere sorting is not working.
here is my grid, my grid is simpy binding on pageload event. Do i need to write manual sortcommand on server side ?
<
telerik:RadGrid
ID
=
"RadGrid1"
AllowSorting
=
"true"
Width
=
"100%"
runat
=
"server"
>
<
MasterTableView
TableLayout
=
"Fixed"
DataKeyNames
=
"KEYID"
ClientDataKeyNames
=
"KEYID"
GridLines
=
"Both"
GroupsDefaultExpanded
=
"true"
GroupLoadMode
=
"client"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
SortOrder
=
"Ascending"
FieldAlias
=
"EMPDOH"
FieldName
=
"EMPDOH"
FormatString
=
"{0:D}"
HeaderValueSeparator
=
" from date: "
></
telerik:GridGroupByField
>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"EMPDOH"
SortOrder
=
"Ascending"
></
telerik:GridGroupByField
>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"ClientSelectColumn"
/>
<
telerik:GridBoundColumn
UniqueName
=
"KEYID"
Display
=
"false"
DataField
=
"KEYID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Employees"
DataField
=
"Name"
UniqueName
=
"Name"
ShowFilterIcon
=
"false"
SortExpression
=
"Name"
AllowFiltering
=
"true"
FilterControlWidth
=
"100"
AutoPostBackOnFilter
=
"true"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Pay Period"
DataField
=
"Description"
UniqueName
=
"Description"
ShowFilterIcon
=
"false"
SortExpression
=
"Description"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxPP"
CausesValidation
=
"false"
Width
=
"100"
DataSourceID
=
"SqlDataSourcePP"
DataTextField
=
"Code"
DataValueField
=
"Code"
Height
=
"100px"
AppendDataBoundItems
=
"true"
OnClientSelectedIndexChanged
=
"SelectedIndexChanged"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Description").CurrentFilterValue %>'
runat="server">
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"All"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function SelectedIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
sender.value = args.get_item().get_value();
tableView.filter("Description", args.get_item().get_value(), "EqualTo");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Department"
DataField
=
"Department"
UniqueName
=
"Department"
ShowFilterIcon
=
"false"
SortExpression
=
"Department"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxDep"
CausesValidation
=
"false"
DataSourceID
=
"SqlDataSourceDepartment"
Width
=
"120"
DataTextField
=
"Department"
DataValueField
=
"Department"
Height
=
"100px"
AppendDataBoundItems
=
"true"
OnClientSelectedIndexChanged
=
"SelectedIndexChanged2"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Department").CurrentFilterValue %>'
runat="server">
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"All"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock2"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function SelectedIndexChanged2(sender, args) {
var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
sender.value = args.get_item().get_value();
tableView.filter("Department", args.get_item().get_value(), "EqualTo");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
ReadOnly
=
"true"
DataField
=
"Paydate"
HeaderText
=
"Pay Date"
DataFormatString
=
"{0:d}"
DataType
=
"System.DateTime"
UniqueName
=
"PayDate"
AllowFiltering
=
"true"
SortExpression
=
"PayDate"
FilterControlWidth
=
"90"
/>
<
telerik:GridBoundColumn
AllowFiltering
=
"false"
HeaderText
=
"Start Date"
DataFormatString
=
"{0:d}"
DataField
=
"PayDateFrom"
UniqueName
=
"PayDateFrom"
DataType
=
"System.DateTime"
ShowFilterIcon
=
"false"
SortExpression
=
"PayDateFrom"
/>
<
telerik:GridBoundColumn
HeaderText
=
"End Date"
DataField
=
"Paydateto"
DataFormatString
=
"{0:d}"
UniqueName
=
"Paydateto"
DataType
=
"System.DateTime"
ShowFilterIcon
=
"false"
AllowFiltering
=
"false"
SortExpression
=
"Paydateto"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Hire/Rehire"
DataField
=
"EMPDOH"
Groupable
=
"true"
UniqueName
=
"EMPDOH"
DataFormatString
=
"{0:d}"
DataType
=
"System.DateTime"
ShowFilterIcon
=
"false"
AllowFiltering
=
"false"
SortExpression
=
"EMPDOH"
/>
<
telerik:GridBoundColumn
DataField
=
"hdismass"
UniqueName
=
"hdismass"
Display
=
"false"
HeaderText
=
"hdismass"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
HeaderText
=
"hds"
DataField
=
"hds"
Display
=
"false"
UniqueName
=
"hds"
AllowFiltering
=
"false"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowColumnsReorder
=
"false"
ReorderColumnsOnClient
=
"false"
AllowExpandCollapse
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Resizing
AllowRowResize
=
"false"
EnableRealTimeResize
=
"True"
ResizeGridOnColumnResize
=
"true"
AllowColumnResize
=
"false"
></
Resizing
>
</
ClientSettings
>
<
GroupingSettings
ShowUnGroupButton
=
"true"
/>
</
telerik:RadGrid
>