Home All Groups Group Topic Archive Search About

Add text from listbox into datagrid column

Author
23 Mar 2005 3:42 AM
Melson
Hi

Can anyone help me. I've a datagrid with 3 columns which are employeeID,
name and age in form1. I've another form, form2 which list the employeeID in
the listbox. I would like the employeeID in the listbox(form2) insert into
the employeID in the datagrid when I choose the employeeID from the listbox
in form2.

Can anyone help. Thanks.

Regards
Melson

Author
23 Mar 2005 1:56 PM
Elton Wang
Hi Melson,

Is your form Webform (mostly we use webpage) or Winform?

Elton Wang
elton_w***@hotmail.com

>-----Original Message-----
>Hi
>
>Can anyone help me. I've a datagrid with 3 columns which
are employeeID,
>name and age in form1. I've another form, form2 which
list the employeeID in
>the listbox. I would like the employeeID in the listbox
(form2) insert into
>the employeID in the datagrid when I choose the
employeeID from the listbox
Show quoteHide quote
>in form2.
>
>Can anyone help. Thanks.
>
>Regards
>Melson
>
>
>.
>
Author
24 Mar 2005 5:28 AM
Melson
Hi Elton

Its Winform.I'm creating windows application. Pls help. Thanks.

Regards
Melson


Show quoteHide quote
"Elton Wang" <anonym***@discussions.microsoft.com> wrote in message
news:052901c52fb0$14a0cfc0$a401280a@phx.gbl...
> Hi Melson,
>
> Is your form Webform (mostly we use webpage) or Winform?
>
> Elton Wang
> elton_w***@hotmail.com
>
>>-----Original Message-----
>>Hi
>>
>>Can anyone help me. I've a datagrid with 3 columns which
> are employeeID,
>>name and age in form1. I've another form, form2 which
> list the employeeID in
>>the listbox. I would like the employeeID in the listbox
> (form2) insert into
>>the employeID in the datagrid when I choose the
> employeeID from the listbox
>>in form2.
>>
>>Can anyone help. Thanks.
>>
>>Regards
>>Melson
>>
>>
>>.
>>
Author
24 Mar 2005 6:51 PM
Elton Wang
Hi Melson,

First of all, you should have reference of form1 in form2.
You can pass form1 to form2 either by constructor or by a
write only public property.

Then secondly, you can create a public method, e.g.
SetEmployeeToDataGrid, in form1 that receives a parameter,
employeID, and inserts the employeID, with name and age,
into the datagrid (maybe from underlying datasource).

Thirdly, in form2's listbox selectedIndexChanged event,
you can call the method SetEmployeeToDataGrid and pass
listbox.Text as parameter.

HTH. If you still have questions, please let us know. 

Elton Wang


>-----Original Message-----
>Hi
>
>Can anyone help me. I've a datagrid with 3 columns which
are employeeID,
>name and age in form1. I've another form, form2 which
list the employeeID in
>the listbox. I would like the employeeID in the listbox
(form2) insert into
>the employeID in the datagrid when I choose the
employeeID from the listbox
Show quoteHide quote
>in form2.
>
>Can anyone help. Thanks.
>
>Regards
>Melson
>
>
>.
>
Author
29 Mar 2005 10:16 AM
Melson
Hi Elton

I'm really appreciate your help. The hardest part is how to insert the
employeeID(with name and age) into the datagrid in Step 2. If you could show
me the code for Step 2, I can do the rest of the job. I'm new to vb.net, can
you help please. Thanks.

Regards
Melson

Show quoteHide quote
"Elton Wang" <anonym***@discussions.microsoft.com> wrote in message
news:033601c530a2$85d6cfd0$a501280a@phx.gbl...
> Hi Melson,
>
> First of all, you should have reference of form1 in form2.
> You can pass form1 to form2 either by constructor or by a
> write only public property.
>
> Then secondly, you can create a public method, e.g.
> SetEmployeeToDataGrid, in form1 that receives a parameter,
> employeID, and inserts the employeID, with name and age,
> into the datagrid (maybe from underlying datasource).
>
> Thirdly, in form2's listbox selectedIndexChanged event,
> you can call the method SetEmployeeToDataGrid and pass
> listbox.Text as parameter.
>
> HTH. If you still have questions, please let us know.
>
> Elton Wang
>
>
>>-----Original Message-----
>>Hi
>>
>>Can anyone help me. I've a datagrid with 3 columns which
> are employeeID,
>>name and age in form1. I've another form, form2 which
> list the employeeID in
>>the listbox. I would like the employeeID in the listbox
> (form2) insert into
>>the employeID in the datagrid when I choose the
> employeeID from the listbox
>>in form2.
>>
>>Can anyone help. Thanks.
>>
>>Regards
>>Melson
>>
>>
>>.
>>