Click here to Skip to main content
Licence CPOL
First Posted 25 Mar 2007
Views 15,488
Downloads 35
Bookmarked 15 times

XYDataGrid

By | 25 Mar 2007 | Article
XYDataGrid is a web datagrid control which helps developers put fixed headers and columns.

Screenshot - Datagrid1.jpg

Introduction

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)

cn.Open()
sql = "Select * from XYDataGridTestTable"

Dim cmd As New OleDbCommand(sql, cn)
Dim da As New OleDbDataAdapter(cmd)

da.Fill(dt)
XYDataGrid1.DataSource = dt
XYDataGrid1.DataBind()

Another interesting code snippet is the code which should be added to the design side:

<form id="form1" runat="server">
<div>
<DIV style="Z-INDEX: 101; LEFT: 0px; OVERFLOW: auto; WIDTH: 400px; 
              POSITION: relative; TOP: 46px; HEIGHT: 200px">
    <cc1:XYDataGrid ID="XYDataGrid1" runat="server" 
      style="border-width:1px;border-style:None;" 
      FixHeader="True" FixColumn="2">
    </cc1:XYDataGrid> 
</DIV>
</div>
</form>

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.

License

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

About the Author

Yildirim Kocdag

Web Developer

Turkey Turkey

Member

Yildirim Kocdag is a MSc.BSc.Computer Engineer from Istanbul. He is working as a .NET consultant. Currently using c#, vb.net, asp.net, javascript, SQL and Oracle. His Favourite areas in Computer Science are Compilers, Expert Systems, Digital Image Processing, AI and Extreme Programming.
ykocdag@yahoo.com


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionBug? PinmemberCoach_8116:29 28 Jul '08  
Questionvb 2 c# PinmemberOmidH1:46 30 May '07  
AnswerRe: vb 2 c# PinmemberYildirim Kocdag2:40 30 May '07  
GeneralRe: vb 2 c# PinmemberOmidH18:00 30 May '07  
GeneralThanks Pinmembervolkan.ozcelik23:15 5 Apr '07  
GeneralRe: Thanks PinmemberYildirim Kocdag1:26 6 Apr '07  
GeneralEmbedded CSS PinmemberDeclan Bright3:42 26 Mar '07  
GeneralRe: Embedded CSS PinmemberYildirim Kocdag4:53 26 Mar '07  

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

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

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