Add text to a cell

I want to add text to a specific cell using ContextMenu. Earlier for dataGridView I did it like this: 
dataGridView1.Rows[RowIndex].Cells[ColIndex].Value = "Text";
How to do this for SfDataGrid?


1 Reply

MA Mohanram Anbukkarasu Syncfusion Team July 23, 2021 10:43 AM UTC

Hi Nikita, 

Thanks for contacting Syncfusion support.  

SfDataGrid is not a cell oriented control. It is data bound grid control. So it is not possible to directly get a cell and set a value for the cell as you mentioned. However, you can set value for a cell using the row and column index by using the this.SfDataGrid.View.GetPropertyAccessProvider(). Please refer the below given help documentation. 


Please let us know if you require any other assistance from us. 

Regards, 
Mohanram A. 


Loader.
Up arrow icon