|
Binding SQL Data to a DataGrid
|
Total Hit (1899) |
The DataGrid control supports a DataSource property that takes an IEnumerable or ICollection, as well as a DataSet. You can use a DataSet by assigning the DefaultView property of a table contained in the DataSet to the name of the table you wish to use within the DataSet. The DefaultView property re
....Read More |
Rating
|
|
|
|
Bind Datagrid to Datareader
|
Total Hit (1510) |
Most of times we see Datagrid Bound with Dataset but here is easy approach using Datareader
|
Rating
|
|
|
|
Custom ASP.NET Datagrid Paging With Exact Count - Introduction
|
Total Hit (770) |
Anybody in the DB world knows what paging database results is and its effect. From the time I had started getting into good old classic ASP, I was intrigued with the ability to divide large sets of data into sections of x records per page. One thing that I didn't like about paging is that it seemed
....Read More |
Rating
|
|
|
ASP.NET DataGrid Paging Part 1 - Built-In Paging
|
Total Hit (541) |
The DataGrid server control enables easy paging through data. You can set the DataGrid to use paging and specify a page size (number of records to display). Each time the page is loaded the DataSet is recreated and the DataGrid is bound to the appropriate records based on what page is to be displaye
....Read More |
Rating
|
|
|
|
Highlighted Hovering and Anywhere Selecting A DataGrid Row
|
Total Hit (716) |
Recently while working for one of my client I came across a requirement such that:
«LI»DataGrid should not have select button to select a row. This was necessary to save some screen space.
«LI»Still when the user clicks on any of the DataGrid row (on any column), that row should be selected and
....Read More |
Rating
|
|
|
Using Radio Buttons To Select DataGrid Row
|
Total Hit (477) |
DataGrid allows you to put any controls inside a template column. You must be thinking that on the same line one can add RadioButtons web control as well. However, there is a catch. Radio buttons behave as a single group based on their GroupName property. When put inside DataGrid, DataGrid acts as t
....Read More |
Rating
|
|
|
|
Creating DataGrid Templated Columns Dynamically - Part I
|
Total Hit (474) |
Few months back I wrote article on how to create DataGrid programatically. The article explained how to created a DataGrid with bound columns on the fly. Many readers asked whether we can do similar thing with templated columns. This two part article explains just that. There are actually two ways t
....Read More |
Rating
|
|
|
Including a Data Bound CheckBox in an Editable DataGrid
|
Total Hit (596) |
I've had several requests to show how a data bound checkbox could be included in an editable datagrid. This article shows how to bind a bit field from a table to a checkbox in a datagrid as well as how to update the table with changes in the checked state of the checkbox.
....Read More |
Rating
|
|
|
|
Filtering the DataGrid
|
Total Hit (540) |
In this article we will filter the DataGrid on two columns. This adds a little code complexity but is not really very hard to do.
|
Rating
|
|
|
Paging and Sorting in an ASP.NET DataGrid
|
Total Hit (649) |
Allowing paging or sorting in a DataGrid is a very simple process. Allowing for both is only slightly more complicated. This article shows you how to do it.
|
Rating
|
|
|
|
|
|
Using a ButtonColumn Control in a DataGrid
|
Total Hit (556) |
The ButtonColumn Control is one of several controls that can be used within a DataGrid control in ASP.Net. This article demonstates one way to use this control.
|
Rating
|
|
|
Filter and Sort the DataGrid Using a DataView
|
Total Hit (533) |
The DataView class is a filtering and sorting mechanism. To work, a DataView requires a DataTable. The DataView becomes a specific view of the DataTable and, among other things, can be used to filter and sort the DataTable. The best way to explain a DataView is to see it in action, so we will get ri
....Read More |
Rating
|
|
|
Conditionally Change a DataGrid Column Value
|
Total Hit (585) |
There are times when you will need to highlight or otherwise modify the contents of a particular DataGrid row-column value based upon the value in the column. In this example we will select the CompanyName, ContactName, and ContactTitle columns from the Customers table in the Northwind database. Whe
....Read More |
Rating
|
|
|
Implement Custom Paging in the ASP.Net Datagrid Control
|
Total Hit (531) |
The inbuilt paging mechanism of the ASP.Net datagrid control is convenient, but can be very inefficient. The problem with the inbuilt system is that the entire resultset is gathered again and again with each page change. Assume you have a table with 200 rows in it and that you are displaying 10 rows
....Read More |
Rating
|
|
|
Add (INSERT) a New Row Using the ASP.Net Datagrid Control
|
Total Hit (779) |
In this article we will display both the grid and INSERT facility inside an html table. This will tie the datagrid and the INSERT facility together to make a fairly pleasing presentation. The best way to see how this works is to get right to the code. As with most dotnetjohn articles we will use a .
....Read More |
Rating
|
|
|
Including a Column Total Line in a DataGrid Control
|
Total Hit (515) |
The question is how to display a total line in a DataGrid control. It is quite easy to do by making use of the ItemDataBound event. As usual we will use an aspx page to define our grid.
|
Rating
|
|
|
Including a DropDownListBox in an Editable DataGrid
|
Total Hit (574) |
The data choices for some database table columns are relatively fixed. Examples would be countries, states, and counties for instance. In these cases a dropdown list of fixed choices makes more sense than keyboard input where mistakes can be made easily. In an editable datagrid you can include dropd
....Read More |
Rating
|
|
|
|
Include a Calculated Column in a DataGrid
|
Total Hit (517) |
In this article you will learn how to include a calculated column in a DataGrid. A calculated column generally contains some value calculated from one or more columns of data that are included in the data store. It could be based on multiplying or dividing a column value by some other value, or it c
....Read More |
Rating
|
|
|
Master-Detail DataGrids in ASP.Net
|
Total Hit (496) |
In this article you will learn how to link two datagrids in a master-detail relationship. There is more than one way to accomplish this task. In this article we will implement row filtering to find the detail records corresponding to a master record selected in the master grid. The tables we will us
....Read More |
Rating
|
|
|
Highlighting Rows in an ASP.Net DataGrid
|
Total Hit (593) |
I like the idea of highlighting rows in a DataGrid as the user scrolls the mouse up and down over the grid. The effect can be achieved using several lines of client-side JavaScript, but why do that when two lines of .Net code will accomplish the same thing? The trick is to implement an ItemDataBound
....Read More |
Rating
|
|
|
Control Which Columns are Displayed in a DataGrid
|
Total Hit (574) |
This ASP.Net (VB) program allows you to select many, or all of the columns from a database table, but display only certain, specified columns in a DataGrid. It does this by setting the DataGrid AutoGenerateColumns property to false and then using the Columns Collection to specify the columns to be d
....Read More |
Rating
|
|