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.

GridControl BeforeSelect Event

Thread ID:

Created:

Updated:

Platform:

Replies:

63844 Jul 10,2007 03:54 PM Jul 12,2007 03:34 PM Windows Forms 4
loading
Tags: GridControl
Qingde Shi
Asked On July 10, 2007 03:54 PM

Hi,

How to simulate the GridControl to have a BeforeSelect event for a cell or a row? like the BeforeSelect event in the TreeView Control, user can cancel the selection.

Many thanks.

Q

haneefm [Syncfusion]
Replied On July 10, 2007 04:16 PM

Hi Q,

There are Grid.Model.SelectionChanging(before selection) and Grid.Model.SelectionChanged(after selection) events that you can use to monitor changing selections.

Best Regards,
Haneef

Qingde Shi
Replied On July 11, 2007 01:12 PM

Hi Haneef,

I managed to make BeforeSelect event working. However, the SelectionChanged event was raised at least twice when using ArrorKey to change the selection. Any ideas about how to use SelectionChanged event only once no matter what is the selection change Reason?


Thanks,

Q


>Hi Q,

There are Grid.Model.SelectionChanging(before selection) and Grid.Model.SelectionChanged(after selection) events that you can use to monitor changing selections.

Best Regards,
Haneef

Qingde Shi
Replied On July 12, 2007 10:01 AM

Hi Haneef,

I kink of solved the problem by not using the change Reason but caching selected row index and check if selected row index changed.

Now I have another question. To use the GridListControl, do I have to set items by binding to DataSource? Can I do something like this, gridListControl.Items.Add(object value)? the Items property is null by defaut.

Thanks.

Q




>Hi Haneef,

I managed to make BeforeSelect event working. However, the SelectionChanged event was raised at least twice when using ArrorKey to change the selection. Any ideas about how to use SelectionChanged event only once no matter what is the selection change Reason?


Thanks,

Q


>Hi Q,

There are Grid.Model.SelectionChanging(before selection) and Grid.Model.SelectionChanged(after selection) events that you can use to monitor changing selections.

Best Regards,
Haneef

haneefm [Syncfusion]
Replied On July 12, 2007 03:34 PM

Hi Q,

You can set the DataSource property of the GridListControl to bind the datatable.If you want to see multiple column in a list then enable the MultiColumn property. Below is a code snippet


this.gridListControl1.MultiColumn = true;

this.gridListControl1.DataSource = this.dataSet11.Tables["Products"];


Best regards,
Haneef

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.

;