Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
Image not showing up
posted

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)? 

Parents Reply Children
No Data