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

Extending GridDataItem

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 1
Gregory asked on 13 Jan 2011, 09:41 PM

Hello, I am migrating a control from GridView to RadGrid. With GridView, I was able to extend the GridViewRow class:

Public Class GridViewSearchRow
Inherits GridViewRow
          
    ReadOnly Property SearchValueEntry As ISearchValueEntry
        Get
            Return FirstChildControl(Of ISearchValueEntry)()
        End Get
    End Property
  
    Public Sub New(…)
        MyBase.New(…)
    End Sub
  
End Class

In its containing grid (an extension of GridView), I was able to instantiate my custom row by overriding GridView’s CreateRow function:

Protected Overrides Function CreateRow(…)As GridViewRow
  
    If rowType = DataControlRowType.DataRow Then
        Return New GridViewSearchRow(…)
    Else
        Return MyBase.CreateRow(…)
    End If
  
End Function


In Telerik, I am able to extend the GridDataItem class:

Public Class RadSearchRow
Inherits GridDataItem
  
    ReadOnly Property SearchValueEntry As ISearchValueEntry 
        Get
            Return FirstChildControl(Of ISearchValueEntry)()
        End Get
    End Property
  
    Public Sub New(…)
        MyBase.New(…)
    End Sub
  
End Class

 

 

Is there a similar way to ensure that all objects in the .Items() collection are added as RadSearchRow? I’ve noticed that the RadGrid’s GridDataItems are created within the CreateChildControl() sub, but since CreateChildControl() isn’t a function (like GridView’s CreateRow) I’m not sure how to mimic it.

Thank you very much.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 18 Jan 2011, 03:52 PM
Hello Gregory,

Unfortunately the RadGrid control does not provide such an option. Possible solution could be to inherit the RadGrid control and the new Grid to use your GridDataItems however this is not a supported scenario and we could not guarantee if this will covers your requirements.


Greetings,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Gregory
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or