I have added the following event handler to my tree:
private void treeHierarchy_InitializeDataNode(object sender, InitializeDataNodeEventArgs e)
{
if (e.Node.Cells.Exists("ImageKey"))
e.Node.Cells[
"ImageKey"].Appearance.Image = e.Node.Cells["ImageKey"].Value;
}
The only time the Image property is set is if I set a breakpoint on the IF statement, and examine the Key value (e.Node.Cells[0].Key) in the Immediate window, and then continue execution. Otherwise, the Image property is not set. I'm beginning to believe that Quantum theory applies to large particles :)
Is there another safer way to accomplish this task. I return a ImageKey (integer) from the database which indicates which image to display in the column. I'd like to display the image in the "ImageKey" column, and hide the image key (integer).
What do you think is causing my strange behavior? And, how can I hide the image key (integer)?
In fact, replacing the IF statement with the statement below works just fine?
if (e.Node.Cells.Count > 0)
Hi,
Well, that's clearly not right. What version of the control are you using? Make sure you have the latest service release. This may already be fixed.
If that doesn't help, I recommend that you try to duplicate the issue in a small sample project and submit it so we can check it out. You can either post your sample here or else Submit an incident to Infragistics Developer Support