473,387 Members | 3,684 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,387 software developers and data experts.

adding button to custom control, and its even'ts do not fire every time.

hello,
I have this custom datagrid control, that inherits from DataGrid.
In addition to datagrid, I am adding a "status" table under it, and
another html button, which will trigger a new row.

My problem is that the events associated with the custom button do not
trigger every time.

I am adding my button as private global control inside of override
CreateChildControls(), and than calling _myButton.Render( writer )
inside of override Render( ... ) event.

Here is my code for the button:

_addnewbutton = new Button();
_addnewbutton.Text = "Add New";
_addnewbutton.CssClass = _customGridInputButton;
_addnewbutton.CausesValidation = this.CausesValidation;
_addnewbutton.Click += new EventHandler(_addnewbutton_Click);

note the CausesValidation, and _addnewbutton_Click are not
honored/triggered on first postback, but are working on each
consecutive postback after that :(

I am calling EnsureChildcontrols() inside of override Controls get; and
also tried ensuring it OnLoad event.

Nov 19 '05 #1
0 1231

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

Similar topics

5
by: Nicolas Mejia | last post by:
Hello: I´m not a professional programer in Access. I´m working in a proyect that will permit me add my flight time, but I have been having problems with the time adding. Please can some one...
0
by: Pedro | last post by:
Hello, I'm having a problem with the Media Player control. Sometimes, when I use the value from currentPositionString property of the Media PLayer Control I get a different value from the one...
22
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am...
1
by: Avi G | last post by:
Hi, how i can set that the timer will press the button every X time automatically on my form with VS 2005, what is the code for that? Thanks
7
by: imhiya | last post by:
Heres what ive got so far 0.o im more of a beginner Though =[ Dim Tim As Integer Dim Often As Integer Dim EndT As Integer Private Sub cmdStart_Click() Do 'Loop If Tim = Often Then ...
10
by: dbruzzese84 | last post by:
I have been trying to work on this project but stumble across a few mistakes. Basically, I have a search form with 2 listboxes. When the user chooses both options and presses search, a table shows...
8
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi just wondering if anyone had any ideas on how to do this in C#. I am trying to get the total time of several start and stop time data entries. For example the input data looks like starttime...
2
by: Syoam4ka | last post by:
Hi , Im trying to change the button backcolor every second somhow for example from blue to red and after a second red to blue and so on... can somebody please help? (Im using asp. net and the...
3
by: Syoam4ka | last post by:
Hi, I want to change the backcolor of my button every second ,for example red, after a second blue, after a second re, then blue and so on...i need it in a web form not in a windows form(in winform...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.