Add text from listbox into datagrid column

Discussion in 'ASP .Net Datagrid Control' started by Melson, Mar 23, 2005.

  1. Melson

    Melson Guest

    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
    Melson, Mar 23, 2005
    #1
    1. Advertising

  2. Melson

    Elton Wang Guest

    Hi Melson,

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

    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
    >
    >
    >.
    >
    Elton Wang, Mar 23, 2005
    #2
    1. Advertising

  3. Melson

    Melson Guest

    Hi Elton

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

    Regards
    Melson


    "Elton Wang" <> wrote in message
    news:052901c52fb0$14a0cfc0$...
    > Hi Melson,
    >
    > Is your form Webform (mostly we use webpage) or Winform?
    >
    > 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
    >>
    >>
    >>.
    >>
    Melson, Mar 24, 2005
    #3
  4. Melson

    Elton Wang Guest

    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
    >
    >
    >.
    >
    Elton Wang, Mar 24, 2005
    #4
  5. Melson

    Melson Guest

    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

    "Elton Wang" <> wrote in message
    news:033601c530a2$85d6cfd0$...
    > 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
    >>
    >>
    >>.
    >>
    Melson, Mar 29, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    394
    Natty Gur
    Nov 11, 2003
  2. SSW
    Replies:
    0
    Views:
    816
  3. Hai Nguyen
    Replies:
    0
    Views:
    393
    Hai Nguyen
    Jan 16, 2004
  4. Replies:
    6
    Views:
    585
    Hendrik van Rooyen
    May 31, 2007
  5. mc
    Replies:
    0
    Views:
    222
Loading...

Share This Page