Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Auto adjust size in DropDownEditorButton
posted

Hello. I`m using DropDownEditorButton to create a dropDown cell in a grid, containing list if checkboxes. 

1) How can I auto adjust size of DropDown container, so with of container was equals to with of cell?

2) I`ve got a cell with a dropdown, but when user clicks on a dropdown button - nothing happened. Only after user`s doubleclick on a cell (to switch it in an edit mode), user can use a dropdown button. How can I bypass this?

My code is:

 

 UltraListView listView = new UltraListView();

                listView.Items.AddRange(items.ToArray());

                listView.ItemSettings.AllowEdit = DefaultableBoolean.True;

                listView.View = UltraListViewStyle.List;

                listView.ViewSettingsList.CheckBoxStyle = CheckBoxStyle.CheckBox;

                listView.ItemCheckStateChanged += ReportCheckChanged;

 

                listView.ViewSettingsList.MultiColumn = false;

                listView.ViewSettingsList.ImageSize = System.Drawing.Size.Empty;

                DropDownEditorButton button = new DropDownEditorButton

                {

                    Control = listView

                };

 

                reportsTextEditor_ = new UltraTextEditor {ReadOnly = true};

                reportsTextEditor_.ButtonsRight.Add(button);

 

                valueCell.EditorControl = reportsTextEditor_;

                valueCell.Style = ColumnStyle.Edit;

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    archeg said:
    1) How can I auto adjust size of DropDown container, so with of container was equals to with of cell?

    The size of the dropdown is determined by the size of the DropDownEditorButton.Control. So resize the control to whatever size you want. In this case, you probably want to use the BeforeCellListDropDown event of the grid so you can size it to the cell just before it drops down.

    archeg said:
    2) I`ve got a cell with a dropdown, but when user clicks on a dropdown button - nothing happened. Only after user`s doubleclick on a cell (to switch it in an edit mode), user can use a dropdown button. How can I bypass this?

    I'm not sure if there's any way to do this. You should post this question in the ListView forum. This forum is for WinGrid.

Children
No Data