Click here to Skip to main content
15,883,558 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all how to add rows and coloumn in grid dynamically by using vb.net code.please give me some example code
Posted
Comments
Mehdi Gholam 30-Oct-11 5:07am    
WEB, WPF, Winforms which?
Dave Kreskowiak 30-Oct-11 9:29am    
Which "grid" are you using? Is this a WinForms app? ASP.NET? Silverlight? WPF??

Your question isn't anserable until you provide the missing details.

1 solution

XML
<asp:GridView ID="GridView1" runat="server"
    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
    CellPadding="3" AutoGenerateColumns="False" Height="122px" Width="544px">

    <RowStyle ForeColor="#000066" />
    <Columns>
        <asp:BoundField HeaderText="Name"  DataField="Name" />
        <asp:BoundField HeaderText="Mobile Number" DataField="Mobile Number" />
        <asp:BoundField HeaderText="Email ID"  DataField="Email ID"/>
        <asp:BoundField HeaderText="Comment"  DataField="Comment"/>
    </Columns>

    <FooterStyle BackColor="White" ForeColor="#000066" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900