Using Thread read data of the gridView1 ?


Author
Message
Dong Trien Lam
Dong Trien Lam
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: Anonymous / Guest
Posts: 57, Visits: 251
I'm writing code read data of gridView1 has got using Thread but get an error:

// 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?)
            }
        }
the help you fix ?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search