Results 1 to 4 of 4

Thread: help w. DataGrid

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Question help w. DataGrid

    Hi,
    I have a DataGrid1 on my form, in which I load (using Adodc1) data from my database (Access .mdb). I want to make changes to these fields, after the user selects a row.

    If the user selects a row in the DataGrid, is there someway I can pass the data of each column (and a number) to textboxes, but keep the 'binding' with my database?

    I mean, I know that I can assign to each textbox1.Text the contents of column(1),...,textboxN.Text = column(N) , but what can I do, if the user saves changes to these fields? Do I need to track the row again with another Adodc?

    what would u suggest?

    (if needed, I can post u the code)

    thx

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: help w. DataGrid

    why not allow the user to edit right in the datagrid?

    otherwise.... yes.. track the row... watch the texboxes for changes...
    if a textbox has changed and the user changes the selection (Datagrid_Selchange event I think) then scrap the changes or prompt them to save first... etc etc..

    I found its easier to just allow edits in the grid
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: help w. DataGrid

    yes, but

    1.if I allow direct edits in the grid.. what happens with changes in different rows at the same time?
    Furthermore,
    2. How can I check if a row has been selected in the grid?
    3. How can I know which row has been selected?Can I keep the index somewhere?

  4. #4
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: help w. DataGrid

    if you

    set Datagrid1.DataSource = .... (a recordset)

    u wont have to worry about that? it acts the same way as a table does in access...

    _RowColChange event
    _SelChange event

    take a look at those...
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width