回复 2楼iceman的帖子
我的开发环境是vb2010,你看下我这么写是不是错误的。
C#代码
c1TrueDBGrid1.FetchCellStyle += new C1.Win.C1TrueDBGrid.FetchCellStyleEventHandler(c1TrueDBGrid1_FetchCellStyle);
到vb写为AddHandler C1TrueDBGrid1.FetchCellStyle, AddressOf C1TrueDBGrid1_FetchCellStyle。
然后private void c1TrueDBGrid1_FetchCellStyle(object sender, C1.Win.C1TrueDBGrid.FetchCellStyleEventArgs e)
{
C1NWindDataSet.EmployeesRow row = c1NWindDataSet.Tables[0].Rows[c1TrueDBGrid1.RowBookmark(e.Row)] as C1NWindDataSet.EmployeesRow;
//C1NWindDataSet2.CategoriesRow row = c1TrueDBGrid1[e.Row] as C1NWindDataSet2.CategoriesRow;
e.CellStyle.ForegroundImage = GetImageFromByteArray(row.Photo);
e.CellStyle.ForeGroundPicturePosition = C1.Win.C1TrueDBGrid.ForeGroundPicturePositionEnum.PictureOnly;
}
到vb写为Private Sub C1TrueDBGrid1_FetchCellStyle(sender As Object, e As C1.Win.C1TrueDBGrid.FetchCellStyleEventArgs) Handles C1TrueDBGrid1.FetchCellStyle
Dim dr1 As DataRow
dr1 = idst_data.Tables("TBGIS_CUSTOMER").Rows(e.Row)
e.CellStyle.ForegroundImage = GetImageFromByteArray(dr1("Image"))
e.CellStyle.ForeGroundPicturePosition = C1.Win.C1TrueDBGrid.ForeGroundPicturePositionEnum.PictureOnly
End Sub。
现在这样写出现的问题是无限循环,是不是我哪里写错了? |