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 

{} issue in tree control

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



Joined: 07 Nov 2007
Posts: 24

PostPosted: Mon Oct 25, 2010 3:27 pm    Post subject: {} issue in tree control Reply with quote

Hi Infralution team,

here is the sample I met the {} issue. here i want to set the cell value in the tree GetCellData event handler, so i set e.CellData.Format as following:
e.CellData.Format = string.Format("{0}{1}", folder.Code, folder.IsDescriptionNull() ? "" : " - " + folder.Description);
if the folder.Description contains {}, the tree control gets corrupt.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Oct 26, 2010 12:24 am    Post subject: Reply with quote

The Format property must be set to a valid format string. It can (but doesn't have to) contain a placeholder for the cell Value eg "{0}". If you want to include { or } characters that are not part of the placeholder then you must escape them (by doubling them). For instance if you wanted the actual cell text to be "{MyTitle: MyValue}" where MyValue was the cellData.Value then your format string would need to be:

"{{MyTitle: {0}}}"

An alternative is to set the CellData.Format = null and set the CellData.Value to the text you want to display directly. If the CellData.Format is null then the cell value is not formatted using the Format but is just displayed directly. This won't work however if you are using an editor control to edit the cell value and you want the displayed cell text to be different to the value that is edited and stored in the data.

The next release of Virtual Tree (3.16.0) will have an explicit property "FormatCellText" to control whether the cell text is formatted (rather than just checking if CellData.Format is null).
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
mutouaa



Joined: 07 Nov 2007
Posts: 24

PostPosted: Tue Oct 26, 2010 2:31 am    Post subject: Reply with quote

thank you very much for your quick reply
Back to top
View user's profile Send private message
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