Datagrid Column Style ?

J

JC

I am using the datagrid with late binding to an xml file. I set the column
width and MappingName in code and set the TableStyles collection with the
same info at design time. However it always reverts to the
PreferedColumnWidth size and not those set in the GridColumnStyles
collection. What do I need to do to get these styles to work?

Thanks,
John Cantley
 
J

John Mark Howell

Your xsd column names are not matching your data column mapping names. When
the column names do not match, the DataGrid will use the defaults for that
column.
 
B

Branimir Giurov

You have to set the mapping name for the DataGridTableStyle's Mapping Name
as well. Otherwise it won't set the values you've defined anyway :)

Cheers,
Branimir
 
J

JC

So what do I set the MappingName for the DataGridTableStyle to, given this.
I have the dataset called Pingy. and the corresponding xml file looks like
this.

<PingSettings>
<PingSetting>
<IP>12.12.12.12</IP>
<Ping>Y</Ping>
<LastPing>23</LastPing>
<Threshold>150</Threshold>
</PingSetting>
<PingSetting/>
</PingSettings>

I am setting the MappingName for the columns to the actual element name of
the xml file, which is the same as the xsd names.

thanks,
John Cantley
 

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