We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Drop-down for combobox in grid doesn''t appear in the right place

Any idea why this might happen? (See attachment please.)

In the image, the highlighted row was clicked, on the column labeled "Target Type." On the top left of the grid appears the drop-down for that cell.

Other times, the drop down will appear underneath the corresponding cell another row.

The grid has a series of nested tables. The underlying data for the grid looks something like this.

ROW1 (hidden)
-SUBROW1
-SUBSUBROW1
-SUBSUBROW2 (in this row, the cell was clicked)
ROW2 (hidden)
-SUBROW2
-SUBSUBROW3

Any ideas on how to deal with this?

Thanks in advance,

Eric

dropdown4.zip

2 Replies

AD Administrator Syncfusion Team March 13, 2007 03:08 PM UTC

Hi Eric,

I am not sure of what be might be causing this strange behavior without a working sample. But one way you can control dropdown location by deriving the DropDownWindow and adjust the location of the DropDown container. Here is a small sample where the DropDown window is dislocated from its default position. Here, I have derived ComboBoxCellModel and ComboBoxCellRenderer and override the OnLayout method to achieve the same in the attached sample.

Best regards,
Haneef

Note:
ComboBox is a combination of TextBox and ListBox. PopupHost is the one that holds the combo box''''s ListBox control. This is the class where the popup is shown and the point to show is calculated. Class hierarchy looks like this: System.Windows.Forms.Form >> Syncfusion.Windows.Forms.TopLevelWindow >> Syncfusion.Windows.Forms.DropDownWindow >> Syncfusion.Windows.Forms.PopupHost.


AF Alex Feldman April 10, 2013 03:31 PM UTC

Is it possible to update the example with custom size user control used for dropdown.

I have override two following methods and could not find the way to move dropdown location correctly.

public override void DropDownContainerShowingDropDown(object sender, CancelEventArgs e)
{
    DropDownContainer.Size = ddUser.Size;
}

protected override Rectangle OnLayout(int rowIndex, int colIndex, GridStyleInfo style, Rectangle innerBounds, Rectangle[] buttonsBounds)
        {
            DropDownContainer.Location = new Point(-100, 0);
            return base.OnLayout(rowIndex, 1, style, innerBounds, buttonsBounds);
        }


Loader.
Live Chat Icon For mobile
Up arrow icon