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

Scripts in PDF courseware not working correctly...?

2 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
R2
Top achievements
Rank 1
R2 asked on 09 Jan 2009, 03:58 PM

Hi,

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

    [T-SQL]     
    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)     
            Else     
                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,
r2

2 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 12 Jan 2009, 11:46 AM
Hi R2,

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

http://www.telerik.com/community/forums/aspnet-ajax/ajax/tooltip-vb-code-does-not-work.aspx
http://www.telerik.com/community/forums/aspnet-ajax/tooltip/tool-tip-not-displaying-in-radgrid-gridheaderitem.aspx

http://www.telerik.com/community/forums/aspnet/grid/drag-and-drop-rows-in-radgrid.aspx

http://www.telerik.com/community/forums/aspnet/grid/unable-to-delete-record-in-grid.aspx

http://www.telerik.com/community/forums/aspnet-ajax/documentation/self-paced-learning.aspx

and change the following code line:

If e.Exception <> Nothing Then 

to

If Not e.Exception Is Nothing Then 

To see whether this helps.

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, 10:33 PM
Thank you, Sebastian, for your replies.  I will try using the revised code you list and let you know what happens.

Sincerely,
R2
Tags
Grid
Asked by
R2
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
R2
Top achievements
Rank 1
Share this question
or