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,
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.
udaysree6686 said:Once this proprty is set, user is able to click a disabled button also, which throws an exception.
What's the exception?
udaysree6686 said: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.
I guess the control gets re-parented to the grid only once. So you could use this event to store a reference to the control, then use AfterAnterEditMode to explore the child control of that control until you reproduce the problem.
If you observe the UpdateUi method, there is some business logic applied to the controls in user control. For example, hand Cursor is shown for clickable(enabled) buttons.That logic is applied only once after I click within the cell. So button has to be double clicked everytime.
To avoid this I have set EnterEditModeMouseBehavior to EnterEditModeAndClick. The button is directly getting clicked for first click itself.
But the changes in UpdateUI method ara not applied. For example, disabled button can be clicked, Hand cursor is not shown for clickable button.
This is not going to work. The way the ControlContainerEditor works is that the EditingControl is only shown over the cell in edit mode. The RenderingControl is used for all of the other cells (the ones that are NOT in edit mode). And what happens is that the editor sets the Value on the control and draws it into a Bitmap and then renders that Bitmap into the cell. So there can be no UI interactivity like hit-testing or changing the cursor over a cell that is not in edit mode, because it's just an image.