1. When displaying datatime data in the gridview, remove the following time and minute seconds, for example, 00:00:00. Remove the following 00:00:00 operation method:
Add the property DataformatString = "{0: yyyy-MM-dd}" HtmlEncode = "false" to <asp: BoundField DataField = "birth" HeaderText = "Date of birth"/> ", the displayed date formats include 2008-01-01 and-12;
If DataformatString = "{0: d}" HtmlEncode = "false" is added, the displayed date formats include 2008-1-1 and-10.
If DataformatString = "{0: D}" HtmlEncode = "false" is added, the format of the displayed date is May 8, 1976, October 18, 1976,
HtmlEncode = "false" is essential!
2. In the text box, when displaying datatime data, remove the time, minute, and second method:
Rq. Text = Convert. ToDateTime (ds. Tables [0]. Rows [0] ["f_starttime"]. ToString (). to1_datestring ();
ToShortDateString (): This function belongs to the datatime data type. It is responsible for removing the hour, minute, and second.
3. When the mouse is in the gridview, the background color of each row changes. The operation is as follows:
Add the following statement to the RowDataBound event of the gridview:
If (e. Row. RowType = DataControlRowType. DataRow)
{
// Change the background color when the mouse stays
E. Row. Attributes. Add ("onmouseover", "c = this. style. backgroundColor; this. style. backgroundColor = '# ffccff '");
// Restore the background color when you move the mouse away.
E. Row. Attributes. Add ("onmouseout", "this. style. backgroundColor = c ");
}
In this way, the effect can be achieved.
From the whx_1113 Column