Click here to Skip to main content
15,922,584 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Change the connectionstring Pin
Ger Hayden3-Feb-11 0:24
Ger Hayden3-Feb-11 0:24 
QuestionWindows service OnBeforeInstall method throwing exception Pin
indian14321-Jan-11 11:21
indian14321-Jan-11 11:21 
AnswerRe: Windows service OnBeforeInstall method throwing exception Pin
Ravi Sant6-Feb-11 23:54
Ravi Sant6-Feb-11 23:54 
QuestionHow to end CPU Processes Pin
Mahmood Rasuli21-Jan-11 10:22
Mahmood Rasuli21-Jan-11 10:22 
AnswerRe: How to end CPU Processes Pin
Dave Kreskowiak21-Jan-11 10:31
mveDave Kreskowiak21-Jan-11 10:31 
AnswerRe: How to end CPU Processes Pin
gogosai7-Mar-11 13:26
gogosai7-Mar-11 13:26 
QuestionQuestion about webbrowser.navigate Pin
neodeaths18-Jan-11 18:19
neodeaths18-Jan-11 18:19 
QuestionProblem in accessing an event of a user control from another in Win Forms Pin
Member 46280816-Jan-11 20:22
Member 46280816-Jan-11 20:22 
Hi Guys,

I am having an issue with the Windows User Contol communication. I am creating a winform application. I have a tree view in the page (UC1). I am populating data to that from DB. on the leaf node select, i have to call an even in a Grid (User Control2) which will populate the data depending on the selection of the treenode text. Here the Tree & Grid are usercontrols. I have tried to use events for doing the same. But there are issue, If any one can help me, i will be thankful to them

Hi Guys,

Thanks for your response. This is what i am trying to do.

GridUser Control.cs

public partial class LogGridViewUserControl : UserControl
{
public delegate void Data_Bind(object sender, LogGridEventArgs e);
public event Data_Bind dataBindHandler;

public LogGridViewUserControl()
{
InitializeComponent();
}

public void OnDataBind(Object sender, LogGridEventArgs e)
{
if (dataBindHandler != null)
{
string str = CallBusiness(e.Connection);
}
}
}

public class LogGridEventArgs
{
public string Connection { get; set; }

public LogGridEventArgs(string connection)
{
Connection = connection;
}
}

TreeUserControl.cs

public partial class TestTreeControl : UserControl
{

public TestTreeControl()
{
InitializeComponent();

// BuilTree()
}
private void trvTest_NodeSelect(object sender, TreeViewEventArgs e)
{
if (e.Node.Nodes.Count == 0)
{

I need to call the OnDataBind event in the Grid to populate the data in the Grid
}

}
}

In the main form, i will add the both user controls. How do i call the OnDataBind evnthandler of the GridView when a node selection is changed in the treeview. I am not an expert in the Winform development/ not so good with delegates. If any one can chip in, it will be of great help to me.

Thanks

Tutu
AnswerRe: Problem in accessing an event of a user control from another in Win Forms Pin
RobCroll16-Jan-11 23:24
RobCroll16-Jan-11 23:24 
QuestionPlay mp3 file in winforms Pin
polycom12327-Dec-10 21:33
polycom12327-Dec-10 21:33 
AnswerRe: Play mp3 file in winforms Pin
Abhinav S27-Dec-10 21:51
Abhinav S27-Dec-10 21:51 
GeneralRe: Play mp3 file in winforms Pin
polycom12329-Dec-10 2:00
polycom12329-Dec-10 2:00 
QuestionHow to show excel inside a window form? Pin
neodeaths15-Dec-10 17:58
neodeaths15-Dec-10 17:58 
AnswerRe: How to show excel inside a window form? Pin
Prerak Patel16-Dec-10 3:04
professionalPrerak Patel16-Dec-10 3:04 
GeneralRe: How to show excel inside a window form? Pin
RaviRanjanKr17-Dec-10 18:14
professionalRaviRanjanKr17-Dec-10 18:14 
AnswerRe: How to show excel inside a window form? Pin
Eddy Vluggen16-Dec-10 4:53
professionalEddy Vluggen16-Dec-10 4:53 
QuestionProgramming of interactive desktop background Pin
hansdam9-Dec-10 7:58
hansdam9-Dec-10 7:58 
AnswerRe: Programming of interactive desktop background Pin
Eddy Vluggen9-Dec-10 9:11
professionalEddy Vluggen9-Dec-10 9:11 
QuestionReading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) [modified] Pin
Ger Hayden8-Dec-10 9:50
Ger Hayden8-Dec-10 9:50 
AnswerRe: Reading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) Pin
DJ Matthews8-Dec-10 9:58
DJ Matthews8-Dec-10 9:58 
GeneralRe: Reading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) Pin
Ger Hayden8-Dec-10 17:51
Ger Hayden8-Dec-10 17:51 
GeneralRe: Reading from Comboboxes on a datagrid view (C++/CLI - Windows Forms App in VS2008) Pin
Richard MacCutchan8-Dec-10 23:41
mveRichard MacCutchan8-Dec-10 23:41 
QuestionHow can I have multiple datasources in the same datagridview combo column [modified] Pin
Ger Hayden29-Nov-10 18:16
Ger Hayden29-Nov-10 18:16 
AnswerRe: How can I have multiple datasources in the same datagridview combo column Pin
RobCroll4-Dec-10 16:09
RobCroll4-Dec-10 16:09 
GeneralRe: How can I have multiple datasources in the same datagridview combo column Pin
Ger Hayden8-Dec-10 17:53
Ger Hayden8-Dec-10 17:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.