views:

148

answers:

1

I´m using Visual Studio 2008, C#

DataGridView: can you add an unbound column to a Data Bound grid?

It seems pretty simple, just select the properties ("DataGridView Tasks box") for the data bound DataGridView, and select Add unbound column. However, when in runtime there will be a System.FormatException - which I can understand, as I don´t know how to "initialize" the cells in the new unbound columns.

I was planning initializing it programmatically via CellFormatting event - but so far I´m failing.

Any tips? Just want to get it up and running in SOME way...

A: 

What type of data formatting would you like to have? And what is the value Type you would like to add to that column?

Maybe this can help:

In the Designer -> Edit Columns... if you select your new unbound column you have an Appearance section.

If you click to DefaultCellStyle inside you can find, under Behavior, the Format property. From there, you can choose the Format for your column.

marco.ragogna