Delete raise error

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

    Posted 04 Sep 2009 Link to this post

    Hi,

    This is my grid and datasource. When i delete its raise this error. Why that?

    Could not find control 'RadComp' in ControlParameter 'IDCcomID'.


     <telerik:RadGrid ID="RadGrid5" runat="server" AutoGenerateColumns="False"  AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" AllowAutomaticDeletes="false"
                                            GridLines="None" DataSourceID="SqlDataSource2" Width="400px"
                                    AllowSorting="True" Skin="Web20" >
                                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="DocNo" CommandItemDisplay="TopAndBottom" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" >
                                    
                                        <Columns>
                                                                                 
                                            <telerik:GridBoundColumn DataField="DocNo" HeaderText="Doc No" Visible="false" ReadOnly="true"
                                                UniqueName="DocNo">
                                            </telerik:GridBoundColumn>
                                            
                                          <telerik:GridTemplateColumn UniqueName="TemplateColumn1" HeaderText="Doc Own AppComment">                                        
                                            <ItemTemplate>                                        
                                             <telerik:RadComboBox runat="server"
                                                 ID="RadComp"
                                                 DataTextField="DocOwnAppComment"
                                                 DataValueField="DocOACID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="220px"
                                                 DropDownWidth="420px"
                                                    DataSourceID="ContactsDataSource"
                                                    SelectedValue='<%#Bind("IDCcomID") %>'></telerik:RadComboBox>
                                            
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                            
                                            <telerik:RadComboBox runat="server"
                                                 ID="RadCompEdit"
                                                 DataTextField="DocOwnAppComment"
                                                 DataValueField="DocOACID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="220px"
                                                 DropDownWidth="420px"
                                                    DataSourceID="ContactsDataSource"
                                                    SelectedValue='<%#Bind("IDCcomID") %>'></telerik:RadComboBox>
                                                    
                                            
                                            </EditItemTemplate>                                        
                                            </telerik:GridTemplateColumn>                                    
                                            
                                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Are you sure delete this record?"
                                                Text="Delete" UniqueName="column">
                                            </telerik:GridButtonColumn>
                                           </Columns>
                                        
                                    </MasterTableView>
                                  </telerik:RadGrid>


     <asp:SqlDataSource ID="SqlDataSource2"
                                        ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>" runat="server"
                                        SelectCommand="SELECT DocNo , [IDCcomID] FROM [tbl_DATA_IDCcomment] WHERE (DocNo = @DocNo)"
                                        DeleteCommand="DELETE FROM [tbl_DATA_IDCcomment] WHERE [DocNo] = @DocNo and IDCcomID=@IDCcomID "
                                        InsertCommand="INSERT INTO tbl_DATA_IDCcomment(DocNo, IDCcomID) VALUES (@DocNo, @IDCcomID)" >
                                      <SelectParameters>                                                                           
                                            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                        </SelectParameters>
                                                                            
                                         <DeleteParameters>
                                               <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />   
                                               <asp:ControlParameter ControlID="RadComp" PropertyName="SelectedValue" Type="Int32" Name="IDCcomID" />  
                                        </DeleteParameters>
                                        <InsertParameters>
                                                <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />   
                                               <asp:ControlParameter ControlID="RadCompEdit" PropertyName="SelectedValue" Type="Int32" Name="IDCcomID" />  
                                        </InsertParameters>
                                    </asp:SqlDataSource>








  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Sep 2009 Link to this post

    Hello lak,

    You cannot have control parameter with control which is inside of different INamingContainer. In your case you have this control inside repeating control (RadGrid) and finally you will get page-size controls of this type.

    Kind regards,
    Vlad
    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
  4. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 04 Sep 2009 Link to this post

    How can i solve this. Have you any sample code?

    krds
    lakmal
Back to Top