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.

Row Selection in GridDataBoundGrid

Thread ID:





13372 Apr 27,2004 11:50 AM Apr 27,2004 04:23 PM Windows Forms 3
Tags: GridControl
Asked On April 27, 2004 11:50 AM

I''d like to set up the grid to allow only single Row selection. When the selection changes I''d like to update a details section of the screen. I''ve got an event handler on grid.Model.SelectionChanged, and I''ve set the AllowSelection on the grid to only Row and AlphaBlend. The problem is that the selected row never changes, even though another row is visually selected. The triangle pointer in the row column never changes from the first row. How can I get my desired behaviour and what event should I be listening to? Thanks, Daws

Administrator [Syncfusion]
Replied On April 27, 2004 02:16 PM

Hi Daws, instead of changing AllowSelection try setting grid.Options.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One; I think that is the behavior you are looking for. You can then check for CurrentCellMoved and CurrentCellActivated events. These events are raised when the current cell is moved. In the event handlers you can check whether the cell was moved to a new row and if that is the case then update your details information in the form. Stefan

Replied On April 27, 2004 02:46 PM

Thanks, that worked. One more minor detail. Is there a way to hide the Selected row arrow that appears in the Row header? The correct row gets highlighted, but the row selection arrow always stays on the first row. Thanks, Daws

Administrator [Syncfusion]
Replied On April 27, 2004 04:23 PM

That''s odd. The selection arrow should be moving together with the slected row. You are using a databound grid, correct? Anyway, if you do not want any arrow to appear you can change this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.CellType = "Header"; Stefan


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.