Scripts in PDF courseware not working correctly...?

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

    Posted 09 Jan 2009 Link to this post


    I posted several threads in various Telerik AJAX forums and have not had replies to all.  I will try posting here since I'm using the courseware and encountering problems doing the lessons.  

    1. Unable to see the Tool tips in the column header of the RadGrid
      PDF pg 459

          Protected Sub RadGrid1_ItemCreated(ByVal sender As ObjectByVal 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 
    2. Unable to drag and drop rows within a RadGrid
      PDF pg. 475

          Protected Sub RadGrid1_RowDrop(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridDragDropEventArgs)     
              Dim item As GridDataItem = TryCast(e.DraggedItems(0), GridDataItem)     
              RadAjaxManager1.Alert("Dropped VendorID: " + item.GetDataKeyValue("VendorID"))     
          End Sub 
    3. Unable to delete records in a RadGrid
      PDF pg. 472

      DELETE FROM Purchasing.[Vendor] WHERE [VendorID] = @VendorID   

      Javascript error:

      Line: 7  
      Char: 62099  
      Error: Sys.WebForms.PageReuestManagerServerErrorException: The transaction ended in the trigger.  The batch has been aborted.  Vendors cannot be deleted.  They can only be marked as not active  
    4. Item insert code not working
      PDF pg. 477

          Protected Sub RadGrid1_ItemInserted(ByVal source As ObjectByVal e As GridInsertedEventArgs)     
              If e.Exception <> Nothing Then     
                  e.ExceptionHandled = True    
                  e.KeepInInsertMode = True    
                  DisplayMessage("Product cannot be inserted. Reason: " + e.Exception.Message)     
                  DisplayMessage("Product inserted")     
              End If     
          End Sub  


    The compilation error I get using the code in #4 is:
    Compiler Error Message: BC30452: Operator '<>' is not defined for types 'System.Exception' and 'System.Exception'.

    Also, within the code, there are squiggly lines under "DisplayMessage".  The caption is "Name 'DisplayMessage' is not declared".  I understand how to declare a variable, but what should I declare it as?

    Thanks very much for all help,

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 12 Jan 2009 Link to this post

    Hi R2,

    Review the replies in the separate forum threads you opened with regards to this subject:

    and change the following code line:

    If e.Exception <> Nothing Then 


    If Not e.Exception Is Nothing Then 

    To see whether this helps.

    Best regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 13 Jan 2009 Link to this post

    Thank you, Sebastian, for your replies.  I will try using the revised code you list and let you know what happens.

Back to Top