Row updating in grid view

So you would simply create a Grid View with a Sql Data Source with the following query: select Product Name, Unit Price, Units In Stock, Units On Order from Products. Your boss sees the page and says he would love to be able to quickly distinguish all the products that need to be reordered, and also the products that have already been reordered.So you could then simply tell him that not only will you display the numbers as they are, but also display the products that need to be reordered in red and the ones that have been reordered in blue.Data Row/Data Row View objects implement IEditable Object and when some data in Rad Grid View is changed, the internal Currency Manager calls End Edit of current item after the current position is changed to another row.

row updating in grid view-67row updating in grid view-20

The Data Bound is similar to the Row Data Bound in that both are fired after a bound event has happened.

The difference is that Data Bound is fired once after the entire Grid has been bound; while the Row Data Bound is fired every time a row is bound, meaning it will almost always be fired more than once.

Your boss loves the idea, but you have no clue how to do that with a Grid View.

The way to do this is to use the Row Data Bound event.

The Load event fires when the Grid View is loaded and has not been attached to any data yet.

In this event the user can set properties such as the color of the border, themes, or any other rendering options that are not dependent on the data itself.In this article I will explain how to use the events and properties of the Grid View to allow us to customise the way the data appears.Grid View is great for very simple tables, but the real world is not always as straightforward as we would like it to be.The sender parameter contains a reference of the Grid View that is firing the event and e contains a very important property named Row which references the row that is being bound. Table 1 contains the most used properties of the Grid View Row taken from the MSDN documentation.Table 1: Most used properties of the Row Imagine that your boss asks you to create a table of all the products with their price and Units in Stock and Units on Order. FIGURE 5: End result of the Grid View displaying the products.The Grid View also lets you perform other tasks very easily, such as paging and sorting your data, but not everything is as straightforward as it seems.

Tags: , ,