Introduction
One of my most used ASP.NET control is DataGrid. Presenting data from tables is very easy and nice with only one exception - the page navigator. Showing only page numbers or only two links (to previous and next page) is insufficient for me, and completely inexplicable for my clients. So I decided to create DataGrid Server Control, the main task of which is to providing paging alphabetically.
Using the control
1. Copy CustDataGrid.dll in your web application bin folder.
2. Add this line on top of your aspx page or add control in toolbox by customize toolbox and drop control on your page.
<%@ Register TagPrefix="cc1" Namespace="CustDataGrid"
Assembly="CustDataGrid" %>
3. add control on your page in form tag
<%cc1:myCustDG id="MyCustDG1"
style="Z-INDEX: 101; LEFT: 110px; POSITION: absolute; TOP: 26px"
runat="server" Height="167px" Width="286px" BackColor="Info">
<AlternatingItemStyle BackColor="MistyRose"></AlternatingItemStyle>
<FooterStyle Font-Bold="True" BackColor="LightPink"></FooterStyle>
<HeaderStyle Font-Bold="True" BackColor="LightPink"></HeaderStyle>
</cc1:myCustDG>
4. Set control properties in your codebihind page
<font size="2">
MyCustDG1.strConn = "data source=.;initial catalog=Northwind;" +
"persist security info=False;user id=sa;password=";
MyCustDG1.sqlQuery = "select CustomerID,CompanyName," +
"ContactName,City,Country from customers";
MyCustDG1.Visible = true;
MyCustDG1.autoCols = true;
MyCustDG1.AlphabaticPaging = true;
MyCustDG1.PagingColumn = "CompanyName";
MyCustDG1.GetDataGrid();
</font>
Control's properties
1. strConn: SQL connection string
2. sqlQuery: Select query for fill DataGrid
3. AlphabaticPaging (bool): true - show alphabatic paging, false - show normal paging
4. PagingColumn: Column name which depends on alphabatic paging
Around five years of experience in the field of application software development including
Three years of experience in .NET technology.