We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Setting SelectedItems property in SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

115613 Jan 24,2014 04:40 PM Jan 30,2014 01:56 PM WinRT 4
loading
Tags: General
Andrew Ridout
Asked On January 24, 2014 04:40 PM

Hi,

I'm using a SfDataGrid control with SelectionMode="Multiple".  I am trying to bind the SelectedItems property to an ObservableCollection<object> in my view model class but VisualStudio gives the following error:

"The property "Selected Items" does not have an accessible setter".

However, the solution does build and run successfully even though the error is still there.  Can you confirm whether or not this is a bug in the SfDataGrid control?

For info, the grid is declared in the view as follows:

<grid:SfDataGrid AllowSorting="True" ItemsSource="{Binding Documents}" 
                         ColumnSizer="Star"
                         NavigationMode="Row" SelectionMode="Multiple"
                         SelectedItems="{Binding SelectedDocuments}"
And "SelectedItems" binds to the following property on the view model:

public ObservableCollection<object> SelectedDocuments { getset; }

I also note that the SelectedItems property does not appear in Intellisense when adding properties to the SfDataGrid control XAML.

Grateful for any help/advice you can give.

Regards,
Andrew

Andrew Ridout
Replied On January 28, 2014 08:58 AM

Further to my above post, I have upgraded to Syncfusion for WinRT v11.4.0.26 and I am now getting the following run time exception:

The property 'SelectedItems' was not found in type SfDataGrid'."

Please can you advise how I can access the SelectedItems property on the SfDataGrid control?

Regards,
Andrew

Jai Ganesh S [Syncfusion]
Replied On January 30, 2014 04:16 AM

Hi Andrew,

 

Thank you for using Syncfusion products.

 

We have analyzed your queries and please find the responses for your queries below,

 

Query 1:

 

The “SelectedItems” property in SfDataGrid is a read only property and it is used to get the SelectedItems  and we cannot set the values in it.

 

Query 2:

 

The “SelectedItems” property does not appear in the intellisense because it is a read only property. The read only properties will not appear in intellisense.

 

Query 3:

 

You can get the “SelectedItems” by using  the datagrid.SelectedItems property. We have prepared the sample based on this and please find the sample under the following location.

 

Sample: WinrtGridSample.zip

 

Please let us know if you need further assistance.

 

Thank you,

Jai Ganesh S


Andrew Ridout
Replied On January 30, 2014 10:22 AM

Thanks, this is exactly what I needed.  I appreciate your help.

Regards,
Andrew

Jai Ganesh S [Syncfusion]
Replied On January 30, 2014 01:56 PM

Hi Andrew,

 

Thank you for your update.

 

Please let us know if you have any queries.

 

Thank you,

Jai Ganesh S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;