Updating Silverlight Datagrid After Responding From Server

I got a datagrid in Silverlight. I would like to

  • datagrid (or a custom control that contains a data file) to publish to the server when the user edits a cell in the pillar.

  • to signal the datagrid using some character in the editable cell (like a loading character) that is sent to the server and the control waits for a response.

  • to signal the dataset with colors (in the correct cell) if the update was successful.

I figured out that I can use the WebClient class to call to the server in the set-property of objects (~ cells), but it seems to me that I am doing something fundamentally wrong, since:

  • I don't know in the set-property of the object that the datagrid was triggering the set-property

  • and since I don't know that I won't be able to figure out which datagrid (and which cell in the datagrid) to send the response (i.e. if the message was successful or unsuccessful).

I also tried to observe some events in the datagrid (BeginningEdit, PreparationingCellForEdit, SelectionChanged, CurrentCellChanged), but none of them gave me the new value of the cell being edited.

Can anyone point me in the right direction on how to solve these problems?

+1


source to share


1 answer


use DataBinding. Bind to a collection of type ObservableCollection (where T is your object type) and when you return from the web client call, populate that collection. As its observable, the data grid will see new data.



+2


source







All Articles