.NET news » Search results
Search results for query "gridview" (15):
Some Tips and Tricks for using an ObjectDataSource with a Gridview
GridView Sort Indicator Component
This article presents a component that is used to add a sort indication image to GridView columns.
The Internet provides a lot of sites that show how you can add some sort of sort indicator to a GridView, but all do this for a single GridView. Our application has quite a lot of GridViews that need this feature and therefore I decided that a component would be the right way to go. A component has the advantage that I have to code the behaviour just once and not for every single GridView over and over again.
The rest of this article shows you how you can use the GridViewSortExtender (that's the name of the component) and how it work on the inside.
Playing with the GridView PagerBar
Using TemplateFields in the GridView Control (C#)
Master/Detail Using a Selectable Master GridView with a Details DetailView
GridThemes
GridView Enhancements and Fixes
Custom Formatting Based Upon Data (C#)
The appearance of the GridView, DetailsView, and FormView controls can be customized through myriad style-related properties. Properties like CssClass, Font, BorderWidth, BorderStyle, BorderColor, Width, and Height, among others, dictate the general appearance of the rendered control. Properties including HeaderStyle, RowStyle, AlternatingRowStyle, and others allow these same style settings to be applied to particular sections. Likewise, these style settings can be applied at the field level.
In many scenarios, though, the formatting requirements depend upon the value of the displayed data. For example, to draw attention to out of stock products, a report listing product information might set the background color to yellow for those products whose UnitsInStock and UnitsOnOrder fields are both equal to 0. To highlight the more expensive products, we may want to display the prices of those products costing more than $75 in a bold font.
Adjusting the format of the GridView, DetailsView, or FormView based upon the data bound to it can be accomplished in multiple ways. In this tutorial, we'll look at how to accomplish data bound formatting through the use of the DataBound and RowDataBound event handlers. In the next tutorial we'll explore an alternative approach...
DataGridView vs. DataGrid
The DataGridView Windows Forms control is a new .NET control introduced in MS Visual Studio .NET 2005 that is a good alternative to the VS .NET 1.x DataGrid control.
Within the DataGridView .NET 2.x control the data table presentation features became much easier to implement in .NET Windows application. The most attractive features of the new control are:
- It allows for the mix both data bound and unbound, virtual columns in the GridView.
- It has a special virtual mode allowing for the display of more than 100.000 rows without a huge performance hit.
- Individual columns, rows, cells or an entire data source can easily be styled.


Syndicate