Click here to Skip to main content
11,927,378 members (51,099 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked


, 25 Mar 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
XYDataGrid is a web datagrid control which helps developers put fixed headers and columns.

Screenshot - Datagrid1.jpg


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=" & _ 
         "c:\XYDataGridTestData.mdb;User Id=admin;Password=;"

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" 
      FixHeader="True" FixColumn="2">

After you set the properties as below, the datagrid is ready to work.

Screenshot - datagrid6.jpg

Here are some pictures of the XYDataGrid:

Screenshot - Datagrid1.jpg

Picture 1 - Ready to scroll down and right.

Screenshot - Datagrid2.jpg

Picture 2 - After first scroll right, the department column slides to the left. ID and Name are fixed.

Screenshot - Datagrid3.jpg

Picture 3 - After birthday column slided to left.

Screenshot - Datagrid4.jpg

Picture 4 - After scroll down, the first row scrolls up.

Screenshot - Datagrid5.jpg

Picture 5 - After scroll down, the first row scrolls up.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Yildirim Kocdag
Turkey Turkey
Phd. Yildirim Kocdag is a Computer Engineer.

Programming Languages
Android, Objective-c, c#,,, javascript, TSQL.

Computer Science
DataMining, Compilers, Expert Systems, Digital Image Processing, AI and Extreme Programming.

You may also be interested in...

Comments and Discussions

QuestionBug? Pin
Coach_8128-Jul-08 17:29
memberCoach_8128-Jul-08 17:29 
Questionvb 2 c# Pin
OmidH30-May-07 2:46
memberOmidH30-May-07 2:46 
AnswerRe: vb 2 c# Pin
Yildirim Kocdag30-May-07 3:40
memberYildirim Kocdag30-May-07 3:40 
GeneralRe: vb 2 c# Pin
OmidH30-May-07 19:00
memberOmidH30-May-07 19:00 
GeneralThanks Pin
volkan.ozcelik6-Apr-07 0:15
membervolkan.ozcelik6-Apr-07 0:15 
GeneralRe: Thanks Pin
Yildirim Kocdag6-Apr-07 2:26
memberYildirim Kocdag6-Apr-07 2:26 
GeneralEmbedded CSS Pin
Declan Bright26-Mar-07 4:42
memberDeclan Bright26-Mar-07 4:42 
GeneralRe: Embedded CSS Pin
Yildirim Kocdag26-Mar-07 5:53
memberYildirim Kocdag26-Mar-07 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 26 Mar 2007
Article Copyright 2007 by Yildirim Kocdag
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid