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 

How to access Field property in GetCellData handler?

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



Joined: 08 Dec 2005
Posts: 15

PostPosted: Wed Apr 12, 2006 4:58 pm    Post subject: How to access Field property in GetCellData handler? Reply with quote

In the Virtual Tree Tree Editor I can during design time (in the Data Binding tab) create an object binding where I specify that for a particular type of object the value of the column should be fetched from the property named in "Field" when I've selected that column in the binding tree.

Now, I've a GetCellData handler that gets called. In that handler I've got access to row and column. What I would like to do is to get the definied bindings for the column so I can access the property defined during design time. I need this since I have a mix of predefined columns and columns added dynamicaly during run-time. For the predefined columns I just want to access the specified property in the GetCellData handler.
_________________
Kind regards

Magnus Werner, System Architect
------------------------------------------
Saab Training Systems AB
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Apr 12, 2006 10:53 pm    Post subject: Reply with quote

Normally if you want to mix programmatic and design time bindings you do the following sort of code:

Code:

if (e.Column == this.colCustom)
{
    // do your programmatic stuff
}         
else
{
   // use the default binding to get the cell data
   //
   RowBinding binding = _virtualTree.GetRowBinding(e.Row);
   binding.GetCellData(e.Row, e.Column, e.CellData);
}


If you do actually want the information from the CellBinding (such as the Field) for some reason, then you can get it through the row binding eg

Code:
rowBindingCustomers.CellBinding(colCompanyName).Field

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
mwe



Joined: 08 Dec 2005
Posts: 15

PostPosted: Thu Apr 13, 2006 8:20 am    Post subject: Reply with quote

Thanks as usual You gave the right answer as well as the answer I asked for Smile .

Yes, it was really the first alternativ I needed. I was trying to achive that the hard way.
_________________
Kind regards

Magnus Werner, System Architect
------------------------------------------
Saab Training Systems AB
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