A DataGrid ItemDataBound event is raised each time an item (row) is data bound to the DataGrid. Once this event is raised, an argument of type DataGridItemEventArgs is passed to the event handling method and the data relevant to this event is available. This data is is no longer available once your application exits the event handling method. The eventhandler for ItemDataBound is OnItemDataBound.We can specify the method that should handle the event which takes the event source object (in our case the datagrid) and the DataGridItemEventArgs as arguments.
Deciding When to Use the DataGrid, DataList or Repeater Part 1
Web development has come a long way since simple script-based Web programming technologies like Microsoft Active Server Pages (ASP). With Microsoft ASP.NET, a lot of the tedious, repetitious coding chores that were commonplace with classic ASP are now a thing of the past. For example, as all one-time classic ASP developers know, displaying data in a classic ASP Web page required the following pseudocode:
Deciding When to Use the DataGrid, DataList or Repeater Part 2
Analyzing the DataList
Recall that the DataGrid renders as an HTML <table> , which each DataSource record as a table row (<tr>) and each record field as a table column (<td>). At times you might want more control over the presentation of data. For example, you might want to have the data displayed in an HTML <table>, but rather than have one record per row, you might want to display five records per row. Alternatively, you might not want to have the data displayed in a <table> tag at all, but rather have each element displayed in a <span> tag.
Export ASP.NET DataGrid to Excel
Export to Excel is one of the most common functionality required in ASP.Net pages.
Calling a Detail Data Form From A DataGrid Row
The idea is that we have a DataGrid which has list of records in a database table. We want to be able to select a row and call up a detail form which will have the corresponding database detail.
Getting on The Same Page With Your DataGrid
The purpose of this article is to give a succinct, understandable overview of how to setup a DataGrid so that you can page through the records of a data source. To demonstrate how this is done, I’m going to take actual code from an application I developed for a large telecommunications company. I use Visual Studio and that is reflected in this article.