Find Objects Bound To DataTable?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred W.

    Find Objects Bound To DataTable?

    I wondering if there is a way to determine which objects are bound to my
    DataTable. I update my DataTable from a thread. My DataTable is bound to a
    DataGrid in my main UI. Apparently I will need to perform my table update on
    the UI Thread or the DataGrid has issues.

    Ideally I would like the DataTable to tell me who is bound to it and then
    check if that object implements ISynchronizeInv oke and use that to determine
    that I need to actually perform the updates on that objects thread.
    Otherwise, I will need to explicitely feed a reference of the GUI control to
    my thread updating the DataTable. Any thoughts are appreciated. Thanks

    -Fred


  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: Find Objects Bound To DataTable?

    Hi,



    "Fred W." <fredwemail-news@yahoo.com> wrote in message
    news:%23JWWwrUm GHA.4868@TK2MSF TNGP04.phx.gbl. ..[color=blue]
    >I wondering if there is a way to determine which objects are bound to my
    >DataTable.[/color]

    No, this is not possible.

    I update my DataTable from a thread. My DataTable is bound to a[color=blue]
    > DataGrid in my main UI. Apparently I will need to perform my table update
    > on the UI Thread or the DataGrid has issues.[/color]

    You could do the update in the thread, and use Control.Invoke to let the
    datagrid knows the datatable was changed.
    [color=blue]
    > I will need to explicitely feed a reference of the GUI control to my
    > thread updating the DataTable. Any thoughts are appreciated. Thanks[/color]

    I'm afraid that is what you will end doing.



    --
    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation


    Comment

    • Nicholas Paldino [.NET/C# MVP]

      #3
      Re: Find Objects Bound To DataTable?

      Instead of passing a reference to the thread, why not just pass an
      implementation of ISynchronizeInv oke? Either that, or have a thread-static
      member somewhere that the routine can check in the thread to determine if
      actions need to be invoked on another thread.

      You don't necessarily have to send an instance of a control in.


      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m

      "Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
      in message news:OMdJHqVmGH A.4512@TK2MSFTN GP04.phx.gbl...[color=blue]
      > Hi,
      >
      >
      >
      > "Fred W." <fredwemail-news@yahoo.com> wrote in message
      > news:%23JWWwrUm GHA.4868@TK2MSF TNGP04.phx.gbl. ..[color=green]
      >>I wondering if there is a way to determine which objects are bound to my
      >>DataTable.[/color]
      >
      > No, this is not possible.
      >
      > I update my DataTable from a thread. My DataTable is bound to a[color=green]
      >> DataGrid in my main UI. Apparently I will need to perform my table update
      >> on the UI Thread or the DataGrid has issues.[/color]
      >
      > You could do the update in the thread, and use Control.Invoke to let the
      > datagrid knows the datatable was changed.
      >[color=green]
      >> I will need to explicitely feed a reference of the GUI control to my
      >> thread updating the DataTable. Any thoughts are appreciated. Thanks[/color]
      >
      > I'm afraid that is what you will end doing.
      >
      >
      >
      > --
      > --
      > Ignacio Machin,
      > ignacio.machin AT dot.state.fl.us
      > Florida Department Of Transportation
      >[/color]


      Comment

      Working...