Column width of a DataGrid in a Windows Mobile Application

前端 未结 2 1316
余生分开走
余生分开走 2021-01-12 11:04

I\'m having problems trying to adjust the width of a column of a datagrid. I used the answer posted here, but I can\'t solve it.

I\'m using a List of objects as a da

相关标签:
2条回答
  • 2021-01-12 11:44

    For anyone using a DataTable as the DataSource instead of a list, it appears you have to change:

    tableStyle.MappingName = lista.GetType().Name;
    

    to:

    tableStyle.MappingName = lista.TableName;
    

    Took me a while to figure this out!

    0 讨论(0)
  • 2021-01-12 11:48

    Change this line

    tableStyle.MappingName = lista.GetType().ToString();
    

    to

    tableStyle.MappingName = lista.GetType().Name;
    

    Oh, and 4000 is a little big for a mobile but I assume that's a typo.

    0 讨论(0)
提交回复
热议问题