GridTemplateColumn column didnt update table

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

    Posted 14 Oct 2009 Link to this post

    Hi,

    GridTemplateColumn fileds didnt update table fields. Other fields are update ok. Why GridTemplateColumn  dont update table?

    I have bold all the template column and parameters

     <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" DataSourceID="sqlInfTRans"
                GridLines="None" Skin="Web20" AllowAutomaticDeletes="True"
                AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" EditMode="InPlace" DataMember="DefaultView">
    <MasterTableView DataKeyNames="ITransID" CommandItemDisplay="TopAndBottom" AutoGenerateColumns="False" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"
                     >
    <RowIndicatorColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>

    <ExpandCollapseColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
        <Columns>
            <telerik:GridButtonColumn CommandName="Select" Text="Select"
                UniqueName="column">
            </telerik:GridButtonColumn>
         
            
            <telerik:GridTemplateColumn UniqueName="IReasonforIssueID" HeaderText="IReasonforIssueID">
            
            <ItemTemplate>        
                    <asp:Literal ID="ltrREason" runat="server"  Text ='<%#Eval("IReasonForIssueDesc") %>' ></asp:Literal>
            
            </ItemTemplate>
            <EditItemTemplate>
            
             <telerik:Radcombobox runat="server"
                                                 ID="rcmReason"
                                                 DataTextField="IReasonForIssueDesc"
                                                 DataValueField="IReasonforIssueID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="220px"
                                                 DropDownWidth="420px"
                                                 DataSourceID="lnkReason"
                                                 SelectedValue='<%# DataBinder.GetDataItem("IReasonforIssueID") == null ? "" : (String)DataBinder.Eval(Container.DataItem, "IReasonforIssueID") %>'
                                                 EnableItemCaching="True"
                                                 EnableLoadOnDemand="True"
                                                 emptymessage="Please select one..."
                                                 allowcustomtext="True" MarkFirstMatch="True">
                                                 </telerik:RadComboBox>
                                                   

            
            </EditItemTemplate>
            
            </telerik:GridTemplateColumn>

            
            
            
            <telerik:GridBoundColumn DataField="IOurDocRev" HeaderText="IOurDocRev"
                UniqueName="IOurDocRev">
            </telerik:GridBoundColumn>
            
            <telerik:gridtemplatecolumn UniqueName="IOurTransRetDate"
                                              HeaderText="IOurTransRetDate">
                                             <ItemTemplate>
                                             
                                             <asp:Literal ID="TDate" runat="server"     Text ='<%#Bind("IOurTransRetDateF") %>' ></asp:Literal>
                                             
                                                
                                             
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>
                                                 <telerik:raddatepicker ID="RadIOurTransRetDate" runat="server"
                                                     DbSelectedDate=<%#Eval("IOurTransRetDateF") %> Width="100px"  
                                                     DateInput-DateFormat="dd/MM/yyyy"  >
                                                 </telerik:RadDatePicker>
                                             
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>     

                                             
            
         
            <telerik:GridBoundColumn DataField="IOurRtrnTransNo"
                HeaderText="IOurRtrnTransNo" UniqueName="IOurRtrnTransNo">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="OurRtrnCodeID" HeaderText="OurRtrnCodeID"
                UniqueName="OurRtrnCodeID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="IfaceDocRev" HeaderText="IfaceDocRev"
                UniqueName="IfaceDocRev">
            </telerik:GridBoundColumn>
            
            
             <telerik:gridtemplatecolumn UniqueName="IfaceTransDate"
                                              HeaderText="IfaceTransDate">
                                             <ItemTemplate>                                         
                                             <asp:Literal ID="OurTransRetDate" runat="server"     Text ='<%#Bind("IfaceTransDateF") %>' ></asp:Literal>
                                                                                        
                                             
                                             </ItemTemplate>
                                             
                                             <EditItemTemplate>
                                                 <telerik:raddatepicker ID="RadIfaceTransDate" runat="server"
                                                     DbSelectedDate='<%#Eval("IfaceTransDateF") %>' Width="100px"  
                                                     DateInput-DateFormat="dd/MM/yyyy"  >
                                                 </telerik:RadDatePicker>
                                             
                                             </EditItemTemplate>
                                             </telerik:GridTemplateColumn>  

                                             
                                             
            
            
            
            <telerik:GridBoundColumn DataField="IfaceTransNo" HeaderText="IfaceTransNo"
                UniqueName="IfaceTransNo">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
            </telerik:RadGrid>


            <asp:LinqDataSource ID="lnkReason" runat="server" ContextTypeName="DataClassesDataContext"
            TableName="tbl_LU_InterfacerReasonForIssues" AutoPage="False">
            </asp:LinqDataSource>                          
        
        </div>   
                              
           <asp:SqlDataSource ID="sqlInfTRans"
                                        
                                ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
                                SelectCommand="SELECT convert(varchar(10),IfaceTransDate,103) as IfaceTransDateF,convert(varchar(10),IOurTransRetDate,103) as IOurTransRetDateF, * from  qry_DATA_InterfacerTransmittals WHERE (DocNo = @DocNo) and ICompanyCode=@ICompanyCode "
                                DeleteCommand ="Delete from [tbl_DATA_InterfacerTransmittals] where ITransID=@ITransID"
                                
                                InsertCommand="insert into tbl_DATA_InterfacerTransmittals ([DocNo],[ICompanyCode],IReasonforIssueID,IOurDocRev,IOurTransRetDate,IOurRtrnTransNo,OurRtrnCodeID,IfaceDocRev,IfaceTransDate,IfaceTransNo)
                                values(@DocNo,@ICompanyCode,@IReasonforIssueID,@IOurDocRev,@IOurTransRetDate,@IOurRtrnTransNo,@OurRtrnCodeID,@IfaceDocRev,@IfaceTransDate,@IfaceTransNo)"
                                
                                
                                UpdateCommand="update tbl_DATA_InterfacerTransmittals set [IReasonforIssueID]=@IReasonforIssueID,IOurDocRev=@IOurDocRev,IOurTransRetDate=@IOurTransRetDate,
                                IOurRtrnTransNo=@IOurRtrnTransNo,OurRtrnCodeID=@OurRtrnCodeID,IfaceDocRev=@IfaceDocRev,IfaceTransDate=@IfaceTransDate,IfaceTransNo=@IfaceTransNo where ITransID=@ITransID"
                                runat="server">
                                                                                   
                                        
                                        <SelectParameters>                                                                           
                                            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                           <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ICompanyCode" />

                                        </SelectParameters>
                                        <DeleteParameters>
                                            <asp:Parameter Name="ITransID" Type="Int32" />
                                        
                                        </DeleteParameters>
                                        
                                    <UpdateParameters>
                                        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                        <asp:Parameter Name="ITransID" Type="Int32" />            
                                        <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ICompanyCode" />

                                        <asp:Parameter Name="IReasonforIssueID" Type="String" />
                                        <asp:Parameter Name="IOurDocRev" Type="String" />
                                        <asp:Parameter Name="IOurTransRetDate" Type="String" />
                                        <asp:Parameter Name="IOurRtrnTransNo" Type="String" />
                                        <asp:Parameter Name="OurRtrnCodeID" Type="String" />
                                        <asp:Parameter Name="IfaceDocRev" Type="String" />                                    
                                        <asp:Parameter Name="IfaceTransDate" Type="String" />
                                        <asp:Parameter Name="IfaceTransNo" Type="String" />                                                              
                                    </UpdateParameters>
                                        
                            <InsertParameters>
                                                                         
                                        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                        <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ICompanyCode" />
                                         
                                        <asp:Parameter Name="IReasonforIssueID" Type="String" />
                                        <asp:Parameter Name="IOurDocRev" Type="String" />
                                        <asp:Parameter Name="IOurTransRetDate" Type="String" />
                                        <asp:Parameter Name="IOurRtrnTransNo" Type="String" />
                                        <asp:Parameter Name="OurRtrnCodeID" Type="String" />
                                        <asp:Parameter Name="IfaceDocRev" Type="String" />                                    
                                        <asp:Parameter Name="IfaceTransDate" Type="String" />
                                        <asp:Parameter Name="IfaceTransNo" Type="String" />
                                        
                              </InsertParameters>                                    
                                    </asp:SqlDataSource>

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 16 Oct 2009 Link to this post

    Hi lakmal,

    Please review the following online example which handles the desired functionality and let me know what is the difference in your scenario.
    http://demos.telerik.com/aspnet-ajax-beta/combobox/examples/functionality/comboingrid/defaultcs.aspx?product=grid

    Kind regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top