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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Selection Behaviour - issues

Thread ID:

Created:

Updated:

Platform:

Replies:

99189 May 6,2011 11:06 AM UTC May 16,2011 07:24 PM UTC WinForms 1
loading
Tags: GridControl
Johnathan Tunnicliffe
Asked On May 6, 2011 11:06 AM UTC

Hello,

I'm havin issues obtaining my desired selection behaviour in the grid. I'm using the Grid Sorting demo as a starting point. I'm trying the following two things:
* Clicking in the grid highlights the row (no cell selection)
* Double clicking a cell enters editing mode for that cell

I've played with a few of the settings but cannot achieve this. Can anybody recommend what needs to be set to get this?

(also, is it possible to use condition formatting on the non grouping grid control?)

Thanks very much,
John


Rajadurai C [Syncfusion]
Replied On May 16, 2011 07:24 PM UTC

Hi John,

Thanks for your interest in Syncfusion Products.

We regret for the delay in getting back to you.

i) To enable the row-wise selection in grid, you can handle the ListBoxSelection mode setting as shown below:

grid.ListBoxSelectionMode = SelectionMode.MultiExtended; // you can try other options as well specific requirements.


ii) To disable the cell selection in grid, you would have to handle the AllowSelection setting as shown below:

grid.AllowSelection = GridSelectionFlags.None;


iii) To enable editing only on double-clicking into cell, you would have to handle the ActivateCurrentCellBehavior setting as shown below:

grid.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell;


iv) Conditional formatting in non-grouping grid controls, can be handled through handling PrepareViewStyleInfo event.

// Event Invoker
grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(grid_PrepareViewStyleInfo);

// Method Invoked
void grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.RowIndex == 2 && e.ColIndex == 4)
{
e.Style.BackColor = Color.Red;
}
}



Regards,
Rajadurai


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.

Warning Icon 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.Close Icon

;