473,385 Members | 1,736 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,385 software developers and data experts.

Custom control and internal control events

Hi,

I'm tryig to add a LinkButton with events to a custom control (custom
control : Datagrid)

My CreateChildControls is generating an error (Specified cast is not
valid.)

Here is my function:

protected override void CreateChildControls()

{
if(FirstLinkButton==null)

{

FirstLinkButton=new Button();

FirstLinkButton.Text="<<";

FirstLinkButton.CommandName="F*irst";

FirstLinkButton.ID="FirstLinkB*utton";

}

this.FirstLinkButton.Command+= new
CommandEventHandler(this.LinkB*utton_Command);

base.CreateChildControls();

System.Web.UI.HtmlControls.Htm*lTable
htmlTbl=new
System.Web.UI.HtmlControls.Htm*lTable();

System.Web.UI.HtmlControls.Htm*lTableRow
htmlRow=new
System.Web.UI.HtmlControls.Htm*lTableRow();

System.Web.UI.HtmlControls.Htm*lTableCell
htmlCell;

htmlCell=new
System.Web.UI.HtmlControls.Htm*lTableCell();

htmlCell.Controls.Add(FirstLin*kButton);

htmlRow.Controls.Add(htmlCell)*;

htmlTbl.Controls.Add(htmlRow);

this.Controls.Add(htmlTbl);

}

When I remove the function everything is fine. (No error)

What am I missing here?

Thank you,

Doron.

Sep 4 '05 #1
0 1114

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

Similar topics

4
by: Steve Amey | last post by:
Hi all I am creating a basic control to perform some tasks, and I want to declare some events to be raised so they can be handled from the form that the control is on. I can create my own Event...
10
by: Matt Fielder | last post by:
I have developed a custom control to be used in my application. My application includes a form designer, so the control can be hosted while designmode for the control is either true or false,...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
by: doron | last post by:
Hi, I'm tryig to add a LinkButton with events to a custom control (custom control : Datagrid) My CreateChildControls is generating an error (Specified cast is not valid.) Here is my...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
0
by: Joe | last post by:
Anyone have any experience using custom snaplines? I have a usercontrol that acts as a container for several child controls. I wrote an inherited ControlDesigner to handle some custom actions...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
1
by: a | last post by:
Hi I would like to add some additional custom features to the listview, like cell editing. The created object will be added to the form as part of the GUI, and it should be able to handle...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.