Hi,
Marc Gravell schrieb:
I added (before Application.Run):
I can't do that because it is an MDI application and my MDI windows may
be opened or not.
>
...
and it is reporting Int32 (not String); can you reproduce this
behaviour in a short (but complete) example?
Yes, here ist a short example:
namespace TestApp2008
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
dataGridViewTest.Rows.Add();
DataGridViewComboBoxCell lComboBoxCell =
(DataGridViewComboBoxCell) dataGridViewTest.Rows[0].Cells[0];
lComboBoxCell.DataSource = new int[] { 1, 2, 3, 4, 5 };
}
private void dataGridViewTest_CellEndEdit(object sender,
DataGridViewCellEventArgs e)
{
object loValue =
dataGridViewTest.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
string lstrMsg = string.Format("Row:{0}, Col:{1}, Type:{2}",
e.RowIndex, e.ColumnIndex, loValue.GetType());
System.Diagnostics.Trace.WriteLine(lstrMsg);
}
}
}
And the result is:
Row:0, Col:0, Type:System.String
>
Marc
Best regards
Martin