2014-05-14 44 views
0

我有一個DataGridGrid內,並希望DataGrid動態調整大小,當用戶在DataGrid的行中寫入文本時。如何讓DataGrid隨其內容動態增長?

例子:

| Cell 1 | Cell 2 | 

如果用戶在小區1中寫道:Hello World,那麼我們有:

| Hello W| Cell 2 | 

是否有可能讓DataGrid動態調整大小爲:

| Hello World | Cell 2| 
+0

你有XAML中? –

+0

@GayotFow是的,我使用XAML來設計我的GUI。 –

+0

你會發布嗎? –

回答

0

設置ColumnWidth

<DataGrid ColumnWidth="*" /> 

<DataGrid ColumnWidth="Auto" />