Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Disable particular row or cell editing

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
jacemdom



Joined: 24 Oct 2016
Posts: 1

PostPosted: Mon Oct 24, 2016 9:24 pm    Post subject: Disable particular row or cell editing Reply with quote

Is it possible to disable the editing of only certain rows and or cells?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Oct 24, 2016 9:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group