BorderColor, CellPadding, CellSpacing for ASP:DataGrid (VB.net) : DataGrid « Asp Control « ASP.Net

Home
ASP.Net
1.ADO.net Database
2.Ajax
3.Asp Control
4.Collections
5.Components
6.Data Binding
7.Development
8.File Directory
9.HTML Control
10.Language Basics
11.Login Security
12.Mobile Control
13.Network
14.Page
15.Request
16.Response
17.Server
18.Session Cookie
19.Sitemap
20.Theme Style
21.User Control and Master Page
22.Validation by Control
23.Validation by Function
24.WebPart
25.WPF
26.XML
ASP.Net » Asp Control » DataGrid 
BorderColor, CellPadding, CellSpacing for ASP:DataGrid (VB.net)

    
    <%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Data" %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
    If Not IsPostBack Then
        Dim MyDT As New DataTable
        Dim MyRow As DataRow
        MyDT.Columns.Add(New DataColumn("EmployeeID", _
            GetType(Int32)))
        MyDT.Columns.Add(New DataColumn("EmployeeFirstName", _
            GetType(String)))
        MyDT.Columns.Add(New DataColumn("EmployeeLastName", _
            GetType(String)))
        MyDT.Columns.Add(New DataColumn("BirthDate", _
            GetType(Date)))
        MyDT.Columns.Add(New DataColumn("Salary", _
            GetType(Single)))

        MyRow = MyDT.NewRow()
        MyRow(01
        MyRow(1"Bob"
        MyRow(2"Miller"
        MyRow(3"5/15/65"
        MyRow(4"40000"
        MyDT.Rows.Add(MyRow)
        MyRow = MyDT.NewRow()
        MyRow(02
        MyRow(1"Jenny"
        MyRow(2"Fry"
        MyRow(3"7/22/75"
        MyRow(4"73050"
        MyDT.Rows.Add(MyRow)
        MyRow = MyDT.NewRow()
        MyRow(03
        MyRow(1"Lisa"
        MyRow(2"Smith"
        MyRow(3"12/8/71"
        MyRow(4"62500"
        MyDT.Rows.Add(MyRow)
        MyRow = MyDT.NewRow()
        MyRow(04
        MyRow(1"Stephanie"
        MyRow(2"Myer"
        MyRow(3"3/15/54"
        MyRow(4"43222"
        MyDT.Rows.Add(MyRow)
        MyRow = MyDT.NewRow()
        MyRow(05
        MyRow(1"Jimmy"
        MyRow(2"Parker"
        MyRow(3"3/12/47"
        MyRow(4"52825"
        MyDT.Rows.Add(MyRow)

        dg1.DataSource = MyDT
        dg1.DataBind()
    End If
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>DataGrid Control Sample Page</TITLE>
</HEAD>
<BODY  >
<form runat="server">
<Font Face="Tahoma">
<ASP:DataGrid 
    id="dg1" 
    runat="server"
    Width="90%"
    BorderColor="black"
    CellPadding=
    CellSpacing="0"
    Font-Name="Trebuchet MS"
    Font-Size="10pt"
    ForeColor="Black"
    BackColor="Beige" 
    AlternatingItemStyle-ForeColor="Cornsilk"
    AlternatingItemStyle-BackColor="DarkBlue"
    AlternatingItemStyle-Font-Name="Arial"
    AlternatingItemStyle-Font-Italic="True"
    HeaderStyle-BackColor="Burlywood"
    HeaderStyle-Font-Bold="True"
/>

</Font>
</Form>
</BODY>
</HTML>
           
       
Related examples in the same category
1.Add data to datagrid (VB.net)
2.Font-Name, Font-Size for ASP:DataGrid (VB.net)
3.ForeColor, BackColor for ASP:DataGrid (VB.net)
4.AlternatingItemStyle-ForeColor, AlternatingItemStyle-BackColor for ASP:DataGrid (VB.net)
5.AlternatingItemStyle-Font-Name, AlternatingItemStyle-Font-Italic (VB.net)
6.HeaderStyle-BackColor, HeaderStyle-Font-Bold (VB.net)
7.Add button to asp:DataGrid (VB.net)
8.Add hyperlink a asp:datagrid (VB.net)
9.Add hyperlink to asp:datagrid table column (VB.net)
10.Add navigator to asp:datagrid (VB.net)
11.Set item style, header style and alternating item style for the asp datagrid (C#)
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.