1
votes

Iam new to Silverlight. I have a Data Grid with few Text box Template columns . I have bound the grid to a list so that changes in the text box are reflected in the data source entity .

User would type the data in the text box and in the "onleave" event of the text box template column, and I would save the data typed.

I find that data is getting reflected in the enitity. But I cannot use the dataGrid.SelecedItem or dataGrid.SelecedIndex property of the datagrid as user would have seleced a different row after leaving typing data in one row.

My doubt is , how can we find the index of the current row he has edited inside the onleave event of the text box template column ?

2

2 Answers

0
votes

Under dataGrid_RowBound(...) event use e.RowIndex where e is the parameter ( of type EventArgs class)

0
votes

Instard of OnLeave event you can use the row edit ended event for where you can get e.Row the edited row object . which can be used to save the entity.