Datagrid Column Style ?

  • Thread starter Thread starter JC
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top