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

Inquiries about sfdatagrid

Hello, Syncfusion Team.


I have two questions related to SfDataGrid.




1.

As in the image above, when the Popup Window is loaded, I want the first item among the checked items in SfDataGrid to be selected.  

Is there an IsSelected property for Row in SfDataGrid? Or is there another way?


2.

As shown in the image above, the selected item is marked with a dotted line.

I want to remove FocusVisualStyle. Is there a way?


1 Reply

DM Dhanasekar Mohanraj Syncfusion Team February 10, 2023 02:36 PM UTC

Hi Jayden Lee,

Please find the response to your requirement below,

Requirement

Response


As in the image above, when the Popup Window is loaded, I want the first item among the checked items in SfDataGrid to be selected. 

 

Is there an IsSelected property for Row in SfDataGrid? Or is there another way?

 

 

Your requirement to “Select the first record of the SfDataGrid” will be achievable in the below ways,

 

Case 1: SelectedIndex

 

You can select the first record of the SfDatagrid by setting its index to the SfDataGrid.SelectedIndex is shown below,

 

this.sfDataGrid1.SelectedIndex = 0;

 

Case 2: SelectedItem

 

You can select the first record of the SfDatagrid by setting the first record as SfDataGrid.SelectedItem is shown below,

 

var record = SelectionHelper.GetRecordAtRowIndex(this.sfDataGrid1, 1);

this.sfDataGrid1.SelectedItem = record;

 

 

For more information related to the selected index, please refer to the below user guide documentation link,

 

UG Link: https://help.syncfusion.com/windowsforms/datagrid/selection#process-selection-using-properties

 

Note:

 

When you are using some other type of row (FilterRow, AddNewRow) the indices are changed. In that case, you should use the resolved indices by using our helper methods shown in the below user guide documentation,

 

UG Link: https://help.syncfusion.com/windowsforms/datagrid/helpers

 

 

As shown in the image above, the selected item is marked with a dotted line.

 

I want to remove FocusVisualStyle. Is there a way?

 

 

We have created a new thread for the query, and the link is below,

https://www.syncfusion.com/forums/180466/inquiries-about-sfdatagrid-from-180438  

We suggest you follow up with this query for further updates.

 


Regards,

Dhanasekar M.


Loader.
Live Chat Icon For mobile
Up arrow icon