This is a migrated thread and some comments may be shown as answers.

JS Error: RadGrid with tooltip, Drag and Drop issue

3 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anshul
Top achievements
Rank 1
Anshul asked on 30 Jul 2008, 08:27 PM
Hi,

I have a Radgrid that has a Radtooltip defined inside of it. The rows from this radgrid can be dragged and dropped to another grid.The second radgrid is just a regular Radgrid. When I drag one item from the first grid to the second, everything is fine, when subsiquent rows are dropped I get the following javascript error :
"Two components with the same id 'Name of control, something RadTooltip' cannot be added to the same application" 

After debugging the script foillowing is the dynamic javascript function and the line that it breaks on: 

throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id));

function Sys$_Application$addComponent(component) {  
        /// <summary locid="M:J#Sys._Application.addComponent" /> 
        /// <param name="component" type="Sys.Component"></param> 
        var e = Function._validateParams(arguments, [  
            {name: "component", type: Sys.Component}  
        ]);  
        if (e) throw e;  
        var id = component.get_id();  
        if (!id) throw Error.invalidOperation(Sys.Res.cantAddWithoutId);  
        if (typeof(this._components[id]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id));  
        this._components[id] = component;  
    } 

Following is the markup for the RadGrid with the tooltip inside it.:

 <telerik:RadGrid runat="server" AllowPaging="True" ID="RadGridReports" Height="320px" PagerStyle-Mode="Slider" 
                 Width="375px" GridLines="None" AutoGenerateColumns="false" ClientSettings-ClientEvents-OnRowDropping="onGridReportsRowDropping"   
                 ClientSettings-EnablePostBackOnRowClick="true" ClientSettings-ClientEvents-OnRowDragStarted="onGridReportsNodeDragging">  
                   
                 <MasterTableView> 
                        <columns>                                                                          
                        <telerik:GridBoundColumn DataField="TemplateID"  HeaderText="TemplateID"   
                            SortExpression="TemplateID" Visible="false" UniqueName="TemplateID" /> 
                        <telerik:GridBoundColumn DataField="TemplateName" HeaderText="Saved Templates"   
                            SortExpression="TemplateName" Visible="true" UniqueName="TemplateName" /> 
                          
                          
                        <telerik:GridBoundColumn DataField="GMaxDate" HeaderText="EndDate"   
                            SortExpression="GMaxDate" Visible="true" UniqueName="GMaxDate" /> 
                   
 
                        <telerik:GridTemplateColumn HeaderText="Details" SortExpression="ViewDetails" UniqueName="ViewDetails">     
                            <ItemTemplate>    
                        <asp:Label ID="lbl" runat="server" Text="Details"></asp:Label> 
 
                         <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="lbl" RelativeTo="Element" Skin="Default" 
                            Position="BottomLeft" Animation="None" AutoCloseDelay="30000" > 
                          <table border="0">  
                          <tr> 
                          <td style="background-color:GrayText">  
                          <h4><b><%#DataBinder.Eval(Container, "DataItem.TemplateName")%></b></h4> 
                          </td> 
                          </tr> 
                          <tr> 
                          <td> 
                          <b><u>Manager Account(s):</u></b>  
                          </td> 
                          </tr> 
                          <tr> 
                          <td> 
                          <b> <%#DataBinder.Eval(Container, "DataItem.AccountName")%> </b> &nbsp;&nbsp; <b><%#DataBinder.Eval(Container, "DataItem.MinAcctDate")%></b> to: <b><%#DataBinder.Eval(Container, "DataItem.MaxAcctDate")%></b>  
                            
                          </td> 
                          </tr> 
                          <tr> 
                          <td> 
                          <u>Benchmark Account:</u> 
                          </td> 
                          </tr> 
                          <tr> 
                          <td> 
                          <b><%#DataBinder.Eval(Container, "DataItem.BenchmarkName")%></b>   &nbsp;&nbsp; <b> <%#DataBinder.Eval(Container, "DataItem.MinBenchDate")%></b> to: <b><%#DataBinder.Eval(Container, "DataItem.MaxBenchDate")%></b>  
                          </td> 
                          </tr> 
                          <tr> 
                          <td style="background-color:Lime">  
                          <h4><b>Report can be run through: <%#DataBinder.Eval(Container, "DataItem.GMaxDate")%></b></h4>   
                          </td> 
                          </tr> 
                          </table> 
                             
                        </telerik:RadToolTip> 
 
                            </ItemTemplate>    
                        </telerik:GridTemplateColumn> 
 
                        </columns>                      
                            <RowIndicatorColumn Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Resizable="False" Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                            <EditFormSettings> 
                                <PopUpSettings ScrollBars="None" /> 
                            </EditFormSettings> 
                        </MasterTableView> 
                <ClientSettings AllowRowsDragDrop="True">  
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="True"/>                      
                </ClientSettings> 
                  
            </telerik:RadGrid>            
 

any help would be appreciated.

Thank you.

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 04 Aug 2008, 01:32 PM
Hello Anshul,

I'm afraid that I am unable to reproduce the described behavior with the given details. Are you trying to add the element to which RadToolTip is attached to the row on which the dragged RadGrid item is dropped? For example by directly coping the row's content?

It will be highly appreciated if you can send us (attached to a formal ticket) a small working project in which this behavior can be observed. Thus we will be able to gather more details about your case and provide you with more to-the-point answer.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Anshul
Top achievements
Rank 1
answered on 04 Aug 2008, 05:00 PM
Hi Rosen,

Thank you for your response. I am going to send you an attached project in a few days. Currently I got busy working on something else. I will isolate the controls and functionality in question and send you the attachment.

thank you,
Anshul.
0
Sebastian
Telerik team
answered on 05 Aug 2008, 05:53 AM
Hi Anshul,

We will be expecting your sample project once you are ready with it.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Anshul
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Anshul
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or