Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

  Trying to get subset of data in a grid (Monday, December 13, 2004)




Found the following interesting discussion in the Newsgroups:

Trying to get subset of data in a grid
by:Atley

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.




 Reply:
by:Cor Ligthert

 Hi Atley,

You only have to set a dataview between it, something as
\\dim dv as new dataview(mydataset.table)
dv.sort = "MyItem"
dv.rowfilter = "MyItem = 1"
datagrid1.datasource = 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


 Reply:
by:Atley

 How do I set the Databinding of the Grid?

grdapp_Budgeted_Hours.SetDataBinding(objdsHistoricalInput,
"app_Budgeted_Hours")

How does this line change?

Thanks for the help!


 Reply:
by:Cor Ligthert

 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.Datasourse = objdsHistoricalInput.app_Budgeted_Hours
or
grdapp_Bugeted_Hours.Datasourse =
objdsHistoricalInput.tables("app_Budgeted_Hours")

The last part I assume.

And than remove that databinding.

I hope this helps?

Cor


 Reply:
by:Atley

 Thanks Cor... this helps a lot!








 
Previous Posts
    - Array problem
    - Create Folder Share In VB.NET Without Using WMI
    - Rich text column in datagrid
    - Exception properties
    - How to include a C# class in VB.net?
    - Datagrid events
    - Spam filter
    - Trying to use PrintForm method
    - Make a classname a variable
    - Database Selection Advice Please

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland