Get data directly from DataGrid

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

    Get data directly from DataGrid

    I'd like to retrieve items directly from a DataGrid rather than from the
    source (data table). The goal is to retrieve a field in the Datagrid's
    current sort order.

    Is there an easy way to do this?

  • _A

    #2
    2nd try: Get data directly from DataGrid

    I'd like to retrieve items directly from a DataGrid rather than from the
    source (data table). The goal is to retrieve a field in the Datagrid's
    current sort order.

    Is there an easy way to do this?

    Comment

    • Attila

      #3
      Re: 2nd try: Get data directly from DataGrid

      Are you binding a table view to the datagrid (in order to sort)? If so, then
      use the table view and iterate through it.

      "_A" <_A@nospam.co m> wrote in message
      news:dt1rh0hncs j62tc5t5laf9of0 j600tod7h@4ax.c om...[color=blue]
      > I'd like to retrieve items directly from a DataGrid rather than from the
      > source (data table). The goal is to retrieve a field in the Datagrid's
      > current sort order.
      >
      > Is there an easy way to do this?
      >[/color]


      Comment

      • Cor Ligthert

        #4
        Re: 2nd try: Get data directly from DataGrid

        > I'd like to retrieve items directly from a DataGrid rather than from the[color=blue]
        > source (data table). The goal is to retrieve a field in the Datagrid's
        > current sort order.
        >
        > Is there an easy way to do this?
        >[/color]
        With a webform datagrid: Yes
        With a windowform datagrid: No

        However when you use with the last the dataview and the currencymanager
        there is not any problem to get that, you are not the only one who is making
        programs using the windowforms datagrid you know.

        I hope this gives some idea's

        Cor


        Comment

        • William Ryan  eMVP

          #5
          Re: 2nd try: Get data directly from DataGrid

          If I understand you correctly then Sure. You can just reference the grid
          directly ie dataGrid1[0,2] would give you the value of the 0th row, second
          column. If you are trying to determine what's the sort column currently,
          you can bind to a DataView and access its .Sort property (conversely, you
          can set this too without making the users click on the header by specifying
          the sort field.

          --
          W.G. Ryan MVP Windows - Embedded

          Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
          Let Microsoft know!

          "_A" <_A@nospam.co m> wrote in message
          news:dt1rh0hncs j62tc5t5laf9of0 j600tod7h@4ax.c om...[color=blue]
          > I'd like to retrieve items directly from a DataGrid rather than from the
          > source (data table). The goal is to retrieve a field in the Datagrid's
          > current sort order.
          >
          > Is there an easy way to do this?
          >[/color]


          Comment

          Working...