GetXML, DataSet and dataview

C

Chris

I apply a dataview with a filter to a datagrid to remove rows that a
user does not want to see. However when I attempt to extract the data
from the underlying dataset using GetXML() the entire dataset is
returned. Is there a method of getting the XML from the dataview /
datagrid / dataset that applies the filter applied in the dataview?

Thanks in advance.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You apply the dataview to the dataset, not to the grid. you place the
filters in the dataview as well as the sort criteria then you bind the grid
to this dataview

why are you using GetXML?

what is what you wanna do anyway?

cheers,
 
C

Chris

Yes apologies if that wasn't clear. I use a DataView for the purpose of
allowing my users to sort data in a data grid in a web based app. I want
to access the xml as I need to offer the ability to convert the data
grid to an excel spreadsheet. With the xml I can apply xslt for comma
delimited / tab delimited formatting and change the mime type then pipe
to excel.

Regards,

Chris
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

I think it would be better if you convert the dataview to excel, not the
datagrid the grid is only meant to display data.. Now as you are aware
GetXml is not present in dataview so probably you will have to iterate and
process each row at a time.

Hope this help,
 
C

Chris

Thank you for your help. I am going to iterate through the dataview and
process on a row by row basis
 

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