Feb 05, 2013, 12:41 PM
[CLOSED] Gridpanel Filter column and Header Group
I'm implementing the both examples in my app
this https://examples1.ext.net/#/GridPane...Header/Filter/ and this
https://examples1.ext.net/#/GridPane...mnHeaderGroup/
But my grid appears weird, as you can see in the image bellow.
How can I configure the grid to appear something like that.
Fisrt line: GroupHeader
Second Line: columns name
Third line: filters
There is a way to combine the both examples?
Code to reproduce this issue.
this https://examples1.ext.net/#/GridPane...Header/Filter/ and this
https://examples1.ext.net/#/GridPane...mnHeaderGroup/
But my grid appears weird, as you can see in the image bellow.
How can I configure the grid to appear something like that.
Fisrt line: GroupHeader
Second Line: columns name
Third line: filters
There is a way to combine the both examples?
Code to reproduce this issue.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
var cities = new object[] { "Beijing", "Tokyo", "Berlin", "London" };
var products = new string[] { "ProductX", "ProductY" };
var grid = GridPanel1;
var view = grid.View[0];
var store = grid.Store[0];
var cm = grid.ColumnModel;
var cityGroupRow = new HeaderGroupRow();
var data = new object[5];
var random = new Random();
var headerRow = new HeaderRow();
view.ID = "gridView";
view.HeaderGroupRows.Add(cityGroupRow);
view.HeaderRows.Add(headerRow);
foreach (string city in cities)
{
cityGroupRow.Columns.Add(new HeaderGroupColumn
{
Header = city,
ColSpan = products.Length,
Align = Alignment.Center
});
}
for (int i = 0; i < 8; i++)
{
store.Reader[0].Fields.Add("column" + i, RecordFieldType.Int);
Column col = new Column
{
Header = "Column " + i,
};
cm.Columns.Add(col);
headerRow.Columns.Add(new HeaderColumn
{
Component = { new TextField { ID = "txt" + i } }
});
}
for (int i = 0; i < 5; i++)
{
var arr = new int[8];
for (int j = 0; j < 8; j++)
{
arr[j] = Convert.ToInt32((Math.Floor(random.NextDouble() * 11) + 1) * 100000);
}
data[i] = arr;
}
store.DataSource = data;
store.DataBind();
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Grid Column Header Grouping - Ext.NET Examples</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ext:ResourceManager runat="server" />
<h1>
Grid Column Header Grouping Example</h1>
<p>
This example shows how to achieve column grouping using a plugin.</p>
<ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" Title="Sales By Region"
TrackMouseOver="true" Width="1000" Height="400">
<Store>
<ext:Store runat="server">
<Reader>
<ext:ArrayReader />
</Reader>
</ext:Store>
</Store>
<SelectionModel>
<ext:RowSelectionModel runat="server" />
</SelectionModel>
<View>
<ext:GridView runat="server" ForceFit="true" />
</View>
</ext:GridPanel>
</body>
</html>
Last edited by Daniil; Feb 06, 2013 at 5:37 AM.
Reason: [CLOSED]