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. Image for the cookie policy date
close icon

Gridlist Control C#

Hi there,

I would appreciate any help with the following regarding GridList Control:

The user should be able to select various rows (1 or many), then I need a way to programmatically determine which rows are selected.
I will be using a context menu on the grid, so I need to find which ones are selected at that point using C#.

1 Reply

LS Lingaraj S Syncfusion Team July 10, 2009 11:53 AM UTC

Hi Brandon,

Thank you for your interest in Syncfusion product.

If you want to get the selected row in GridListControl, then please try using GetSelected method in Items property to achieve this behavior. The GetSelected method is used to check the whether the row index was selected or not. The row is selected then it will return the True value.

Refer the code below:

this.label2.Text = "";
int count=0;
for (int i = 0; i < this.gridListControl1.Items.Count; i++)
{
if (this.gridListControl1.GetSelected(i))
{
count++;
this.label2.Text += i + " ";
}
}
MessageBox.Show("Selected Items : " + count);


Refer the sample in below link:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/GridList1.zip

Please let me know if you have nay queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon