Tooltip vb code does not work

5 posts, 0 answers
  1. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 08 Jan 2009 Link to this post

    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!
  2. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 09 Jan 2009 Link to this post

    Is there a Telerik staffer that can answer this question?  I'd like to use the Tooltip feature.

    Thanks!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 12 Jan 2009 Link to this post

    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.
  5. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 13 Jan 2009 Link to this post

    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
  6. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 13 Jan 2009 Link to this post

    "...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?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017