Hello,
I am using the Filterexpressions to filter a Grid depending of an DropDownList.
Here is the Code from the GridView:
In the SelectedIndexChanged-Event from the DropDownList i have this code:
When i now Change the DropDownList and the Grid is filtered, the paging disappears and i only see the first page wich show 10 records. But there are more than 10 records that match in the filterexpression.
How can i enable the paging again?
Kind regards
Lukas
I am using the Filterexpressions to filter a Grid depending of an DropDownList.
Here is the Code from the GridView:
<
telerik:RadGrid
ID
=
"ContactsGrid"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
Culture
=
"de-DE"
DataSourceID
=
"contacts"
GridLines
=
"None"
Height
=
"100%"
OnItemCreated
=
"ContactsGrid_ItemCreated"
OnItemInserted
=
"ContactsGrid_ItemInserted"
OnPreRender
=
"ContactsGrid_PreRender"
onneeddatasource
=
"ContactsGrid_NeedDataSource"
onitemdatabound
=
"ContactsGrid_ItemDataBound"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ContactsID"
DataSourceID
=
"contacts"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"ContactsID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ContactsID column"
HeaderText
=
"ContactsID"
SortExpression
=
"ContactsID"
UniqueName
=
"ContactsID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CustomerID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter CustomerID column"
HeaderText
=
"CustomerID"
SortExpression
=
"CustomerID"
UniqueName
=
"CustomerID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Name"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Name column" HeaderText="Name"
SortExpression="Name" UniqueName="Name">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Lastname"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Lastname column" HeaderText="Lastname"
SortExpression="Lastname" UniqueName="Lastname">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Telephone"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Telephone column" HeaderText="Telephone"
SortExpression="Telephone" UniqueName="Telephone">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Mobile"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Mobile column" HeaderText="Mobile"
SortExpression="Mobile" UniqueName="Mobile" AutoPostBackOnFilter="False">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"E_Mail"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter E_Mail column" HeaderText="E_Mail"
SortExpression="E_Mail" UniqueName="E_Mail">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Fax"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Fax column" HeaderText="Fax" SortExpression="Fax"
UniqueName="Fax">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Department"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Department column" HeaderText="Department"
SortExpression="Department" UniqueName="Department">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Notification"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Notification column" HeaderText="Notification"
SortExpression="Notification" UniqueName="Notification">
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
Text
=
"Delete"
/>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
</
ClientSettings
>
</
telerik:RadGrid
>
In the SelectedIndexChanged-Event from the DropDownList i have this code:
ContactsGrid.MasterTableView.FilterExpression =
"it.CustomerID = "
+ e.Index;
ContactsGrid.MasterTableView.Rebind();
When i now Change the DropDownList and the Grid is filtered, the paging disappears and i only see the first page wich show 10 records. But there are more than 10 records that match in the filterexpression.
How can i enable the paging again?
Kind regards
Lukas