ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
FAQ
Login
 
ASP Dot Net Tutorial - Index
ASP Dot Net Tutorial - Microsofts ASP.NET
ASP Dot Net Tutorial - Begining Web Forms
ASP Dot Net Tutorial - User Controls
ASP Dot Net Tutorial - ADO .NET
ASP Dot Net Tutorial - DataBinding to WebControls
ASP Dot Net Tutorial - DataList Controls
ASP Dot Net Tutorial - DataGrid Control
ASP Dot Net Tutorial - Advance Practical Examples on DataGrid
ASP Dot Net Tutorial - Working with DataSets
ASP Dot Net Tutorial - Working with XML
ASP Dot Net Tutorial - Forms Based Authentication
ASP Dot Net Tutorial - Windows Based Authentication
     

 
Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses
   

   
   
   
   
   
   

   
  Home > Courses, Tutorials & eBooks > ASP.NET Tutorial > Advance Practical Examples on DataGrid
 

ASP.NET Tutorial - Advance Practical Examples on DataGrid

                                                                                                                 Page 2 of 5
 

In the above example it is seen that when an item is not selected for editing, the EditCommandColumn displays an Edit command and on the selection of an item for editing, the EditCommandColumn displays Update and cancel commands.

An item can be selected for editing by clicking the Edit command displayed by an EditCommandColumn. When the Edit command link, is clicked the dgrdEmployeesEditCommand executes and assigns the index number of the selected item to the EdititemIndex property. This results in the item being selected for editing.

Using Styles with a DataGrid

The DataGrid control supports style objects that can be used to customize its appearance. Each style object is an instance of the TableItemStyle class, which has the following properties:

BorderStyle

The style used for borders around

BackColor

The background color displayed for an item

BorderWidth

The width of the border

BorderColor

The border color displayed for an item

CSS Class

The Cascading Style Sheet class associated with the item

Font

An instance of the FontInfo class, which indicates how the font should be formatted

ForeColor

The foreground color used for text

Height

The height of the item

HorizontalAlign

The horizontal alignment of the item (possible values are Center, Justify, Left, NotSet, and Right)

VerticalAlign

The vertical alignment of the item (possible values are Bottom, Middle, NotSet, and Top)

Width

The width of the item

Wrap

If True, the contents of an item are word-wrapped (the default value is True)

Any of these style properties can be used with the AlternatingItemStyle, EditItemStyle, FooterStyle, HeaderStyle, ItemStyle, and SelectedItemStyle styles of the DataGrid control. When a style property is set while declaring a control, a hyphen (-) can be used instead of the normal period (.) to indicate a property of an object.

The following example, displays the header with a bold, Arial font and a yellow background. Every item is displayed with a 9-point Arial font. Alternate items are displayed with an Alice Blue background


       
 

 

 
     
Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
 
© ExpertRating 2015. All Rights Reserved.