render failed on inherited DataGrid
I want to derive a class from DataGrid so that I can have
a label on the top.
But when I tried to add the control to my form, I got an
error "Specified cast is not valid" on the line:
MyBase.Render(w) in the Render function.
Thanks a lot.
Here is my simple code.
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim g As New Grid2
Public Class Grid2
Dim _label1 As New Label
Protected Overrides Sub OnInit(ByVal e As EventArgs)
Public ReadOnly Property Label1() As Label
Protected Overrides Sub Render(ByVal w As
Re: render failed on inherited DataGrid
In a similar situation a while back I ended up creating a User-Control
containing the grid and the other controls. I exposed the Grid itself as a
public property of the UserControl
|All times are GMT. The time now is 07:30 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.