The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I load a huge amount of data into the grid (single column grid) where most of the rows contain images. The way I load image is
Dim sp As PictureBoxStyleProperties = New PictureBoxStyleProperties(e.Style) sp.SizeMode = PictureBoxSizeMode.Zoom sp.StyleInfo.HorizontalAlignment = GridHorizontalAlignment.Center sp.StyleInfo.VerticalAlignment = GridVerticalAlignment.Middle
Dim fs As New System.IO.FileStream(imgPath, IO.FileMode.Open, FileAccess.Read) Dim bm As New Bitmap(fs) fs.Close() fs = Nothing
sp.Image = bm
With this I get the Out of memory exception. So I wanted to make the image cells alone virtual. I expected thr QueryCellInfo event to be fired for a cell only when the cell is visible. But this is fired for all rows. I don't understand how to implement this.
Also when I load the grid initially I set a place holder image from the resource. Then when the grid is scrolled and a new image row becomes visible want to set the actual image to be displayed.
JSJeba S Syncfusion Team January 10, 2008 01:41 PM UTC
Hi Sudha,
Currently we are working for this .We will update you within one business day.
Thank you for being patient.
Best regards, Jeba.
HAhaneefm Syncfusion Team January 10, 2008 04:02 PM UTC
Hi Sudha,
You can use the PrepareViewStyleInfo/QueryCellInfo event to shows the image in a gridcell on demand. PrepareviewStyleInfo event does not store any styleInfo properties in a grid. It just set the visual apperence of the grid. Here is a code snippet that shows this task.
Private Sub gridControl1_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As PrepareViewStyleInfoEventArgs) If e.ColIndex = 5 Then Dim grid As GridControl = sender as GridControl Dim cellRange As GridRangeInfo = GridRangeInfo.Cell(e.RowIndex,e.ColIndex) If grid.ViewLay.VisibleCellsRange.IntersectsWith(cellRange) Then 'Visible Cell code here... 'e.Style.CellType = "PicturBoxCellType"; Else 'Non Visible Cells. End If End If End Sub