cannot convert target type - VC++.NET
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hello i am using datagrid control in Vc++.net. when i set a float value to a cell, it returns the fol error. my code is *********** Datagrid->set_Item(1,1,System::Convert::ToSingle(textBox1->Text) ); Error ******** error C2664: 'void System::Windows::Forms::DataGrid::set_Item(int,int,System::Object __gc *)' : cannot convert parameter 3 from 'float' to 'System::Object __gc *' The datagrid columns are of float type. otherwise if i use toString function, Datagrid->set_Item(1,1,System::Convert::ToSingle(textBox1->Text) ); it compiles well but, returns runtime error, cannot convert from target type to primitive type.. Pls help me Salai