|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add text from listbox into datagrid columnHi
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 Hi Melson,
Is your form Webform (mostly we use webpage) or Winform? Elton Wang elton_w***@hotmail.com >-----Original Message----- list the employeeID in >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 >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 > > >. > 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 >> >> >>. >> 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----- list the employeeID in >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 >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 > > >. > 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 >> >> >>. >>
UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
iterate through only one column of a datagrid Compact code Access individual item in a datagrid Add row to datagrid? Datagrid sorting does not work Can't get text value of hidden (visible = false) column.. Help Check Parent-child relationship in datagrid EditItemTemplae and Postback |
|||||||||||||||||||||||