Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I have two text box named as rate and quantity inside a grid view as item template.when i change the rate and quantity value then total amount field must be updated but when i am trying to do that by using update panel i got a error.

ASP.NET
<asp:GridView ID="gvChallan" runat="server" AutoGenerateColumns="False" 
     CellPadding="3" HorizontalAlign="Center" 
     BackColor="White" BorderColor="#CCCCCC" Font-Size="Small"
    BorderStyle="None" BorderWidth="1px" ShowFooter="True" Width="950px" >
   <columns>

    <asp:TemplateField HeaderText="Product Name">
        <itemtemplate>
            <asp:DropDownList ID="drpproduct" Width="200px" runat="server" DataValueField="PName"
            onselectedindexchanged="drpproduct_SelectedIndexChanged" AutoPostBack="true" > 
         
        </itemtemplate>
        <HeaderStyle Width="200px" />
    

     <asp:TemplateField HeaderText="Sub Item">
        <itemtemplate>
             <asp:UpdatePanel ID="Upsubitem" runat="server"  UpdateMode="Conditional" RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="drpproduct" EventName="TextChanged" />
                </Triggers>
            <contenttemplate>
                <asp:DropDownList ID="drpsubitem" Width="200px" runat="server" DataValueField="BName"
                onselectedindexchanged="drpsubitem_SelectedIndexChanged" AutoPostBack="true" >
                   
            </contenttemplate>
            
        </itemtemplate>
        
        <HeaderStyle Width="200px" />
    

    <asp:TemplateField HeaderText="Quantity">
        <itemtemplate>
            <asp:UpdatePanel ID="upqty" runat="server"  UpdateMode="Conditional" RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="drpproduct" EventName="TextChanged" />
                </Triggers>
            <contenttemplate>
                <asp:TextBox ID="txtquantity" runat="server" MaxLength="5" CssClass="textb"
                 Width="70px" OnTextChanged="QtyChanged" AutoPostBack="true" >
            </contenttemplate>
            
        </itemtemplate>
        <HeaderStyle Width="70px" />
    

    <asp:TemplateField HeaderText="Unit">
        <itemtemplate>
             <asp:UpdatePanel ID="upUnit" runat="server"  UpdateMode="Conditional" RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="drpproduct" EventName="TextChanged" />
Posted
Updated 20-Feb-14 0:57am
v2
Comments
[no name] 20-Feb-14 6:41am    
What error you are getting
[no name] 20-Feb-14 6:41am    
Could you provide some code here so that i can help you.
Sandip Paul 491984 20-Feb-14 6:55am    
A control with ID 'txtrate' could not be found for the trigger in UpdatePanel 'uptotamt'.
This is the error i am getting
Sandip Paul 491984 20-Feb-14 6:55am    
<asp:GridView ID="gvChallan" runat="server" AutoGenerateColumns="False"
CellPadding="3" HorizontalAlign="Center"
BackColor="White" BorderColor="#CCCCCC" Font-Size="Small"
BorderStyle="None" BorderWidth="1px" ShowFooter="True" Width="950px" >
<columns>
<asp:TemplateField HeaderText="Product Name">
<itemtemplate>
<asp:DropDownList ID="drpproduct" Width="200px" runat="server" DataValueField="PName"
onselectedindexchanged="drpproduct_SelectedIndexChanged" AutoPostBack="true" >


<HeaderStyle Width="200px" />


<asp:TemplateField HeaderText="Sub Item">
<itemtemplate>
<asp:UpdatePanel ID="Upsubitem" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="drpproduct" EventName="TextChanged" />
</Triggers>
<contenttemplate>
<asp:DropDownList ID="drpsubitem" Width="200px" runat="server" DataValueField="BName"
onselectedindexchanged="drpsubitem_SelectedIndexChanged" AutoPostBack="true" >





<HeaderStyle Width="200px" />


<asp:TemplateField HeaderText="Quantity">
<itemtemplate>
<asp:UpdatePanel ID="upqty" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="drpproduct" EventName="TextChanged" />
</Triggers>
<contenttemplate>
<asp:TextBox ID="txtquantity" runat="server" MaxLength="5" CssClass="textb"
Width="70px" OnTextChanged="QtyChanged" AutoPostBack="true" >



<HeaderStyle Width="70px" />


<asp:TemplateField HeaderText="Unit">
<itemtemplate>
<asp:UpdatePanel ID="upUnit" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="drpproduct" EventName="TextChanged" />

<contenttemplate>
Richard MacCutchan 20-Feb-14 6:55am    
Please provide full detaiils of your problem: show the code that causes it, and the exact text of the error message(s).

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