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

Tooltip vb code does not work

4 Answers 84 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
R2
Top achievements
Rank 1
R2 asked on 08 Jan 2009, 07:12 PM
Hi,

I am learning the RADGrid control. The following code of page 459 does not work:

imports Telerik.WebControls  
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As  
Telerik.WebControls.GridItemEventArgs)  
'Check for GridHeaderItem if you wish tooltips only for the header cells  
If TypeOf e.Item Is GridHeaderItem Then  
Dim headerItem As GridHeaderItem = TryCast(e.Item, GridHeaderItem)  
headerItem("CreditRating").ToolTip = "CreditRating" 
headerItem("PreferredVendorStatus").ToolTip = "PreferredVendorStatus" 
headerItem("ActiveFlag").ToolTip = "ActiveFlag" 
End If  
End Sub 
 First, there's a problem with the namespace.  There is a squiggly line under the namespace explained as follows:

"Namespace or type specified in the Imports 'Telerik,WebControls' doesn't contain any public member or cannot be found.  Make sure the namespace or the type is defined and contains at least one public memeber.  Make sure the imported element name doesn't use any aliases."

So I guess that means that 'WebControls' is not a member of Telerik?

Next, Type 'GridHeaderItem' is not defined.

I deleted the 'Telerik.WebControls' namespace and used the 'Telerik.Web.UI' namespace.  I revised the code to:

Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)  
        'Check for GridHeaderItem if you wish tooltips only for the header cells     
        If TypeOf e.Item Is GridHeaderItem Then  
            Dim headerItem As GridHeaderItem = TryCast(e.Item, GridHeaderItem)  
            headerItem("CreditRating").ToolTip = "CreditRating" 
            headerItem("PreferredVendorStatus").ToolTip = "PreferredVendorStatus" 
            headerItem("ActiveFlag").ToolTip = "ActiveFlag" 
        End If  
    End Sub 

The application ran, but I can not see the Tool tips.  Is there a correction written somewhere for this?

Thanks!

4 Answers, 1 is accepted

Sort by
0
R2
Top achievements
Rank 1
answered on 09 Jan 2009, 02:10 PM
Is there a Telerik staffer that can answer this question?  I'd like to use the Tooltip feature.

Thanks!
0
Sebastian
Telerik team
answered on 12 Jan 2009, 09:04 AM
Hi R2,

I suppose that you are referring to an old version of the RadControls for ASP.NET AJAX Courseware since the Telerik.WebControls namespace is registered instead of Telerik.Web.UI namespace. Here is a link to the page with the RadControls for ASP.NET AJAX resources that you can find useful:

http://www.telerik.com/products/aspnet-ajax/resources.aspx

Concerning the part with the missing tooltips:
Note that it depends on whether you enabled sorting for grid or not how to set the tooltips for the grid header cells. Review this topic from the product documentation for more details.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
R2
Top achievements
Rank 1
answered on 13 Jan 2009, 03:42 PM
Thank you, Sebastian for your response.

I downloaded the PDF step-by-step courseware on 12/8/08.  The last update Telerik states at the URL you list below is 11/14/08.  So unless your "last updated" date is incorrect, I have the current version.  If the Telerik team has updated the PDF since 12/08/08 and just didn't change the 11/14/08 date, then...

The Telerik.WebControls is still giving me the same result as listed below in my post.

"Concerning the part with the missing tooltips:
Note that it depends on whether you enabled sorting for grid or not how to set the tooltips for the grid header cells. "

If this step is listed in the lesson in the courseware, I must have missed it.  I will take a look at the sample link you provide.

Sincerely,
r2
0
R2
Top achievements
Rank 1
answered on 13 Jan 2009, 07:25 PM

"...Note that it depends on whether you enabled sorting for grid or not how to set the tooltips for the ..."

I selected Enable Sorting in the grid smart tag.  Still no tool tip for column headers.  The code on page 459:

imports Telerik.WebControls  
Protected Sub RadGrid1_ItemCreated(ByVal sender As ObjectByVal e As 
Telerik.WebControls.GridItemEventArgs)  
'Check for GridHeaderItem if you wish tooltips only for the header cells  
If TypeOf e.Item Is GridHeaderItem Then 
Dim headerItem As GridHeaderItem = TryCast(e.Item, GridHeaderItem)  
headerItem("CreditRating").ToolTip = "CreditRating" 
headerItem("PreferredVendorStatus").ToolTip = "PreferredVendorStatus" 
headerItem("ActiveFlag").ToolTip = "ActiveFlag" 
End If 
looks simple enough, with the exception of the namespace.  I assume that is what is causing the tooltip not to show?
Tags
Ajax
Asked by
R2
Top achievements
Rank 1
Answers by
R2
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or