473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Displaying only certain results in a DataGrid

Hi all, Iv got a slight problem with a datagrid and the ability to only
display certain things in it.

I have a Data grid which is connected to a data table.

The data table is connected to a data set which in turn gets its info from
an xml file and xml schema.

I am able to view all results in the data grid and modify them and then save
them back to the xml file.

However I want to be able to only display certain results in the data grid
(e.g. those that only match a certain ID).

I am aware that you can run a query on the Data table and then use that to
populate the data grid. However if I did this any changes that were made on
the datagrid would not be made back to the data table (I assume).

Is there any way I can still keep the link between the datagrid and the data
table and only display certain rows that match a certain ID while still
allowing the user to edit these results?

Many thanks for reading this and for any help that can go with it.

Scott.
Nov 17 '05 #1
2 1628
Scott,

This should be easy. Basically, you can filter the DataTable using a
DataView. Once you do that, bind it to the grid, and only the filtered
results will be shown. Additionally, when you make changes, it will be
persisted back to the data table, at which point, you can save it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"scott" <sc***********@hotmail.com> wrote in message
news:dj**********@news7.svr.pol.co.uk...
Hi all, Iv got a slight problem with a datagrid and the ability to only
display certain things in it.

I have a Data grid which is connected to a data table.

The data table is connected to a data set which in turn gets its info from
an xml file and xml schema.

I am able to view all results in the data grid and modify them and then
save
them back to the xml file.

However I want to be able to only display certain results in the data grid
(e.g. those that only match a certain ID).

I am aware that you can run a query on the Data table and then use that to
populate the data grid. However if I did this any changes that were made
on
the datagrid would not be made back to the data table (I assume).

Is there any way I can still keep the link between the datagrid and the
data
table and only display certain rows that match a certain ID while still
allowing the user to edit these results?

Many thanks for reading this and for any help that can go with it.

Scott.

Nov 17 '05 #2
Thank you for the quick reply, I will look into these data views.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eA****************@TK2MSFTNGP12.phx.gbl...
Scott,

This should be easy. Basically, you can filter the DataTable using a
DataView. Once you do that, bind it to the grid, and only the filtered
results will be shown. Additionally, when you make changes, it will be
persisted back to the data table, at which point, you can save it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"scott" <sc***********@hotmail.com> wrote in message
news:dj**********@news7.svr.pol.co.uk...
Hi all, Iv got a slight problem with a datagrid and the ability to only
display certain things in it.

I have a Data grid which is connected to a data table.

The data table is connected to a data set which in turn gets its info from an xml file and xml schema.

I am able to view all results in the data grid and modify them and then
save
them back to the xml file.

However I want to be able to only display certain results in the data grid (e.g. those that only match a certain ID).

I am aware that you can run a query on the Data table and then use that to populate the data grid. However if I did this any changes that were made on
the datagrid would not be made back to the data table (I assume).

Is there any way I can still keep the link between the datagrid and the
data
table and only display certain rows that match a certain ID while still
allowing the user to edit these results?

Many thanks for reading this and for any help that can go with it.

Scott.


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt K. | last post by:
Hi there, I have a form in an Access project that contains a subform which displays the results of a query of the style "select * from where = #a certain date#". In the main part of the form...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
4
by: Tim T | last post by:
Hi, I have a stored procedure executing a search and an asp.net page displaying the results in a datagrid. The datagrid has paging on it, I am using Visual Studio.NET and can't see any option...
4
by: Jon | last post by:
Hi, suspect there might not be a good answer to this one. Using vb.net I have a page like this some text datagrid repeater Now the repeater is populated from a simple query that takes no time...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.