Didnt update EditItemTemplate column data

2 posts, 0 answers
  1. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 23 Jan 2010 Link to this post

    Hi,

    I have grid view with update, add new and delete functionality. I use datasource to that operation. When i update data some data is not updating. As my focus textboxes filed cant update. Other data is updating. I highligtht below wich columns are not update

     <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Width="750px"
                AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                                            GridLines="None" DataSourceID="SqlTransmital"
                                    AllowSorting="True" Skin="Web20"
                ClientDataKeyNames="VTransID"  DataMember="DefaultView" >
                                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="VTransID"
                                        CommandItemDisplay="Top" AllowAutomaticDeletes="true"
                                        AllowAutomaticInserts="true" AllowAutomaticUpdates="true">                                
                                      <Columns>
                                          <telerik:grideditcommandcolumn ButtonType="ImageButton">
                                          </telerik:GridEditCommandColumn>
                                            
                                            
                                            <telerik:gridtemplatecolumn UniqueName="VReasonforIssueID"
                                              HeaderText="Reason for Issue" DataField="VReasonforIssueID">
                                     <ItemTemplate>                                 
                                     <asp:Literal ID="ltrREason" runat="server"  Text ='<%#Eval("VReasonForIssue") %>' ></asp:Literal>
                                              
                                     </ItemTemplate>
                                     <EditItemTemplate>
                                     
                                     <telerik:radcombobox runat="server"
                                                 ID="ddlReasonEdit"
                                                 DataTextField="VReasonForIssue"
                                                 DataValueField="VReasonforIssueID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="200px"
                                                 DropDownWidth="200px"
                                                 EnableItemCaching="True"
                                                 EnableLoadOnDemand="True"
                                                 emptymessage="Please select one..."
                                                 allowcustomtext="True"
                                                    DataSourceID="sqlReason"
                                                    SelectedValue='<%#Bind("VReasonforIssueID") %>'></telerik:RadComboBox>
                                                    
                                      <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="ddlReasonEdit" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                                      
                                     </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            
                                            
                                             <telerik:gridtemplatecolumn UniqueName="VendorDocRev"
                                              HeaderText="Vendor Doc Rev" DataField="VendorDocRev">
                                             <ItemTemplate>
                                             
                                             <asp:Literal ID="ltrVendorDocRev" runat="server"     Text ='<%#Bind("VendorDocRev") %>' ></asp:Literal>
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>                                         
                                                <asp:TextBox ID="VendorDocRev"  Text ='<%#Eval("VendorDocRev") %>' runat="server"></asp:TextBox>
                                             
                                               
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>     
                                           
     
                                                                         
                                            <telerik:gridtemplatecolumn UniqueName="VendorTransDate"
                                              HeaderText="Vendor Incoming Trans Date" DataField="VendorTransDateF">
                                             <ItemTemplate>
                                             
                                             <asp:Literal ID="TDate" runat="server"     Text ='<%#Bind("VendorTransDateF") %>' ></asp:Literal>
                                             
                                                
                                             
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>
                                                 <telerik:raddatepicker ID="RadOurTransDateEdit" runat="server"
                                                     DbSelectedDate='<%#Bind("VendorTransDate") %>' Width="100px"  
                                                     DateInput-DateFormat="dd/MM/yyyy"  >
                                                 </telerik:RadDatePicker>
                                             
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>                                
                                                                                    
                                            
                                            <telerik:gridtemplatecolumn UniqueName="VendorTransNo"
                                              HeaderText="Vendor Trans No" DataField="VendorTransNo">
                                             <ItemTemplate>
                                             
                                             <asp:Literal ID="ltrVendorTransNo" runat="server"     Text ='<%#Bind("VendorTransNo") %>' ></asp:Literal>
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>                                         
                                                <asp:TextBox ID="VendorTransNo" Text ='<%#Eval("VendorTransNo") %>' runat="server"></asp:TextBox>
                                             
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                                                    ControlToValidate="VendorTransNo" ErrorMessage="*"
                                                    ValidationExpression="^[0-9]+$">
                                                </asp:RegularExpressionValidator>                                              
                                             
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>  
                                       
          
                                                                                                                          
                                            <telerik:GridBoundColumn DataField="VOurDocRev" HeaderText="Cam Doc Rev"  
                                                UniqueName="VOurDocRev">
                                            </telerik:GridBoundColumn>
                                                                                    
                                            <telerik:GridTemplateColumn UniqueName="VOurTransRetDate"
                                              HeaderText="Cam to Vendor Trans Date" DataField="VOurTransRetDateF">
                                             <ItemTemplate>
                                                 <asp:Literal ID="TCDate" runat="server"     Text ='<%#Bind("VOurTransRetDateF") %>' ></asp:Literal>

                                                
                                             
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>
                                                 <telerik:raddatepicker ID="RadCRtrnDateEdit" runat="server"
                                                     DbSelectedDate='<%#Bind("VOurTransRetDate") %>' Width="100px"  
                                                     DateInput-DateFormat="dd/MM/yyyy">
                                                 </telerik:RadDatePicker>
                                             
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>
                                                                                   
                                                                                  
                                           
                                           <telerik:gridtemplatecolumn UniqueName="VOurRtrnTransNo"
                                              HeaderText="VOur Rtrn Trans No" DataField="VOurRtrnTransNo" >
                                             <ItemTemplate>
                                             
                                             <asp:Literal ID="ltrVOurRtrnTransNo" runat="server"     Text ='<%#Bind("VOurRtrnTransNo") %>' ></asp:Literal>
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>                                         
                                                <asp:TextBox ID="VOurRtrnTransNo" Text ='<%#Eval("VOurRtrnTransNo") %>'  runat="server"></asp:TextBox>
                                             
                                             
                                             
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                                                    ControlToValidate="VOurRtrnTransNo" ErrorMessage="*"
                                                    ValidationExpression="^[0-9]+$">
                                                </asp:RegularExpressionValidator>                                              
                                             
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>
                                         
        
     
                                          
                                            <telerik:gridtemplatecolumn UniqueName="OurRtrnCodeID"
                                              HeaderText="Cam Return Code" DataField="OurRtrnCode">
                                             <ItemTemplate>
                                             
                                              <asp:Literal ID="ltrClientRtn" runat="server"     Text ='<%#Eval("OurRtrnDescription") %>' ></asp:Literal>
                                              
                                     
                                                                                             
                                     </ItemTemplate>
                                     <EditItemTemplate>
                                     
                                     <telerik:radcombobox runat="server"
                                                 ID="ddlClientReturnEdit"
                                                 DataTextField="ReturnDescription"
                                                 DataValueField="OurRtrnCodeID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="200px"
                                                 EnableItemCaching="True"
                                                 EnableLoadOnDemand="True"
                                                 DropDownWidth="200px"
                             emptymessage="Please select one..."
                                                 allowcustomtext="True"
                                                    DataSourceID="sqlClientReturn"
                                                    SelectedValue='<%#Bind("OurRtrnCodeID") %>'></telerik:RadComboBox>
                         
                                     
                                     </EditItemTemplate>
                                     
                                     </telerik:GridTemplateColumn>
                                            <telerik:gridbuttoncolumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Are you sure delete this record?"
                                            Text="Delete" UniqueName="column1">
                                        </telerik:GridButtonColumn>
                                        </Columns>
                                    <EditFormSettings>

                 <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                            UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                        </EditColumn>

                                    </EditFormSettings>
                                    </MasterTableView>
                                      </telerik:RadGrid>
                               
                                    <asp:SqlDataSource ID="SqlTransmital"
                                        
                                        ConnectionString="<%$ ConnectionStrings:SiteSqlServer1 %>"
                                        SelectCommand="SELECT convert(varchar(10),VendorTransDate,103) as VendorTransDateF,convert(varchar(10),VOurTransRetDate,103) as VOurTransRetDateF, * FROM [qry_data_VendorTransmittals] WHERE (DocNo = @DocNo)"
                                        DeleteCommand ="Delete from [tbl_DATA_VendorTransmittals] where VTransID=@VTransID"
                                        
                                        InsertCommand="insert into tbl_DATA_VendorTransmittals ([VendorDocRev],[VendorTransDate],VReasonforIssueID,
                                        [VOurTransRetDate],[VOurRtrnTransNo],OurRtrnCodeID,DocNo,[VendorTransNo],VOurDocRev) values(@VendorDocRev,@VendorTransDate,
                                        @VReasonforIssueID,@VOurTransRetDate ,@VOurRtrnTransNo,@OurRtrnCodeID,@DocNo,@VendorTransNo,@VOurDocRev) "
                                        
                                        UpdateCommand="update tbl_DATA_VendorTransmittals set [VendorDocRev]=@VendorDocRev, [VendorTransDate]=@VendorTransDate,[VendorTransNo]=@VendorTransNo,
                                        VReasonforIssueID=@VReasonforIssueID, [VOurTransRetDate]=@VOurTransRetDate,
                                        [VOurRtrnTransNo]=@VOurRtrnTransNo,OurRtrnCodeID=@OurRtrnCodeID, VOurDocRev=@VOurDocRev where VTransID=@VTransID" runat="server">
                                                                                    
                                        
                                      <SelectParameters>                                                                           
                                            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                        </SelectParameters>
                                        <DeleteParameters>
                                            <asp:Parameter Name="VTransID" Type="Int32" />
                                        
                                        </DeleteParameters>
                                        
                                        <UpdateParameters>
                                        <asp:Parameter Name="VTransID" Type="Int32" />                                    
                                        <asp:Parameter Name="VendorDocRev" Type="String" />
                                        <asp:Parameter Name="VendorTransDate" Type="DateTime" />
                                        <asp:Parameter Name="VendorTransNo" Type="Int32" />
                                        <asp:Parameter Name="VReasonforIssueID" Type="Int32" />
                                        <asp:Parameter Name="VOurTransRetDate" Type="DateTime" />
                                        
                                    <asp:Parameter Name="VOurRtrnTransNo" Type=String  />
                                        <asp:Parameter Name="OurRtrnCodeID" Type="Int32" />
                                        <asp:Parameter Name="VOurDocRev" Type="String" />
                                        
                                        </UpdateParameters>
                                        
                                        <InsertParameters>
                                        <asp:Parameter Name="VOurDocRev" Type="String" />
                                        <asp:Parameter Name="VTransID" Type="Int32" />                                    
                                        <asp:Parameter Name="VendorDocRev" Type="String" />
                                        <asp:Parameter Name="VendorTransDate" Type="DateTime" />
                                        <asp:Parameter Name="VendorTransNo" Type="Int32" />
                                        <asp:Parameter Name="VReasonforIssueID" Type="Int32" />
                                        <asp:Parameter Name="VOurTransRetDate" Type="DateTime" />
                                        <asp:Parameter Name="VOurRtrnTransNo" Type="Int32" />
                                        <asp:Parameter Name="OurRtrnCodeID" Type="Int32" />                                    
                                        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                        
                                        </InsertParameters>
                                    </asp:SqlDataSource>
          
    Only bold feilds are not updating. Others updating is fine

    krds
    lakmal

  2. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 26 Jan 2010 Link to this post

    I found solution.

    When i use Bind instead of Eval  its work
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top