473,394 Members | 1,806 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,394 software developers and data experts.

Getting a handle on filtered rows in DataGrid

I have a DataGrid sourced by a DataView of a DataTable, and I would like to
output the results of any RowFilter operations to a text file. I thought this
would be easy but I cannot find where to obtain all the filtered rows? If I
reference the tables rows I get every single record, and the DataView object
does not seem to have anything like a Rows property...
Nov 16 '05 #1
6 2275
MrNobody,

The indexer for the DataView will give you the DataRowView instances
that correspond to the rows that are filtered on. I believe you can cycle
through the DataView with a foreach statement to get the filtered rows.

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

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
I have a DataGrid sourced by a DataView of a DataTable, and I would like to
output the results of any RowFilter operations to a text file. I thought
this
would be easy but I cannot find where to obtain all the filtered rows? If
I
reference the tables rows I get every single record, and the DataView
object
does not seem to have anything like a Rows property...

Nov 16 '05 #2
MrNobody,

The indexer for the DataView will give you the DataRowView instances
that correspond to the rows that are filtered on. I believe you can cycle
through the DataView with a foreach statement to get the filtered rows.

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

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
I have a DataGrid sourced by a DataView of a DataTable, and I would like to
output the results of any RowFilter operations to a text file. I thought
this
would be easy but I cannot find where to obtain all the filtered rows? If
I
reference the tables rows I get every single record, and the DataView
object
does not seem to have anything like a Rows property...

Nov 16 '05 #3

Ah! Silly me- totally overlooked that- thanks!

Now if I wanted to know what columns are visible, I'd have to iterate
through the DataGridColumnStyles right? Can't do that through this
DataRowView or the DataView itself?
Nov 16 '05 #4

Ah! Silly me- totally overlooked that- thanks!

Now if I wanted to know what columns are visible, I'd have to iterate
through the DataGridColumnStyles right? Can't do that through this
DataRowView or the DataView itself?
Nov 16 '05 #5
MrNobody,

You are right. There is no link between the DataView/DataTable and the
presentation, it just contains the data (thank God).

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

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...

Ah! Silly me- totally overlooked that- thanks!

Now if I wanted to know what columns are visible, I'd have to iterate
through the DataGridColumnStyles right? Can't do that through this
DataRowView or the DataView itself?

Nov 16 '05 #6
MrNobody,

You are right. There is no link between the DataView/DataTable and the
presentation, it just contains the data (thank God).

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

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...

Ah! Silly me- totally overlooked that- thanks!

Now if I wanted to know what columns are visible, I'd have to iterate
through the DataGridColumnStyles right? Can't do that through this
DataRowView or the DataView itself?

Nov 16 '05 #7

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

Similar topics

3
by: Mario Vargas | last post by:
Hi, I have a datagrid which has many pages (10 rows per page) and when I loop through the rows, I only get 10 rows (the rows that are currently showed in the current page) How can I get the...
2
by: Randy | last post by:
Hello All, I'm trying to discover the best way to handle the situation where you have a datagrid in your app and someone changes a cell but doesn't leave that cell (so there's the little pencil...
0
by: MrNobody | last post by:
I have a DataGrid sourced by a DataView of a DataTable, and I would like to output the results of any RowFilter operations to a text file. I thought this would be easy but I cannot find where to...
3
by: Sharon | last post by:
I’m using a DataGrid control on my form; and I want to handle the KeyUp event. So I did: myDataGrid.KeyUp += new KeyEventHandler(this.OnKeyUp); When the DataGrid is empty, I mean when It has...
1
by: Tim | last post by:
Hi I am implementing some printing in C# and I need to get the data for it. I am using a datagrid. I can sort the data and filter it. I want to get a datatable of only the data visible in the...
7
by: Ken | last post by:
Hi All - I have a filtered GridView. This GridView has a check box in the first column. This check box is used to identify specific rows for delete operations. On the button click event I...
7
by: Brett Romero | last post by:
I've created a custom datagrid and would like to get only entries displaying in the grid. The datasource may be a table or dataview. So I check for this in the custom datagrid class: if...
4
by: dallasfreeman | last post by:
I'm looking at a quick way to get results that are displayed as rows to display as columns. I have three tables:- - The Questions for the survey - The Results of the survey (Columns are listed...
1
by: s26f84 | last post by:
Hey Guys Alot of articles and alot of stuff still no answer. Please help me on this one. I need to get data out of a filterred selected row !!! ... this is how my code looks like.... On...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.