PDA

View Full Version : [CLOSED] How to make a row grid split into 2 or 3 subrows



onsite
Sep 30, 2013, 2:03 PM
hello

I have a grid with 40+ columns, but end user dont want to scroll to the right, the previous solution was using component one's grid that allows to assign a template to the row and allow me to put a layout in the row, so i can show the 40 fields split in a table by rows/cells and i was able to edit all the fields, etc.

I saw samples that allow to only show the fields in a cell template, but need something editable, also the row expander shows only a new grid row below, not what i need.

Can you point to me to some solution/sample for this?

Thanks

Daniil
Sep 30, 2013, 3:36 PM
Hi @onsite,

I would like to clarify the requirement for the begging.

Imagine you have the following.

Example

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

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

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test", "test", "test", "test" },
new object[] { "test", "test", "test", "test" },
new object[] { "test", "test", "test", "test" }
};
}
}
</script>

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

Then you need show it splitted into, for example, two rows. Something like this:

Example

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

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

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
new object[] { "test", "test", "test", "test" },
new object[] { "test", "test", "test", "test" },
new object[] { "test", "test", "test", "test" }
};
}
}
</script>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
<ext:ModelField Name="test4" />
</Fields>
</ext:Model>
</Model>
</ext:Store>

<ext:GridPanel runat="server" StoreID="Store1">
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test3" DataIndex="test3" />
<ext:Column runat="server" Text="Test4" DataIndex="test4" />
</Columns>
</ColumnModel>
</ext:GridPanel>

<ext:GridPanel runat="server" StoreID="Store1">
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test3" DataIndex="test3" />
<ext:Column runat="server" Text="Test4" DataIndex="test4" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</form>
</body>
</html>

So, is using several GridPanels not an option?

I just don't think there is a possibility to split a single grid into rows.