c# - How to retrieve data from node in XtraTreeList.TreeList? -
I am using XtraTreeList.TreeList to display hierarchical data. The data is stored in my custom business objects, which implement DevExpress.XtraTreeList.TreeList.IVirtualTreeListData.
While the column "name" of the data is usually displayed on, retirieved by the following code:
(DevExpress.XtraTreeList.VirtualTreeGetCellValueInfo information public void VirtualTreeGetCellValue) {if (info .column.FieldName == "name") info.CellData = root.providers [ProvGroup.Key] ;; If (info.Column.FieldName == "imageindex") info.CellData = imageIndex; } I have met difficulties in providing a suitable image index for nodes.
To keep it just, I do not know how to provide it. I Trolist have tried to set the ImageIndexFieldName List "Imejindaks" and custom Drayod image impression is to be managed in this way:
void Boundtrycostdroud Images (object sender, Devakspres.akstatryelaist. CustomRediodSizeSewgentargesE) {E. State Image = E. State Image Index = (int) (e.Node.GetValue ("ImageIndex") ?? - 1); E.Handled = false; } Although it does not produce any results.
What do I want to do to implement IVirtualTreeListData to my behavior that matches a node, but how can it be done? Node to get data from this node in the document. It is recommended to use a gate value (column), but when it is executed, IVirtualTreeListData.VirtualTreeGetCellValue are just not said. It appears that nodes are once filled with data related to the column and then the business object is not used (well, maybe the data is set up, but not in my case).
I would be grateful for any insights.
If you have node , you can get by using the built-Datasors can treeControl.GetDataRecordByNode (e.Node) in this example would look like this:
private void BoundTree_CustomDrawNodeImages (object sender, the DevExpress XtraTreeList.CustomDrawNodeImagesEventArgs e) {var myType = (MyType) BoundTree.GetDataRecordByNode (e.Node); E.StateImageIndex = myType.ImageIndex ?? -1}
Comments
Post a Comment