469,293 Members | 1,319 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,293 developers. It's quick & easy.

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 1089

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Nicolas Mejia | last post: by
reply views Thread by Pedro | last post: by
22 posts views Thread by Drum2001 | last post: by
1 post views Thread by Avi G | last post: by
8 posts views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.