Building a DataGrid Helper Control For ASP.NET 1.x: Part 1
page 4 of 5
by Li Chen
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 25846/ 62

Using the DataGridHelper Control

[Download Code]
The DataGridHelper.aspx page demonstrates the use of DataGridHelper control. A live demo can be accessed at
http://www.dotneteer.com/projects/DataGridHelper/v1/DataGridHelperTest.aspx.

This page has the identical functionality as the TypicalDataAccessPage.aspx. It was also created in nearly the same way. The only difference is that we drop the DataGridHelper control into the page instead of writing all the code. One of the easiest ways to drop the control is to right click on one of the tabs in the tool box and click “Add/Remove items…” from the dropdown menu. Then browse and select the WebDataControl.dll file that is in the download that accompanies this article.

We then need to add some code to respond to the Page_Init event and the LoadData event of the DataGridHelper control. The following shows the code behind:

private void DataGridHelper_LoadData(object Sender, 
Dotneteer.WebDataControls.LoadDataEventArgs e)
{
 DataSet ds = new DataSet();
 sqlDataAdapterProducts.Fill(ds);
 e.DataSource = ds;
}


private void DataGridHelperTest_Init(object sender, System.EventArgs e)
{
 dataGridHelper.DataGrid = dataGridProducts;
}

In the Init event, we need a single line of code to attach the DataGrid control to the DataGridHelper control.

In the LoadData event, we create the data source and assign it to the DataSource property of the event argument. That is it! We have a functional page.

In the next section, we will further discuss the features of DataGridHelper control and conclude this article.


View Entire Article

User Comments

Title: DataGrid   
Name: Anita
Date: 2007-07-30 2:01:28 PM
Comment:
Very Good
Title: Confusing   
Name: Anees
Date: 2006-10-05 1:04:44 AM
Comment:
Its confusing for Begginers.
Title: Atish.netExpress   
Name: Atish J
Date: 2006-09-01 6:05:32 AM
Comment:
Ver nice .......!
Title: datagrid   
Name: shailendra
Date: 2006-09-01 2:18:27 AM
Comment:
good
Title: Good   
Name: Prashant Raizada
Date: 2006-07-27 4:40:54 AM
Comment:
Good job!!!
Title: Testing Form   
Name: BinDev1998
Date: 2004-09-21 11:53:35 PM
Comment:
This is Cool!
Title: good!   
Name: Region
Date: 2004-08-09 1:59:31 AM
Comment:
Is Like My Grid
Title: NICE   
Name: Raghuraman
Date: 2004-08-07 3:12:19 AM
Comment:
a nice walk thru
Title: Not Bad   
Name: Tarzan from Zimbava
Date: 2004-08-07 2:46:39 AM
Comment:
It's a good article for Asp starters
Title: good   
Name: gayathri
Date: 2004-08-07 1:41:33 AM
Comment:
good
Title: good   
Name: ramu
Date: 2004-06-28 4:15:35 AM
Comment:
good article

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-24 10:52:39 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search