What the Promethus Grid version of this?

4 posts, 0 answers
  1. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 01 Feb 2008 Link to this post


    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated  
            If (TypeOf e.Item Is GridEditItem) Then  
                Dim item As GridDataItem = CType(e.Item, GridEditItem)  
                Dim intUniqueID As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID")  
                Dim linkButton As LinkButton = CType(item("EditColumn").Controls(0), LinkButton)  
                Dim a As System.Web.UI.HtmlControls.HtmlAnchor = New HtmlAnchor  
                Dim js As StringString = String.Format("return ShowEditForm('{0}');", intUniqueID)  
                a.InnerHtml = linkButton.Text  
                a.Attributes("href") = ""  
                a.Attributes("onclick") = js  
                item("EditColumn").Controls.Remove(linkButton)  
                item("EditColumn").Controls.Add(a)  
            End If  
        End Sub 
    Hopefully a really simple question.  I am trying to implement the above in Prometheus Grid but it objects to the line 
    If (TypeOf e.Item Is GridEditItem) Then  
    saying e.item cannot be of type GridEditItem.

    What's the equivilant in Prometheus Grid?

    David Penny
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Feb 2008 Link to this post

    Hi David,

    I think this should be GridEditableItem - there is no GridEditItem class in both classic and "Prometheus" grid.

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 02 Feb 2008 Link to this post

    Thanks Vlad,

    I think I may have pasted the wrong bit of code in.  It shold have read:
    Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated  
     
    If (TypeOf e.Item Is GridDataItem) Then  
     
    Dim item As GridDataItem = CType(e.Item, GridDataItem)  
     
    Dim intUniqueID As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("UniqueID")  
     
    Dim linkButton As LinkButton = CType(item("EditColumn").Controls(0), LinkButton)  
     
    Dim a As System.Web.UI.HtmlControls.HtmlAnchor = New HtmlAnchor  
     
    Dim js As StringString = String.Format("return ShowEditForm('{0}');", intUniqueID)  
     
    a.InnerHtml = linkButton.Text  
     
    a.Attributes("href") = ""  
     
    a.Attributes("onclick") = js  
     
    item("EditColumn").Controls.Remove(linkButton)  
     
    item("EditColumn").Controls.Add(a)  
     
    End If  
     
    End Sub  
     

    This works for me in RadControls 2007 Q2 RadGrid.  When I try the same code using Rad Prometheus Q3 2008 I get the message that e.Item cannot be of type GridDataItem.

    I generally use RadWindow to edit RadGrid Items, which is where this code is used, and am trying to do the same with RadGrid Prometheus.

    David Penny

  5. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 03 Feb 2008 Link to this post

    Vlad,

    Just ignore me!

    I am so used to putting Imports Telerik.WebControls onto a page that I had both that and Imports telerik.Web.UI - obviously it does not like this...  All OK now.

    David Penny
Back to Top