Hi all....
Im using ajax for the first time. plz help me out tin this scenario:
I have gridview in the update panel. A link button is placed in a template feild of the gridview which adds new row on click.
Prob is tht when i fill out the txtboxes and checkboxes of the first row and click the new row button....a new row appears but the previous row data is refereshed and all values disappear.
I want tht when i click new row ...a new row is added and the previous row data stays in the textboxes of that row.
i also want to save the previous row data somewhere(some data structure...) when clicking for new row.
plz help me !!
thisi s the code im using...
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel ID="Grid_UpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnPreRender="GridView1_PreRender"
BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
CellPadding="4" ForeColor="Black" GridLines="Vertical">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="add_row_LinkButton" runat="server" CausesValidation="False" CommandName="Insert"
OnClick="add_row_LinkButton_Click">New</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:TextBox ID="col_nameTextBox" runat="server" BackColor="White"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Abbreviation">
<ItemTemplate>
<asp:TextBox ID="col_abbrvTextBox" runat="server" BackColor="White"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Type">
<ItemTemplate>
<asp:DropDownList ID="col_type_dd" runat="server" AutoPostBack="True" OnSelectedIndexChanged="col_type_dd_SelectedIndexChanged" BackColor="White">
<asp:ListItem>Please Select..</asp:ListItem>
<asp:ListItem>bit</asp:ListItem>
<asp:ListItem>date</asp:ListItem>
<asp:ListItem>decimal</asp:ListItem>
<asp:ListItem>integer</asp:ListItem>
<asp:ListItem>string</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>