cast selected value to this.owner... this is a tough one...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I can't get this to work.

I have a CustomerForm which display data from several tables in datagridviews.

In another form (opened from CustomerForm), called NewCallForm, i have a
listview with data (same data as for the CustomerForm). When i click in this
listview i want to reposition to the selected value in the datagrid on the
CustomerForm (underlaying form).

How can that be done.
1. First i need to cast the selected value back to the customer form
(underlaying form).
2. Then i need to reposition to the selected value in the datagrid .

Can someone help me. I don't know where to start....

lars E
 
Lars said:
Hi

I can't get this to work.

I have a CustomerForm which display data from several tables in datagridviews.

In another form (opened from CustomerForm), called NewCallForm, i have a
listview with data (same data as for the CustomerForm). When i click in this
listview i want to reposition to the selected value in the datagrid on the
CustomerForm (underlaying form).

How can that be done.
1. First i need to cast the selected value back to the customer form
(underlaying form).
2. Then i need to reposition to the selected value in the datagrid .

Can someone help me. I don't know where to start....

Define an event in NewCallForm that has the customer value as its
argument - call it say CustomerSelected.

When CustomerForm opens a NewCallForm, it subscribes to that
NewCallForm's CustomerSelected event.

When a customer is clicked in NewCallForm, it raises a CustomerSelected
event with the selected customer as argument.

When CustomerForm is notified of a CustomerSelected event, it
repositions its data display to the customer specified in the event's
argument.
 
OK Thanks.

So far i got: (in NewCallForm)

private void ActivitySelected(string actno)
{
if (actno != "<New activity>")
{

}
}

private void lvActivities_MouseUp(object sender, MouseEventArgs e)
{
ActivitySelected(lvActivities.SelectedItems[0].Text.ToString());
}



Now what? Do i have to cast this value in ActivitySelected back to the
CustomerForm ?


Lars
 
Back
Top