→ testPtt: foreach(var cell in DataGrid.SelectedCells) 11/07 11:53
→ testPtt: 不建議用程式控制ui寫入資料 我實做只會直接寫入不經過ui 11/08 14:13
→ testPtt: 網路上可能能找到index取得指定cell的方法 11/08 14:15
→ testPtt: 你在取得cell還要.DataContext再轉型才寫入 11/08 14:18
不懂你的意思耶,有範例嗎? DataContext轉型和直接寫入的範例
網路看到都item整列寫入,而我想修改其中一個cell的值而已
→ testPtt: 直接修改data內容 或是找到cell.DataContext 11/08 21:14
→ testPtt: 我從沒做過ui從index去找 最後都要取出item對應的屬性 11/08 21:58
→ testPtt: 程式碼可能像(cell.item as (type)).屬性=要填的值; 11/08 22:02
→ testPtt: 屬性大概就你的col1,col2... 11/08 22:07
網上都是教GD1. Col1="10" ,這個我會。但我想做numericupdown去更新我
selected cell,現在已經可以得到selected cell index, 只差cell 不可以用index修
改, c#的datgridview可以culumns[i].Rows[j],WPF不行!
selected cell index是數字, Col1是屬性, 無法帶入
※ 編輯: GooLoo (1.171.26.119), 11/08/2018 23:10:57
→ testPtt: 如果你是單純數值方陣 那可能不適合DataGrid做 11/08 23:14
→ testPtt: 你也可以在selected的同時去更新numericupdown的binding 11/08 23:18
對,單純數值矩陣,因為之前datagridview有成功,轉wpf失敗,如果不適合,該用哪一個呢?
※ 編輯: GooLoo (1.171.26.119), 11/08/2018 23:35:44
→ testPtt: 內建只有DataGrid可以 遇到這種需求我傾向寫usercontrol 11/08 23:44
→ GooLoo: 瞭解,感謝喔 11/09 12:31