I am using NetAdvantage 10.3 Controls
Refer the attached Zip file for code.
I have a userControl with name FleetOverviewCarStatusSummaryControl.
I have an ultragrid ugFleetOverViewStatusSummary in a view named FleetOverView.
The cells in the above grid are loaded with ultracontrolcontainerEditor foUltraControlContainerEditor.
This editor has rendering control and EditingControl of same type i.e., FleetOverviewCarStatusSummaryControl
The view works fine and displays the data well.
Now the issue is, sometimes when clicked on a cell, the userCOntrol is showing blank controls. Please find the screen shots attached in the Zip file.
This is not happening everytine I click. But it happens sometimes. No Specific reproduction steps for that.
While trying to debug, I observed that Set property of userControl is called for every cell in a row, when a cell is clicked.
Please help in resolving this issue.
Hi,
I took a quick look at the screen shots and the code you attached here, but I don't see anything obviously wrong with it. If the issue is only happening sometimes, then it will be tough to track down. Could you provide a complete sample project we could run that duplicates the problem so we could investigate?
My best guess is that the controls of your usercontrol are somehow getting misaligned or shifted out of view or perhaps shrunk down to a size of 0. I noticed that some of your controls are using Docking, so it's possible that the docking is getting messed up at some point.
One way you could try to debug this is to handle the ControlAdded event of the grid. When the cell goes into edit mode, this event will fire and you can examine the control that was added to the grid and it's child controls to see what they are and their sizing and locations. I think the ControlContainerEditor creates a container and then your EditingControl is parented to that container, so you need to walk down into the Controls collection of the container and then into your UserControl's Controls collection, as well. So maybe you could write a method to recursively walk down the chain and display the results in the Output window. The might yield some clue about what's going on.
Hi Mike,
I have tried to implement ControlAdded event on ultragrid.
This event fires only once for a similar type of cell. when I click one cell event fires and then after clicking on any cell, the event doesn't fire.
One more issue with the user control (in sample attached previously). Whenever I click on a particular cell, the cell enters edit mode. Then am able to click the buttons in user control.
So user has to click twice to click a button in user control.
I have business logic to enable/ disable buttons in user control as in UpdateUi method of userControl.
I have set EnterEditModeMouseBehavior property of ultraControlContainerEditor to EnterEditModeAndClick to avoid one extra click.
Once this proprty is set, user is able to click a disabled button also, which throws an exception.