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

SfDataGrid selected row highlight or manual selection handling

Hi - have started using an SfDataGrid in WinForms.

I want to allow single row selection, but only have the selection highlighting on the first column -is that possible?
(reason is I've set background colour on other columns and want that to remain visible when the row is selected)

Alternatively is it possible to simulate the selection manually?
So when a row is clicked just change the background colour of the first column cell and restore the colour of the previous one?
I've tried this using CellClickEvent to set a value in the row and QueryCellStyle to change the background colour for that value but its not working.
Is there something I need to call after changing a data value to force QueryCellStyle to update?

Thanks

Leigh




4 Replies

GG Gowtham Gopalsamy Syncfusion Team November 28, 2019 05:12 AM

  
Hi Leigh , 
  
Thank you for using Syncfusion controls. 
 
We have considered to provide support for “Support to customize the row style for current row when selection is applied” in WinForms and logged feature request for the same. We will implement this feature in any of our upcoming release.   
  
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.  
  
Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.  
   
  
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.  
 
Please let us know, if you require further assistance on this. 
  
Regards, 
Gowtham. 



LA Leigh Anderson November 28, 2019 06:15 AM

Hi Gowtham

Thanks for the update.

I have another query - is it possible to force a refresh/redraw of a row?

I'm changing the images in my datasource but the display only seems to update if I move the mouse out left and back in to the grid!?

Also is there something to force QueryCellStyle as well?

Thanks

Leigh


LA Leigh Anderson November 28, 2019 08:38 AM

Don't worry - have found the answer myself - can use sfDataGrid:Refresh() and sfDataGrid:Update()

Leigh


FP Farjana Parveen Ayubb Syncfusion Team November 28, 2019 11:18 PM

Hi Leigh, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon