views:

1871

answers:

1

Hi,

I've only been using Silverlight for a little over 24 hours. So I am still finding me feet.

I'm Currently using Silverlight 3 (Beta) (I require its great offline mode feature)

When using the data grid that is bound to a data source, is it possible for users to add data via the grid? Or is the data grid just limited to displaying & editing data from the bound data-source?

Many Thanks Luke

+1  A: 

Unless something has changed recently, you'll need to add the new row to the data source yourself. Take a look at this post describing the process:

http://weblogs.asp.net/manishdalal/archive/2008/08/25/silverlight-business-application-part-1-add-new-item.aspx

James Cadd
Thanks for the link, it confirmed one of my ideas to add a blank row to the source data to allow the users to add a new item. However i will need to look into what happens when users sort the grids.
Audioillity
Sorting is controlled by instances of the ICollectionView interface. When you bind an ObservableCollection to a Grid, the Grid creates an instance of this interface (the concrete class is internal - you don't have access to it) behind the scenes. Then, when you add new items to the underlying data source they should be automatically filtered by the ICollectionView. hth.
James Cadd