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

RadToolTip not finding the targetControl ID

4 Answers 228 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simba
Top achievements
Rank 1
Simba asked on 19 Sep 2011, 07:41 PM
I am getting the below error after I added the radtooltip to the rad grid, The data is bound in the code behind but the rad grid is defined in the page code, please advise how to get the radtooltip working with this set up... 
Value cannot be null. Parameter name: Cannot find a server control with ID=headerChkbox3. If you need to specify a client-side element ID, please set IsClientID to true.
<
telerik:RadGrid ID="TopicRadGrid" EnableAJAX="True" OnNeedDataSource="TopicRadGrid_NeedDataSource"  ShowHeader="true" ShowFooter="false" AllowMultiRowSelection="true"  runat="server" Width="400px">
                                                        <MasterTableView AutoGenerateColumns="False">
                                                            <Columns>
                                                                <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn3" HeaderStyle-Width="30px">
                                                                   <HeaderTemplate>
                                                                        <asp:CheckBox id="headerChkbox3"  Text="  Select All" OnCheckedChanged="ToggleTopicSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>
                                                                        <telerik:RadToolTip ID="RadToolTip2" runat="server"   TargetControlID="headerChkbox3" Width="250px"  RelativeTo="Element" Position="MiddleRight" EnableShadow="true" Text="Please select all the topics you want to subscribe">                                                                          
                                                                         </telerik:RadToolTip>
                                                                    </HeaderTemplate>                                            
                                                                    <ItemTemplate>
                                                                        <asp:CheckBox id="CheckBox3"  OnCheckedChanged="ToggleTopicRowSelection"  AutoPostBack="True" runat="server"></asp:CheckBox>
                                                                        <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="CheckBox3" Width="250px"  RelativeTo="Element" Position="MiddleRight" EnableShadow="true">
                                                                           <%# DataBinder.Eval(Container, "DataItem.Description") %>
                                                                         </telerik:RadToolTip>
                                                                         <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.topic") %>'>
                                                                         </asp:Label>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                            </Columns>
                                                        </MasterTableView>
                                                        <ClientSettings EnableRowHoverStyle="true" >                                                              
                                                        </ClientSettings>
                                                        </telerik:RadGrid>

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 20 Sep 2011, 03:21 PM
Hello Simba,

This code seems correct and is working as expected on my end: http://screencast.com/t/Mi9DnNMSokrh. You can also find my test page attached as a reference. The same concept is used in the following onilne demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx. Examine the right-hand side GridView (with ID DataGrid1). You can find the code for the demos under the LiveDemos folder in your local RadControls installation. Thus you can examine and modify it freely.

On a side note - I would advise that you set both Width and Height for the tooltip and also the other behavior properties like ShowEvent, and HideEvent.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Simba
Top achievements
Rank 1
answered on 20 Sep 2011, 03:45 PM
Thanks Martin : 
   One thing I did not mention below was, there is an update panel for the topic grid, and it is failing when checking the "Select All" check box saying it could not find that control i.e. =headerChkbox3 ...
Value cannot be null. Parameter name: Cannot find a server control with ID=headerChkbox3. If you need to specify a client-side element ID, please set IsClientID to true

I did not see the AJAX setting in your set up, please add that and enable AJAX and see if you get the same behavior as mine. 
0
Marin Bratanov
Telerik team
answered on 21 Sep 2011, 03:05 PM
Hi Simba,

I have placed the RadGrid in an update panel, yet I do not get such an error. I have attached the modified page and you can see a video from my test here: http://screencast.com/t/RS5S0BcQhwP.

Can you confirm the version of the controls you are using, as the RadGrid for ASP.NET AJAX does not have a property EnableAJAX. This property had been used in the Classic version of the controls that has been discontinued quite some time ago.

What I would advise is that you upgrade to the latest version (currently Q2 2011 SP1, version number 2011.2.915) and see if the issue persists.

It is also possible that the error is a result from some modifications you are making in the code-behind of the checkbox' checkchanged events, so I would advise that you debug it and see if you change the IDs or control collections somehow.


Regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Simba
Top achievements
Rank 1
answered on 21 Sep 2011, 04:21 PM
Thanks for the help, I managed to get it working now, it was a different bug not related to the tooltip.
Tags
Grid
Asked by
Simba
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Simba
Top achievements
Rank 1
Share this question
or