Trying to get subset of data in a grid

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

    Trying to get subset of data in a grid

    I am using VB.net Ent Arch 2003.

    I have a dataset that was made through the wizard to create a Windows Data
    Form

    I have a DataGrid to show/edit the table from my DataSet.

    I want to:

    Be able to choose the subset of data from the table and then have that
    presented in the grid while still using the same update and cancel routines
    that the wizard provided.

    I used to program in VB 3.0-6.0 and I am just having a little trouble
    getting my head around how the XML datasets work... Any links and / or
    examples of how to solve the above issue would be greatly appreciated.




  • Cor Ligthert

    #2
    Re: Trying to get subset of data in a grid

    Hi Atley,

    You only have to set a dataview between it, something as
    \\\
    dim dv as new dataview(mydata set.table)
    dv.sort = "MyItem"
    dv.rowfilter = "MyItem = 1"
    datagrid1.datas ource = dv
    ///
    And all is done, keep in mind that the dataview is only a view on the
    table, the rest stays all the same.

    I hope this helps?

    Cor


    Comment

    • Atley

      #3
      Re: Trying to get subset of data in a grid

      How do I set the Databinding of the Grid?

      grdapp_Budgeted _Hours.SetDataB inding(objdsHis toricalInput,
      "app_Budgeted_H ours")



      How does this line change?

      Thanks for the help!

      "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
      news:%23x9PETOQ EHA.644@tk2msft ngp13.phx.gbl.. .[color=blue]
      > Hi Atley,
      >
      > You only have to set a dataview between it, something as
      > \\\
      > dim dv as new dataview(mydata set.table)
      > dv.sort = "MyItem"
      > dv.rowfilter = "MyItem = 1"
      > datagrid1.datas ource = dv
      > ///
      > And all is done, keep in mind that the dataview is only a view on the
      > table, the rest stays all the same.
      >
      > I hope this helps?
      >
      > Cor
      >
      >[/color]


      Comment

      • Cor Ligthert

        #4
        Re: Trying to get subset of data in a grid

        Hi Atley,

        I do not know if there is more behind, however the normal databinding from a
        datagrid is with that datasource as I did show you, just try.

        grdapp_Bugeted_ Hours.Datasours e = objdsHistorical Input.app_Budge ted_Hours
        or
        grdapp_Bugeted_ Hours.Datasours e =
        objdsHistorical Input.tables("a pp_Budgeted_Hou rs")

        The last part I assume.

        And than remove that databinding.

        I hope this helps?

        Cor
        [color=blue]
        > How do I set the Databinding of the Grid?
        >
        > grdapp_Budgeted _Hours.SetDataB inding(objdsHis toricalInput,
        > "app_Budgeted_H ours")
        >
        >
        >
        > How does this line change?
        >
        > Thanks for the help!
        >
        > "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
        > news:%23x9PETOQ EHA.644@tk2msft ngp13.phx.gbl.. .[color=green]
        > > Hi Atley,
        > >
        > > You only have to set a dataview between it, something as
        > > \\\
        > > dim dv as new dataview(mydata set.table)
        > > dv.sort = "MyItem"
        > > dv.rowfilter = "MyItem = 1"
        > > datagrid1.datas ource = dv
        > > ///
        > > And all is done, keep in mind that the dataview is only a view on the
        > > table, the rest stays all the same.
        > >
        > > I hope this helps?
        > >
        > > Cor
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Atley

          #5
          Re: Trying to get subset of data in a grid

          Thanks Cor... this helps a lot!


          "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
          news:O5gARIPQEH A.3124@TK2MSFTN GP12.phx.gbl...[color=blue]
          > Hi Atley,
          >
          > I do not know if there is more behind, however the normal databinding from[/color]
          a[color=blue]
          > datagrid is with that datasource as I did show you, just try.
          >
          > grdapp_Bugeted_ Hours.Datasours e = objdsHistorical Input.app_Budge ted_Hours
          > or
          > grdapp_Bugeted_ Hours.Datasours e =
          > objdsHistorical Input.tables("a pp_Budgeted_Hou rs")
          >
          > The last part I assume.
          >
          > And than remove that databinding.
          >
          > I hope this helps?
          >
          > Cor
          >[color=green]
          > > How do I set the Databinding of the Grid?
          > >
          > > grdapp_Budgeted _Hours.SetDataB inding(objdsHis toricalInput,
          > > "app_Budgeted_H ours")
          > >
          > >
          > >
          > > How does this line change?
          > >
          > > Thanks for the help!
          > >
          > > "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
          > > news:%23x9PETOQ EHA.644@tk2msft ngp13.phx.gbl.. .[color=darkred]
          > > > Hi Atley,
          > > >
          > > > You only have to set a dataview between it, something as
          > > > \\\
          > > > dim dv as new dataview(mydata set.table)
          > > > dv.sort = "MyItem"
          > > > dv.rowfilter = "MyItem = 1"
          > > > datagrid1.datas ource = dv
          > > > ///
          > > > And all is done, keep in mind that the dataview is only a view on the
          > > > table, the rest stays all the same.
          > > >
          > > > I hope this helps?
          > > >
          > > > Cor
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...