Forma 1 adet contextMenuStrip1 ve 1 adet saveFileDialog1 at gridControl1de ki dataları excele kaydetmek için;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;
contextMenuStrip1 tıkla Excele kaydet item yarat ve çift tıkla ve yaz;
//excele kaydet
string filename;
saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx";
saveFileDialog1.FilterIndex = 2;
saveFileDialog1.RestoreDirectory = true;
saveFileDialog1.ShowDialog();
filename = saveFileDialog1.FileName;
if (filename == "") filename = ""; else gridView1.ExportToXlsx(filename);
Daha sonra gridcontrola tıkla ve contextmenustripini contextMenuStrip1 olarak seç
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;
contextMenuStrip1 tıkla Excele kaydet item yarat ve çift tıkla ve yaz;
//excele kaydet
string filename;
saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx";
saveFileDialog1.FilterIndex = 2;
saveFileDialog1.RestoreDirectory = true;
saveFileDialog1.ShowDialog();
filename = saveFileDialog1.FileName;
if (filename == "") filename = ""; else gridView1.ExportToXlsx(filename);
Daha sonra gridcontrola tıkla ve contextmenustripini contextMenuStrip1 olarak seç