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.
hej, I am trying to add a Image to my GridDataBoundGrid...
I am useing this code :
void GridQueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
e.Style.CellType = "PictureBox";
e.Style.CellValue = GetImage("filename.gif");
e.Style.CellValueType = typeof(Image);
}
I tryed "PictureBox", "ImageCell", "Image", non of em worked...
GetImage() returns a Image obj.
Can any help me ???
thx!
I forgot to tell that, the row has this text = "System.Drawing.Image"...
:o)
ADAdministrator Syncfusion Team August 12, 2005 11:32 AM UTC
Just try these two properties (don''t set the CellValueType) using "Image" as the celltype.
e.Style.CellType = "Image";
e.Style.CellValue = GetImage("filename.gif");
And things will work much better (faster) if you cache GetImage("filename.gif"); in a form variable and just use that variable in QueryCellInfo.
DEDeusAugust 12, 2005 11:43 AM UTC
Dident help :s
When I fill the Grid I use a DataTable:
DataTable dt = new DataTable("Table");
dt.Columns.Add("Image", Type.GetType("System.Int32"));
And I set it to 0...
ADAdministrator Syncfusion Team August 12, 2005 12:30 PM UTC
If you have a column in your database where you want to see an Int32 value used in the cell, and you also want to see an image in teh cell, then you have to:
1) Add the images you want to use to an ImageList object.
2) Set teh CellType on the column to "Static" or leave it unset so it defaults to "TextBox".
3) In QueryCellInfo for cells in this column, set
e.Style.ImageList = yourImageListObject;
e.Style.ImageIndex = someIntValueThatIsTheIndexOfTheImageInYourImageList;
Here is a little sample.
http://www.syncfusion.com/Support/user/uploads/GDBG_Images_79f698b0.zip