Home All Groups Group Topic Archive Search About

Limit Columns shown from XML file

Author
1 Mar 2006 11:37 AM
Devlei
My application reads data from an XML file into a Dataset, then via a
Dataview displays the data to the user in a datagrid.  How do I only
show certain columns in the Datagrid?  I have tried the TableStyle
property (and subsequent ColumnStyle) of the Datagrid, but the unwanted
columns still apear.

With SQL/OLE databases it was easy by simply using the SQL statement to
only fill the dataset with the required columns.  But is there an
equivalent when reading an XML file?

With thanks

Author
1 Mar 2006 12:23 PM
Ken Tucker [MVP]
Hi,

        The tablestyle mapping name is wrong if all the column styles are
still being shown.  Try setting the mapping name to the
dataset.table.tablename

Ken
-------------------
Show quoteHide quote
"Devlei" <dev***@eastcape.net> wrote in message
news:1141213071.222149.224530@u72g2000cwu.googlegroups.com...
> My application reads data from an XML file into a Dataset, then via a
> Dataview displays the data to the user in a datagrid.  How do I only
> show certain columns in the Datagrid?  I have tried the TableStyle
> property (and subsequent ColumnStyle) of the Datagrid, but the unwanted
> columns still apear.
>
> With SQL/OLE databases it was easy by simply using the SQL statement to
> only fill the dataset with the required columns.  But is there an
> equivalent when reading an XML file?
>
> With thanks
>
Author
1 Mar 2006 2:30 PM
Devlei
Thanks Ken, I will try that!!

Is that the only way to do it?  Is it not possible to only read certain
columns from the XML file, or alternatively use the Dataview to only
read certain dataset columns?