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.

select the row while clicking on the cell

Thread ID:





131685 Jul 23,2017 01:05 PM Jul 24,2017 06:02 AM Windows Forms 1
Tags: GridDataBoundGrid(Classic)
Asked On July 23, 2017 01:05 PM

Salve, come faccio a selezionare tutta la riga cliccando su una cella come nell'esempio 2 dell'allegato?
Rimane sempre la cella deselezionata.
Cordiali saluti

Translated from Italian to English using Google Translate;

How do I select all the row by clicking on a cell as in Example 2 in the attachment?
Best Regards

Attachment: selectarow_651f0a09.zip

Arulpriya Ramalingam [Syncfusion]
Replied On July 24, 2017 06:02 AM

Hi Nino,   
Thanks for using Syncfusion products.   
We have analyzed your scenario with provided image and we suspect that your requirement is to set the back color for current cell also while clicking the cell. By default, the selection color will be enabled for the current record except current cell on cell click. In order to set the back color for current cell also on cell click, the QueryCellInfo event can be used. In that event, BackColor property of GridStyleInfo can be used to set the background color. Please refer to the below code example and sample,   
Code example:   
//Event Subscription   
this.gridDataBoundGrid1.Model.QueryCellInfo += Model_QueryCellInfo;   
//Event Handling   
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)   
    int rowIndex = gridDataBoundGrid1.CurrentCell.RowIndex;   
    bool isSelected = gridDataBoundGrid1.Model.Selections.Ranges.Contains(GridRangeInfo.Row(rowIndex));   
    if (isSelected && (GridRangeInfo.Row(e.RowIndex) == GridRangeInfo.Row(rowIndex)))   
        e.Style.BackColor = Color.FromArgb(153, 204, 255);   
Sample link: SelectionBackcolor    


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.