|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASP.NET GridView UserControlMy usercontrol must behave the same as a normal gridview, with some extra properties and methods (for security purposes, such as: invisible, readonly etc..) I can not inherit the gridview from webcontrols.gridview because this causes an error. (Compile error: "property 'SupportAutoEvents' cannot be declared 'Overrides' because it does not override a property in a base class"), so I made my own properties and methods. I can bind data to myGridView and this works fine, but when I want to customize the columns (at run-time). Such as headertext, first column invisible etc... This is the property for the columns: Property Columns(ByVal index As Integer) As System.Web.UI.WebControls.DataControlField Get Return GridView1.Columns(index) End Get Set(ByVal value As System.Web.UI.WebControls.DataControlField) GridView1.Columns(index).Visible = value.Visible End Set End Property This doesn't work, can anyone tell me why? How can I setup usercontrols with only 1 control and inherit all properties, methods and events from this 'base' control, so I only have to add my own properties? This because I also have to make usercontrols of textbox, buttons etc... Thanx in advance... Below is an example of someone that developed his own datagrid based on
the .net datagrid. That should give you some hints on how to do this. http://msdn.microsoft.com/msdnmag/issues/03/10/CuttingEdge/ Remy Blaettler |
|||||||||||||||||||||||