View Full Version : [CLOSED] Create GridPanel filters dynamically

Aug 05, 2013, 8:10 AM
Hi Ext.NET team,

I have a scenario where i need to create a gridpanel dynamically, which i am able to.
I also need to filter feature to it. But having difficulty in writin the code in c#.

Can you please provide me a brief snippet on how can i add a filter to a dynamic grid panel.


Aug 05, 2013, 12:10 PM
Hi @PriceRightHTML5team,

Here you are.


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
GridFilters gf = new GridFilters();
gf.Local = true;
gf.Filters.Add(new StringFilter() { DataIndex = "test1" });
gf.Filters.Add(new ListFilter() { DataIndex = "test2" });
gf.Filters.Add(new StringFilter() { DataIndex = "test3" });


if (!X.IsAjaxRequest)
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" }

<!DOCTYPE html>
<head runat="server">
<title>Ext.NET v2 Example</title>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server">
<ext:Store runat="server">
<ext:Model runat="server">
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
<ColumnModel runat="server">
<ext:Column runat="server" Text="Test1" DataIndex="test1" />
<ext:Column runat="server" Text="Test2" DataIndex="test2" />
<ext:Column runat="server" Text="Test3" DataIndex="test3" />

Aug 06, 2013, 4:08 AM
Thanks Daniil it worked