I have a grid that I want to pop up in a new window. The code I am using is below. The table is populated with the right data all the way through. The only problem is, when the new winform pops up, it immediately disappears. Also, it's not displaying the data in the grid. I can't figure out what I'm doing wrong. Any ideas?
private void gridView1_ShowGridMenu(object sender, DevExpress.XtraGrid.Views.Grid.GridMenuEventArgs e)
GridView view = sender as GridView;
GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
var rowData = gridView1.GetRowCellValue(hitInfo.RowHandle, "SP");
string rowDataSplit = rowData.ToString().Split(':');
using (frmInterfaceLogSelection form = new frmInterfaceLogSelection(Services))
var sql = rowDataSplit.ToString();
var ds = Services.RunSql(sql);
var table = ds.FirstTable();
if (table == null)
var error = Services.LastSqlResultError;
if (error.Length > 0)
this.gridControl1.DataSource = table;
It's because you are disposing of the form.
using statement disposes the form after
form.Show(), so it disappears.
You likely need to dispose your SQL connection/service connection, rather than your form.
Try using show dialog