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

Grid not filtering

3 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 22 Dec 2008, 04:20 AM
Hi,

I'm using basic filtering but it doesn't works. I put databindin on NeedDataSource event and bind my grid to DataTable.
Here is copy of my code. When I do filtering it doesn't filter at all and filter parameter gets cleaned up.

 

<telerik:RadGrid ID="gridViewOrders" runat="server"

 

AutoGenerateColumns="False" GridLines="None"  

 

Skin="Web20" AllowFilteringByColumn="True"

 

AllowPaging="True" AllowSorting="True" 

 

EnableViewState="False"

 

 

 

OnNeedDataSource="gridViewOrders_NeedDataSource"

 

 

 

OnItemCommand="gridViewOrders_ItemCommand"

 

 

 

OnItemDataBound="gridViewOrders_ItemDataBound"

 

 

 

EnableAjaxSkinRendering="true">

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

 

<MasterTableView EnableViewState="False" AllowFilteringByColumn="true">

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="OrderId" HeaderText="№ заказа" UniqueName="OrderId" DataType="System.Int32">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="OrderDate" HeaderText="Дата заказа" UniqueName="OrderDate" DataFormatString="{0:dd.MM.yyyy hh:mm}" DataType="System.DateTime" >

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="OrderTotal" HeaderText="Сумма заказа" UniqueName="OrderTotal" DataFormatString="{0:#,##0.00 p.}" DataType="System.Double">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="City" HeaderText="Город доставки" UniqueName="City">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="DeliveryName" HeaderText="Покупатель" UniqueName="DeliveryName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PaymentType" HeaderText="Оплата" UniqueName="PaymentType">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="DeliveryType" HeaderText="Доставка" UniqueName="DeliveryType">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="OrderStatus" HeaderText="Статус" UniqueName="OrderStatus">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridButtonColumn UniqueName="view" Text="Посмотреть" CommandName="View"></telerik:GridButtonColumn>

 

 

</Columns>

 

 

<EditFormSettings>

 

 

<EditColumn UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

</telerik:RadGrid>

 

protected void gridViewOrders_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

{

 

OrderController controller = new OrderController();

 

gridViewOrders.DataSource = controller.GetOrders();

}

 

 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 Dec 2008, 06:16 AM
Hi Roman,

Please turn on the grid ViewState to avoid such problems.

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Princy
Top achievements
Rank 2
answered on 22 Dec 2008, 12:06 PM
Hi Roman,

You can also refer the following help article to get more details on ViewState usage.
Optimizing ViewState usage

Princy.
0
Roman
Top achievements
Rank 1
answered on 22 Dec 2008, 03:34 PM
Thank you.
That is works
Tags
Grid
Asked by
Roman
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Princy
Top achievements
Rank 2
Roman
Top achievements
Rank 1
Share this question
or