Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.7 KB

File metadata and controls

29 lines (23 loc) · 1.7 KB

WinForms Data Grid - Create an in-place PopupContainerEdit with dynamic popup content

This example creates a separate UserControl with data editors for each popup window. The example handles the QueryPopup event to display the required UserControl inside the PopupContainerControl.

private void OnDetailsEditQueryPopup(object sender, CancelEventArgs e) {
    PopupContainerEdit edit = (PopupContainerEdit)sender;
    if ((bool)gridView1.GetFocusedRowCellValue(colUseGrid)) {
        edit.Properties.PopupControl.Controls.Add(gridEditor);
        edit.Properties.PopupControl.Size = GridEditorSize;
    } else {
        edit.Properties.PopupControl.Controls.Add(simpleEditor);
        edit.Properties.PopupControl.Size = SimpleEditorSize;
    }
}

Files to Review