Click here to Skip to main content
16,017,297 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Frds,

I want to add values temprory in gridview from text box. I reffered this website:

http://www.c-sharpcorner.com/uploadfile/8c19e8/dynamically-adding-and-deleting-rows-in-gridview-and-saving/

Its executed when without databind its executed fine.. but i need, after bind values to gridview then i add extra rows..

what is my prob after bind the values, i click add button binded values are cleared then newly add row.


please help me...


Thanks & Regards,
Vivek .R
Posted

1 solution

In the Mentioned project, user call the method SetInitialRow for databinding.

The mentioned project is right. But you just need to use Eval Or Bind process for binding your data with gridview at Page_Load

Just follow the process for Databind
HTML
<asp:TemplateField HeaderText="FirstName" >
    <ItemTemplate>
        <asp:Label ID="Label1" runat="server"
            Text='<%# Bind("FirstName") %>'></asp:Label>
    </ItemTemplate>
</asp:TemplateField>


After that just get your data from database into DataSet or DataTable and Bind the Data with 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