This example demonstrates how to:
- Create and customize a Popup Container editor.
- Assign the popup container editor to a grid column to display and edit cell values.
- Handle the QueryPopUp event to pass the cell value to the editor in the dropdown.C#
private void repositoryItemPopupContainerEdit1_QueryPopUp(object sender, CancelEventArgs e) { memoEdit1.EditValue = (sender as PopupContainerEdit).EditValue; }
- Handle the QueryResultValue event to post the modified value back to the grid cell.C#
private void repositoryItemPopupContainerEdit1_QueryResultValue(object sender, DevExpress.XtraEditors.Controls.QueryResultValueEventArgs e) { e.Value = memoEdit1.EditValue; }
Files to Review
Documentation
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)
Example Code
C#using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 5; i++)
dataTable1.Rows.Add(new object[] { i, "Text" + i });
}
private void repositoryItemPopupContainerEdit1_QueryResultValue(object sender, DevExpress.XtraEditors.Controls.QueryResultValueEventArgs e)
{
e.Value = memoEdit1.EditValue;
}
private void repositoryItemPopupContainerEdit1_QueryPopUp(object sender, CancelEventArgs e)
{
memoEdit1.EditValue = (sender as PopupContainerEdit).EditValue;
}
}
}