indu
indu

Reputation: 907

How to Display a DataGrid with Insert Mode without any pre-filled data?

How to display the datagrid in insert mode without any data in it.

The GridView is empty and contains only one header.

I want to insert the data in the GridView when the application is running.

Upvotes: 1

Views: 1825

Answers (3)

Max
Max

Reputation: 2571

Please have a look at these 2 examples:

Upvotes: 1

Filip Ekberg
Filip Ekberg

Reputation: 36317

What you could do is using an empty Binding Source to a List which would enable you to add new Rows.

Check out some samples of how to use the Binding Source here

Upvotes: 1

Rune Grimstad
Rune Grimstad

Reputation: 36330

I don't think the datagrid will be rendered if its data source is empty. To work around this problem you can give it a data source with only one item that is regarded as empty (for example a data table with one row where all columns have empty values). You can then check for this special case in your program logic.

Upvotes: 0

Related Questions