01.
<script>
02.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
03.
{
04.
//ความกว้างคอลัมภ์
05.
if (e.Row.RowType == DataControlRowType.Header)
06.
{
07.
e.Row.Cells[0].Style.Add(
"Width"
,
"140px"
);
08.
e.Row.Cells[1].Style.Add(
"Width"
,
"140px"
);
09.
e.Row.Cells[2].Style.Add(
"Width"
,
"110px"
);
10.
e.Row.Cells[3].Style.Add(
"Width"
,
"100px"
);
11.
e.Row.Cells[4].Style.Add(
"Width"
,
"100px"
);
12.
e.Row.Cells[5].Style.Add(
"Width"
,
"100px"
);
13.
e.Row.Cells[6].Style.Add(
"Width"
,
"900px"
);
14.
e.Row.Cells[7].Style.Add(
"Width"
,
"100px"
);
15.
e.Row.Cells[8].Style.Add(
"Width"
,
"100px"
);
16.
e.Row.Cells[9].Style.Add(
"Width"
,
"100px"
);
17.
}
18.
}
19.
</script>
20.
<html>
21.
<head></head>
22.
<body>
23.
<asp:Panel ID=
"Panel1"
runat=
"server"
Width=
"700px"
ScrollBars=
"Auto"
>
24.
<asp:GridView ID=
"GridView1"
runat=
"server"
AutoGenerateColumns=
"False"
25.
style=
"font-family: Arial, Helvetica, sans-serif; font-size:medium;"
>
26.
<Columns>
27.
<asp:BoundField DataField=
"Date"
HeaderText=
"วันที่"
/>
28.
<asp:BoundField DataField=
"Time_History"
HeaderText=
"เวลา"
/>
29.
<asp:BoundField DataField=
"Cs_Method"
HeaderText=
"Cs_Method"
/>
30.
<asp:BoundField DataField=
"Cs_Uri_Stem"
HeaderText=
"Cs_Uri_Stem"
/>
31.
<asp:BoundField DataField=
"Cs_Uri_Query"
HeaderText=
"Cs_Uri_Query"
/>
32.
<asp:BoundField DataField=
"Cs_UserAgent"
HeaderText=
"Cs_UserAgent"
/>
33.
<asp:BoundField DataField=
"Sc_Status"
HeaderText=
"Sc_Status"
/>
34.
<asp:BoundField DataField=
"Sc_Substatus"
HeaderText=
"Sc_Substatus"
/>
35.
<asp:BoundField DataField=
"Sc_Win32_Status"
HeaderText=
"Sc_Win32_Status"
/>
36.
<asp:BoundField DataField=
"Time_Taken"
HeaderText=
"Time_Taken"
/>
37.
</Columns>
38.
<HeaderStyle Font-Size=
"Small"
Height=
"50px"
/>
39.
<RowStyle Font-Size=
"Small"
Height=
"30px"
/>
40.
</asp:GridView>
41.
</asp:Panel>
42.
</body>
43.
</html>