View previous topic :: View next topic |
Author |
Message |
mwe
Joined: 08 Dec 2005 Posts: 15
|
Posted: Wed Apr 12, 2006 4:58 pm Post subject: How to access Field property in GetCellData handler? |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Apr 12, 2006 10:53 pm Post subject: |
|
|
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 |
|
|
mwe
Joined: 08 Dec 2005 Posts: 15
|
Posted: Thu Apr 13, 2006 8:20 am Post subject: |
|
|
Thanks as usual You gave the right answer as well as the answer I asked for .
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 |
|
|
|