This project is read-only.

Grid View

This is a test feature and is just a prototype for now

Grid View is a table based control that take in an IDataGrid object to build a simple table.

Feature Designs

Re-factoring this control is in the works so that it uses child controls to build the columns for easier control.

Features that will be included in this process:
  • In-Place Edit (IPE) using library controls
  • Binding events
  • Multiple Data Sources

Example Code

Here is a simple example of how to fill the data grid object with test data and then to setup the ASPX code to display the contents of the data object.

// Fill grid with test data
CDataGrid data = new CDataGrid();
for (int y = 0; y < 15; y++)
{
	Dictionary<String, Object> row = new Dictionary<String, Object>();
	for (int x = 0; x < 5; x++)
	{
		String key = String.Format("X:{0}", x);
		row[key] = String.Format("{0}", (y * 5) + x);
	}
	data.AddRow(row);
}
data.Start();
// Bind to GridView control
myGridView.Data = data;

The following code would be how to setup the grid view for usage.

<zax:GridView ID="gvResults" runat="server" CssClass="DataGrid">
	<zax:GridHeader Label="Smiple Data Example" runat="server">
		<zax:GridItem ID="lblId1" Label="Label 1" Field="X:0" runat="server" />
		<zax:GridItem ID="lblId2" Label="Label 2" Field="X:2" runat="server" />
		<zax:GridItem ID="lblId3" Label="Label 3" Field="X:2" runat="server" />
	</zax:GridHeader>
	<zax:GridData runat="server">
		<zax:GridItem ID="item1" Field="X:0" runat="server" />
		<zax:GridItem ID="item2" Field="X:1" runat="server" />
		<zax:GridItem ID="item3" Field="X:2" runat="server" />
	</zax:GridData>
</zax:GridView>

Last edited Apr 21, 2014 at 4:17 PM by lede701, version 2