XYDataGrid is a web datagrid control which helps developers to put fixed headers and fixed columns. A very common business need is fixed headers and fixed columns for a datagrid component. However, it is not so easy for a web development team to add these functionalities to an existing datagrid control.
XYDatagrid offers you these methods to add and remove fixed columns and headers easily.
Using the code
Please add the code below after you add
XYDataGrid as a reference to your project.
Dim constr As String
Dim dt As New System.Data.DataTable
Dim sql As String
constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Dim cn As New OleDbConnection(constr)
sql = "Select * from XYDataGridTestTable"
Dim cmd As New OleDbCommand(sql, cn)
Dim da As New OleDbDataAdapter(cmd)
XYDataGrid1.DataSource = dt
Another interesting code snippet is the code which should be added to the design side:
<form id="form1" runat="server">
<DIV style="Z-INDEX: 101; LEFT: 0px; OVERFLOW: auto; WIDTH: 400px;
POSITION: relative; TOP: 46px; HEIGHT: 200px">
<cc1:XYDataGrid ID="XYDataGrid1" runat="server"
After you set the properties as below, the datagrid is ready to work.
Here are some pictures of the XYDataGrid:
Picture 1 - Ready to scroll down and right.
Picture 2 - After first scroll right, the department column slides to the left. ID and Name are fixed.
Picture 3 - After birthday column slided to left.
Picture 4 - After scroll down, the first row scrolls up.
Picture 5 - After scroll down, the first row scrolls up.