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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiple selection in GridDataControl

Thread ID:

Created:

Updated:

Platform:

Replies:

95797 Aug 2,2010 01:29 PM UTC Feb 22,2011 10:41 AM UTC WPF 3
loading
Tags: GridControl
Jimmy Ji
Asked On August 2, 2010 01:29 PM UTC

Does GrdiDataControl support multiple row selection? From the properties in the code behind, I only see the "SelectedItem" but there are no "SelectedItems", I wonder if they have something similar to that.

One more thing, is it possible to resize row height after the application is run? I have tried to set the "AllowResizeRows" to true, however, I still cannot resize the row height, but I could resize the column width though...

Thank you very much.

Kamalakannan A [Syncfusion]
Replied On August 11, 2010 07:22 PM UTC

Hi Jimmy,

Thanks for using syncfusion products. You can set the ListboxSelectionMode option to MultiExtent which allows to multiple select in the grid as follows.

[Code] [C#]

void dataGrid_Loaded(object sender, RoutedEventArgs e)
{
this.dataGrid.ListBoxSelectionMode = GridSelectionMode.MultiExtended;
}

[Code] [Xaml]

ShowAddNewRow="False"
ShowFilters="False"
AutoPopulateColumns="False"
AutoPopulateRelations="False"
VisualStyle="Office14Silver"
ListBoxSelectionMode="MultiExtended">



To Resize the row height in UI you need to set the showrowHeader Property to true as follows. this will allows you to resize the row height.

[Code] [Xaml]

ShowAddNewRow="False"
ShowFilters="False"
AutoPopulateColumns="False"
AutoPopulateRelations="False"
VisualStyle="Office14Silver"
ShowRowHeader="True"
ListBoxSelectionMode="MultiExtended">



Let us know if you need any more information.

Thanks
Kamalakannan

Administrator [Syncfusion]
Replied On February 11, 2011 03:06 PM UTC

What property or event (or something else?) do you use to get items that are selected?

Thanks


Mayavel K [Syncfusion]
Replied On February 22, 2011 10:41 AM UTC

Hi Jimmy,

You can use the selection changed event and the property SelectedItems property that return the selected Items collection.

Following code snippets illustrates this.

[Code] [C#}

dataGrid.Model.SelectionChanged += new Syncfusion.Windows.Controls.Grid.GridSelectionChangedEventHandler(Model_SelectionChanged);

void Model_SelectionChanged(object sender, Syncfusion.Windows.Controls.Grid.GridSelectionChangedEventArgs e)

{
var order = dataGrid.SelectedItems;
}

Regards,
Mayavel K




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

;