1

I am using devexpress with WinForms application. I created a GridView and i added a column. I want to insert a new row to this GridView. But when displayed there is nothing that has been shown.

Thats what i have tried:

public Form1()
{                
    InitializeComponent();
    loadData();
}

public void loadData()
{
    this.gridView1.AddNewRow();
    this.gridView1.SetFocusedRowCellValue(this.gridView1.Columns[0], "test");
}
Neuron
  • 5,141
  • 5
  • 38
  • 59
maher
  • 43
  • 8

1 Answers1

1

Devexpress grid should have a data source to function correctly. If you want a simple, in-memory data source, you can use DataTable. Set it as its data source.

DataTable dt = new DataTable();
dt.Columns.Add("mycolumn");
this.gridControl1.DataSource = dt;

Then it should work.

Savas Alp
  • 194
  • 2