TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sasikumar
NA
15
0
How to subscribe an event from UserControl with Additional parameters?
Nov 11 2011 6:03 AM
Hi,
I've a form frmMain.cs, in which I've added a UserControl ucTest.cs. In the usercontrol, I've added a button click event, in which I'm populating a DataSet ds.
Now I need this dataset to be used on the frmMain.cs for manipulation. How do I pass the dataset ds which was updated in the click event of UserControl back to the frmMain.cs ?
I tried declare a delegate (i'm totally new to delegates) in the UserControl for this, as below --
public delegate Boolean EventHandler(object sender, EventArgs args, DataSet ds);
public event EventHandler evntExecute = delegate {};
In the frmMain.cs, I've added a EventHandler function as below --
public Boolean evntExecute_Handler(object sender, EventArgs e, DataSet ds)
{
//
code
using the Dataset ds values
}
Now how do I exactly subscribe this event in the frmMain.cs ?
Thanks.
Reply
Answers (
3
)
Displaying table name in the combobox
Finding CustomerID and Inserting Multiple Rows