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.
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.
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.
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.
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.