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
HA
haneefm
Syncfusion Team
July 10, 2007 08:16 PM UTC
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
QS
Qingde Shi
July 11, 2007 05:12 PM UTC
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
QS
Qingde Shi
July 12, 2007 02:01 PM UTC
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
HA
haneefm
Syncfusion Team
July 12, 2007 07:34 PM UTC
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