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. Image for the cookie policy date
close icon

Grid Selection Behaviour - issues

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


1 Reply

RC Rajadurai C Syncfusion Team 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


Loader.
Live Chat Icon For mobile
Up arrow icon