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.

selection change - off

Thread ID:

Created:

Updated:

Platform:

Replies:

40027 Jan 24,2006 12:05 AM Jan 25,2006 01:34 AM Windows Forms 8
loading
Tags: GridControl
dmitry gilin
Asked On January 24, 2006 12:05 AM

Hi, I have a GridListControl with single selection mode. I need to lock selection change. Please Help.

Administrator [Syncfusion]
Replied On January 24, 2006 09:31 AM

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.

dmitry gilin
Replied On January 24, 2006 09:49 AM

>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?

stanleyj [Syncfusion]
Replied On January 24, 2006 10:07 AM

Hi Dmitry, Check if cc.EndEdit() in CurrentCellShowingDropDown event, solves for you. Thanks, Stanley

Administrator [Syncfusion]
Replied On January 24, 2006 10:29 AM

Sorry, my English is bad. See attachment.

picture.zip

stanleyj [Syncfusion]
Replied On January 24, 2006 10:47 AM

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

Administrator [Syncfusion]
Replied On January 24, 2006 11:27 AM

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.

Administrator [Syncfusion]
Replied On January 25, 2006 12:15 AM

Help, please

Administrator [Syncfusion]
Replied On January 25, 2006 01:34 AM

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.

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.

;