data Gridviw

$0Rry045
Posted by $0Rry045 under Windows Forms category on | Points: 40 | Views : 2308
How to add row in datagridview without delete another data which comes from data base
plz expalin with example and to save that data also...thanks in advance

Comments or Responses

Posted by: Valley on: 5/7/2013 Level:Starter | Status: [Member] | Points: 10
You want to add row or column?
Posted by: $0Rry045 on: 5/8/2013 Level:Starter | Status: [Member] | Points: 10
Hey I want to add a new row but when clicked on a new row button its deleted all the exixting record and then make a new row i want a row in existing records.......
plz help me out it's very urgent
Posted by: Valley on: 5/8/2013 Level:Starter | Status: [Member] | Points: 10
Please read this.

http://www.codeproject.com/Articles/467788/Dynamically-adding-and-deleting-rows-from-ASP-NET
Posted by: Valley on: 5/8/2013 Level:Starter | Status: [Member] | Points: 10
Please read this.

http://www.codeproject.com/Articles/467788/Dynamically-adding-and-deleting-rows-from-ASP-NET

<asp:GridView ID="grvStudentDetails" runat="server"
ShowFooter="True" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333"
GridLines="None" OnRowDeleting="grvStudentDetails_RowDeleting">
<Columns>
<asp:BoundField DataField="RowNumber" HeaderText="SNo" />
<asp:TemplateField HeaderText="Student Name">
<ItemTemplate>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Age">
<ItemTemplate>
<asp:TextBox ID="txtAge" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Student Address">
<ItemTemplate>
<asp:TextBox ID="txtAddress" runat="server"
Height="55px" TextMode="MultiLine"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Gender">
<ItemTemplate>
<asp:RadioButtonList ID="RBLGender"
runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="M">Male</asp:ListItem>
<asp:ListItem Value="F">Female</asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Qualification">
<ItemTemplate>
<asp:DropDownList ID="drpQualification" runat="server">
<asp:ListItem Value="G">Graduate</asp:ListItem>
<asp:ListItem Value="P">Post Graduate</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right" />
<FooterTemplate>
<asp:Button ID="ButtonAdd" runat="server"
Text="Add New Row" OnClick="ButtonAdd_Click" />
</FooterTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
Posted by: $0Rry045 on: 5/8/2013 Level:Starter | Status: [Member] | Points: 10
Thanks..............I got It........

Login to post response