DataView from DataViewManager

R

rk

Hi,

I am using a DataViewManager to display the dataset in a datagrid. Once
the rowfilter is applied, I would like to know the no. of rows returned
so that I can display it on the screen. I would like a way to get the
underlying DataView to get the count but I am unable to find it.

Here is what I am doing:

string filter = "...";
DataViewManager dvm = new DataViewManager (myDataSet);
dvm.DataViewSettings["table"].RowFilter = filter;
this.myDataGrid.SetDataBinding (dvm, "table");


thanks
--rk
 
N

Nicholas Paldino [.NET/C# MVP]

rk,

Instead of binding to your DataViewManager, I would bind to the DataView
returned by a call to CreateDataView. Then, you can use the view to get the
count of the number of rows when the filter is applied.

Hope this helps.
 
R

rk

Nicholas,

Thanks for the suggestion - it worked just fine. But I wanted to use
DataViewManager and I am wondering why there is no way to extract the
underlying DataView if the DataViewManager does create a dataview on
all the underlying tables?

Just wondering.

--rk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top