SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 162 | Next

Joydip Kanjilal

"ASP.NET Data Presentation Controls Essentials"

The AddHeader() method of the
Response object is used to add a header and its corresponding value or the content
to the response being rendered. The Response.AddHeader() method accepts two
parameters, that is, the name of the header of the response being rendered, and, its
corresponding value. While the first argument is used to specify the name of the
header to be added to the response, the second is used to specify the corresponding
value of the header, or, its content. Note that we have created an HtmlForm object to
store the GridView object inside it.
Adding Bound Fields to a GridView at Runtime
To add a bound field to a GridView control at runtime, use the
following code.
BoundField boundField = new BoundField();
boundField.DataField = "JoiningDate";
boundField.HeaderText = "Joining Date";
boundField.DataFormatString = "{0:d}";
GridView1.Columns.Add(boundField);
Formatting the GridView Control
You can format the GridView rows as per your requirements. You can use the
AlternatingRowStyle property by specifying the style for each alternate row. Here
is how you can specify this property at design time in the .aspx file.
AlternatingRowStyle-BackColor ="AliceBlue"
Chapter 6
[ 173 ]
Once you execute the application, the GridView displays the data from the Employee
table with its alternate rows in AliceBlue.


Pages:
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6