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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Programmatic control of row selection?

Thread ID:

Created:

Updated:

Platform:

Replies:

120242 Sep 14,2015 03:01 AM UTC Sep 16,2015 05:50 AM UTC Xamarin.iOS 3
loading
Tags: SfDataGrid
Michael Hoffmann
Asked On September 14, 2015 03:01 AM UTC

Hi again,

Note that the reason I feel I have to ask this many question on the forum is because, frankly, the documentation for the Xamarin sfDatagrid is not very good at all. Or maybe "non-existent" would be a better way of putting it! While other products have some very complete API documentation, there seems to be littler beyond the Getting Started and the sample code.

At any rate: how to I select a row/column/cell from within the code, as opposed to user touch/tap selection?

is there a sfGrid.SelectRow(5)? Going through the Intellisense and looking at properties, methods etc, I can't seem to find anything that looks like this.

Thanks!

Harikrishnan N [Syncfusion]
Replied On September 14, 2015 12:41 PM UTC

Hi Michael,

Thank you for using Syncfusion Products.

When the SelectionMode is single, you can select a row based on the row index from the code using the SfDataGrid.SelectedIndex property. You can also select an item in SfDataGrid which matches your search item by using the SfDataGrid.SelectedItem property.

When the SelectionMode is Multiple, you can select multiple rows from the code by adding the row objects to the SfDataGrid.SelectedItems collection. Please refer the below code examples.



//When SelectionMode = SelectionMode.Single, Select an item from code based on its RowIndex.

this.SfGrid.SelectedIndex = 4;


// When SelectionMode = SelectionMode.Single, Select an item in SfDataGrid which matches the search item

this.SfGrid.SelectedItem = viewModel.OrdersInfo[4];


//Select items in SfDataGrid from code when selection mode is multiple
this.SfGrid.SelectedItems.Add(viewModel.OrdersInfo[6]);


Regarding your feedback on documentation, we have already planned to update our UGDocumentation in detail, which includes the API usages and explanation and few basic “How to” sections which will explain about some customizations that can be done in SfDataGrid. Our UGdocuments will be updated in the midst of October, 2015. We appreciate your patience until then.

Please let us know if this helps.

Regards,
Harikrishnan

Michael Hoffmann
Replied On September 15, 2015 10:54 PM UTC

Works perfectly, many thanks!

Looking forward to the documentation update.

Mike

Harikrishnan N [Syncfusion]
Replied On September 16, 2015 05:50 AM UTC

Hi Michael,

Thank you for your update.

As promised our UG will be updated with API usages and examples in the midst of October, 2015.

Please let us know if you have any query.

Regards,
Harikrishnan


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.

Warning Icon 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.Close Icon

;