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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Working with Row Header

Thread ID:

Created:

Updated:

Platform:

Replies:

141568 Dec 18,2018 02:22 PM UTC Dec 26,2018 04:14 PM UTC WinForms 3
loading
Tags: SfDataGrid
Thomas J Morgan
Asked On December 18, 2018 02:22 PM UTC

I am trying to add an icon to the RowHeader to indicate the row status (added, deleted, unchanged, etc).
A couple of questions:
Form the body of the program (not an event)
1.  Is there a way to access the RowHeader CellInfo for a specific (RowIndex) row or for any cell for that matter?
2.  Is there a way to trigger an DrawCell event for a specific cell or row?
Thanks

Jayaleshwari N [Syncfusion]
Replied On December 19, 2018 11:33 AM UTC

Hi Thomas, 
 
Thanks for contacting Syncfusion Support. Please find the details about the queries. 
 
Query 
Solution 
Is there a way to access the RowHeader CellInfo for a specific (RowIndex) row or for any cell for that matter? 
It is not possible to access the row header cell information for a specific row or cell without using any DrawCell event. You can achieve your requirement to add icon on the row header using the DrawCell event  or by creating custom row header cell renderer. 
 
You can refer the below UG link to customize the row header. 
 
Is there a way to trigger an DrawCell event for a specific cell or row? 
DrawCell event will be raised every time while drawing each cells in the DataGrid. It cannot be triggered for any specific cell or row. You can perform any action while drawing a specific row or cell by using DrawCellEventArgs.RowIndex and DrawCellEventArgs.ColumnIndex properties as given in the following code example. 
 
this.sfDataGrid1.DrawCell += sfDataGrid1_DrawCell; 
 
void sfDataGrid1_DrawCell(object sender, Syncfusion.WinForms.DataGrid.Events.DrawCellEventArgs e) 
{ 
    if (e.RowIndex == 1 && e.ColumnIndex == 2) 
    { 
        //Do your customizations here. 
    } 
} 
 
 
Please let us know if you would require further assistance. 
 
Regards, 
Jayaleshwari N 


Thomas J Morgan
Replied On December 25, 2018 04:35 PM UTC

Found out that sfDataGrid.Refresh(); will trigger the DrawCell event.  all set.


Shobika Palani [Syncfusion]
Replied On December 26, 2018 04:14 PM UTC

Hi Thomas, 

Thanks for the update. 

You can use SfDataGrid.Refresh() method to trigger the DrawCell event of datagrid. In that based on DrawCellEventArgs.RowIndex and DrawCellEventArgs.ColumnIndex, you can perform any action for the particular row/cell, as like we mentioned in our previous update.  

Please let us know if you need any further assistance on this. 

Regards, 
Shobika. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;