Hi, guys --
I''d like to have a Grid Cell that behaves like this:
- In the Grid cell, a ComboBox control displays.
- Click on the ComboBox control, and a popup window displays a CheckedListBox control. The user clicks one (or more) items, then clicks "OK" to close the poup.
- The Grid cell now also displays the text of the selected item(s) separated by a programmer-cusomizable delimiter, like a comma.
First question is: Do you have any samples that do this?
Second question is: If not, do you have any samples that show quick & easy how to display a combobox control in the Grid Cell and, when clicked, displays a Syncfusion PopupContainer? The rest I''ll be able to figure out easily.
Thought I''d check just in case...
I should add that if you have any samples that show how to use a custom Popup container with the Cell''s Combobox, that would be great! Because there are several other types of custom popups that we''d like to create.
I didn''t notice any in the otherwise excellent selection of Grid samples...
ADAdministrator Syncfusion Team March 2, 2004 10:14 AM
It is straight-forward to derive a cell control and popup up modal form. It takes a little more effort to display something in a popup window due to the focus issues involved. Below is a sample that has 2 derived cell controls. One pops up a modal form by deriving from the static cell control. The other shows a UserCOntrol in a popup window by deriving the GridDropDownCell control. This class handles the focus issues.
AHAnthony HandMarch 2, 2004 03:43 PM
Thanks for the great sample, Clay!
AHAnthony HandMarch 2, 2004 05:04 PM
Apparent bug in the sample...
The sample very nicely shows two ways to implement a Grid Cell with a drop-down control in the cell which, when clicked, displays a popup window. One version of the popup is a Form, the other is a UserControl.
There appears to be a bug in the UserControl version, however.
After the user makes a new selection of items in the CheckedListBox and clicks OK, the text of the selected items is NOT displayed in the Grid Cell. Well, at first it does, but then the new Cell.Text values are overwritten by whatever the original values were when the cell was first initialized.
The derived Form works fine, however. And wouldn''t you know it, I''d prefer to use the UserControl version instead...
When you have a moment, would you be able to see why it does that? I''ll continue looking for possible answers, as well.
ADAdministrator Syncfusion Team March 2, 2004 06:26 PM
Using 2.0.2.x, I do not see this behavior. If I drop the bottom cell, and select choice 1, and then click OK, I see 3 choices in the cell. If I tab to the next cell or click on another cell, the three values are still there.
Do you see some other behavior in the sample? If so, what version of our DLLs are you using?
ADAdministrator Syncfusion Team March 2, 2004 06:40 PM
I''m using 188.8.131.52.
I did some poking around and may have discovered the issue.
In the DropDownUserCellRenderer.OnSaveChanges() method, we assign the Cell.Text its new value. Unfortunately, those new values didn''t seem to propagate to the renderer''s ControlText property. So by adding the line:
this.ControlText = newValues;
It''s now working fine.
>Using 2.0.2.x, I do not see this behavior. If I drop the bottom cell, and select choice 1, and then click OK, I see 3 choices in the cell. If I tab to the next cell or click on another cell, the three values are still there.
>Do you see some other behavior in the sample? If so, what version of our DLLs are you using?
ADAdministrator Syncfusion Team March 3, 2004 02:46 AM
I see what you mean. You are saying when you drop the usercontrol a second time (without leaving the cell), the user control is initialized with the old values.
I think your change is OK to handle this problem.
But it can also be handled with a slightly different DropDownContainerCloseDropDown override, setting the ControlValue at that point. Here is the sample modified to do this plus it has modified so the UserControl fires events when you hit cancel or save. This allows the renderer to subscribe to these events, and thus removes the necessity for the usercontrol to have access to the grid. This isolates the usercontrol from any knowledge of the grid or renderer.