selection change - off
Hi,
I have a GridListControl with single selection mode.
I need to lock selection change.
Please Help.
SIGN IN To post a reply.
8 Replies
AD
Administrator
Syncfusion Team
January 24, 2006 02:31 PM UTC
Hi Dmitry,
You can lock the selection change by using SelectionChanging Event handler in the GridListControl. Here is the code snippet.
private void Grid_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
e.Cancel = true;
}
private void gridControl1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
this.gridControl1[3,3].ReadOnly = true;
cr.ListControlPart.Grid.SelectionChanging +=new GridSelectionChangingEventHandler(Grid_SelectionChanging);
}
Refer to the sample for more details.
GridListControl
Let us know if you need further assistance,
Regards,
Madhan.
DG
dmitry gilin
January 24, 2006 02:49 PM UTC
>Hi Dmitry,
> You can lock the selection change by using SelectionChanging Event handler in the GridListControl. Here is the code snippet.
>
> private void Grid_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
> {
> e.Cancel = true;
> }
> private void gridControl1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e)
> {
> GridCurrentCell cc = this.gridControl1.CurrentCell;
> GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
> this.gridControl1[3,3].ReadOnly = true;
> cr.ListControlPart.Grid.SelectionChanging +=new GridSelectionChangingEventHandler(Grid_SelectionChanging);
> }
>
>Refer to the sample for more details.
>GridListControl
>
>Let us know if you need further assistance,
>
>Regards,
>Madhan.
I do not need second cursor.
How do I hide it?
ST
stanleyj
Syncfusion Team
January 24, 2006 03:07 PM UTC
Hi Dmitry,
Check if cc.EndEdit() in CurrentCellShowingDropDown event, solves for you.
Thanks,
Stanley
AD
Administrator
Syncfusion Team
January 24, 2006 03:29 PM UTC
ST
stanleyj
Syncfusion Team
January 24, 2006 03:47 PM UTC
Hi Dmitry,
Please try this.
this.gridListControl1.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo);
GridCurrentCell cc;
private void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
cc = this.gridListControl1.Grid.CurrentCell;
if(cc.HasCurrentCellAt(e.RowIndex))
{
e.Style.Borders.Top = new GridBorder(GridBorderStyle.Standard);
e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.Standard);
e.Style.Borders.Left = new GridBorder(GridBorderStyle.Standard);
e.Style.Borders.Right = new GridBorder(GridBorderStyle.Standard);
}
}
Best regards,
Stanley
AD
Administrator
Syncfusion Team
January 24, 2006 04:27 PM UTC
Thanks for quick your answers.
Sorry again for my English.
I have two GridListControls - Grid1(Master) and Grid2(Detail). I use SetDataBinding for binding with source(IBindingList).
I need:
if mode == Modes.Edit then
1. Cursor(SelectedItem) in Grid1 is fixed.
2. When I try change SelectedItem (mouse click) in Grid1, data in Grid2 be fixed to.
if mode == Modes.View then Cursor in Grid1 is free.
When I use your last variant I get one selected item.
But if I click on other item my Grid2 has data change.
AD
Administrator
Syncfusion Team
January 25, 2006 05:15 AM UTC
Help, please
AD
Administrator
Syncfusion Team
January 25, 2006 06:34 AM UTC
Hi Dimtry,
Setting this.gridListControl1.Enabled = false; will avoid the user from changing the selection, and again setting this.gridListControl1.Enabled = true; will allow the user to select.
Regards,
Calvin.
SIGN IN To post a reply.
- 8 Replies
- 3 Participants
-
DG dmitry gilin
- Jan 24, 2006 05:05 AM UTC
- Jan 25, 2006 06:34 AM UTC