Dong Lam Trien

Dong Lam Trien

  • 830
  • 986
  • 147.6k

Using Thread read data of the gridView1 ?

Aug 24 2016 9:27 PM
I'm writing code read data of gridView1 has got using Thread but get an error:
[CODE]
// old-style writing
if (string.IsNullOrEmpty(gridView1.GetRowCellValue(i, "Ghichu").ToString()))
//new style writing
if (string.IsNullOrEmpty(GetGridCellValue(i, "Ghichu").ToString()))
//Declare complement the new style writing
public delegate void GridGetEventArg(int rowHandle, string fieldname);
private string GetGridCellValue(int row, string fieldname)
{
if (gridControl1.InvokeRequired)
{
GridGetEventArg get = new GridGetEventArg(GetGridCellValue); //Error 1 'string Vidu.frmTinh.GetGridCellValue(int, string)' has the wrong return type
return gridControl1.Invoke(get, new object[] { row, fieldname });//Error 2 Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
}
else
{
return (gridControl1.MainView as GridView).GetRowCellValue(row, fieldname);//Error 3 Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
}
}
[/CODE]
the help you fix ?

Answers (1)