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

select the row while clicking on the cell

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

1 Reply

AR Arulpriya Ramalingam Syncfusion Team 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   


Loader.
Live Chat Icon For mobile
Up arrow icon