473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASP.NET GridView UserControl

I want to make an ASP.NET user control with only a gridview on it.

My 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...

Jan 6 '06 #1
1 8581
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/is...0/CuttingEdge/

Remy Blaettler

Jan 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: onearth | last post by:
Hello I already managed to add a dynamic DetailView under a row of Gridview if a user presses the row with the mouse... Is it possible to add under it a table(or even better load a simple...
0
by: s.gregory | last post by:
My page layout is like this: Page >DataList (databound using ObjectDataSource1 contained in page) >>Items >>>UserControl >>>>GridView (databound using another ObjectDataSource2 contained in...
4
by: Alexander Widera | last post by:
Hi, I have the following source code: <%@ Register tagprefix="my" tagname="tcontrol" Src="article_small.ascx" %> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$...
7
by: OJ | last post by:
Hi, I have a WebUserCOntrol with a GridView and I am attempting to set the DataSource of the Gridview in the User control from the parent ASPX page. I have the following property in the user...
0
by: cheloman12 | last post by:
Hi, I’m implementing SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium in asp.net 2.0 to increment performance avoiding sending viewstate of pages to browser. The code I...
1
by: Giovanni | last post by:
Dear Friends/Gurus, I have exhausted myself and have yet no solution to the following: I have an ASP.NET 2.0 Survey type application. On a page, I have placed a GridView which is bound to an...
6
by: Kevin Attard | last post by:
I am using a GridView inside a UserControl which has a template column for deleting the rows. Before databinding the gridview i am attaching the RowCommand and RowDataBound event. I am using the...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
1
by: pichukakiran | last post by:
Hai, Here I am using a dropdownlist in a usercontrol.in that i am using some numbers like 5,10,15,20 like that. Coming to my aspx page.In that i am using a gridview and i added that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.