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.
Syncfusion Feedback

select the row while clicking on the cell

Thread ID:

Created:

Updated:

Platform:

Replies:

131685 Jul 23,2017 05:05 PM UTC Jul 24,2017 10:02 AM UTC WinForms 1
loading
Tags: GridDataBoundGrid(Classic)
Nino
Asked On July 23, 2017 05:05 PM UTC

Salve, come faccio a selezionare tutta la riga cliccando su una cella come nell'esempio 2 dell'allegato?
Rimane sempre la cella deselezionata.
Grazie
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?
Thanks.
Best Regards



Attachment: selectarow_651f0a09.zip

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

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);   
    }   
}   
   
   
Screenshot   
     
Sample link: SelectionBackcolor    
  
Regards,   
Arulpriya   


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

;