View previous topic :: View next topic |
Author |
Message |
jacemdom
Joined: 24 Oct 2016 Posts: 1
|
Posted: Mon Oct 24, 2016 9:24 pm Post subject: Disable particular row or cell editing |
|
|
Is it possible to disable the editing of only certain rows and or cells? |
|
Back to top |
|
 |
Infralution
Joined: 28 Feb 2005 Posts: 4815
|
Posted: Mon Oct 24, 2016 9:58 pm Post subject: |
|
|
Yes. To disable editing for specific rows you need to handle the GetCellData event. After using the default binding to populate the CellData you can then set the CellData.Editor to null as shown below.
Code: | private void _virtualTree_GetCellData(object sender, Infralution.Controls.VirtualTree.GetCellDataEventArgs e)
{
// get the default binding for the given row and use it to populate the cell data
//
RowBinding binding = _virtualTree.GetRowBinding(e.Row);
binding.GetCellData(e.Row, e.Column, e.CellData);
e.CellData.Editor = null;
}
|
This will prevent editing for all cells/rows so you would probably want to include a check based on e.Row.Item around setting the Editor to null. _________________ Infralution Support |
|
Back to top |
|
 |
ShannonMike
Joined: 18 May 2017 Posts: 1
|
Posted: Thu May 25, 2017 5:53 am Post subject: |
|
|
That's perfect Infralution. Some rows I just don't want to edit so this is super helpful. |
|
Back to top |
|
 |
|