Column Width in DataGrid When using DataView

G

Guest

How do I set the column width in a datagrid when the datasource is a
dataview? I want to use a dataview so data changes, inserts, and deletes are
disabled.

I can set the column width when I use the DataTable that underlies the
DataView as the DataSource in the DataGrid. When I use the DataTable name as
the MappingName in the DataGridTableStyle, it works like a charm.

However, when I change the DataGrid.DataSource to the DataView, I don't know
what MappingName to put in its DataGridTableStyle. No matter what I put as a
MappingName, the values in the GridColumnStyles.columnwidth are ignored. The
column names show up in the combobox in the GridColumnStyles so it sees data
from the dataview.

Any ideas on what I should do?
 
K

Ken Tucker [MVP]

Hi,

The mappingname for the dataview will be the same as the
datatable's.

Ken
 

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

Similar Threads


Top