2012-07-22 30 views

回答

2

使用這些幫助函數; http://techiethings.blogspot.com/2010/05/get-wpf-datagrid-row-and-cell.html

在Update按鈕,掛鉤Click事件,並在處理程序,做這樣的事情:

//youll need to google for GetVisualParent function. 
DataGridRow row = GetVisualParent<DataGridRow>(button); 
for(int j = 0; j < dataGrid.Columns.Count; j++) 
    DataGridCell cell = GetCell(dataGrid, row, j); 

我沒有完全理解你想做的事,但是這應該幫助。

+0

該鏈接是相當有幫助的!謝謝:-) – 2012-07-22 16:36:55

+0

不要讓你的答案依賴於外部資源,儘量讓你的答案中的所有必要信息,使其獨立。我剛剛從該鏈接獲得了一個503。 – 2012-07-22 18:43:39

相關問題