I have a DataGrid that is filled out of Data retrived from a VFP-Database. My issue is that there is a Column with decimal values, that I want to convert to strings in order to write in some text. I have tried to convert te cells or the entire column to string, but it doesnt work as expected.
I have used the following commands (not all together
1) dataGrid.Columns["hot_kunde"].CellTemplate.ValueType = typeof(string);
2) dataGrid.Columns["hot_kunde"].ValueType = typeof(string);
3) for (int i = 0; i < dataGrid.RowCount; i++)
{
dataGrid.Rows[i].Cells[1].ValueType = typeof(String);
dataGrid.Rows[i].Cells[1].Value = "test";
}
If I use a MessageBox to see the new type it shows "System.String", nevertheless all of theese commands throw the same exception saying that a decimal value is expected.
What do I do wrong? Any ideas?

New Topic/Question
Reply



MultiQuote




|