Zlatko Rusev
Top achievements
Rank 1
Zlatko Rusev
asked on 03 Nov 2009, 07:44 AM
Hello,
My question is how I can use in RadDataGrid a picture column using URL, not image from database
Best Regards
Zlatko Rusev
My question is how I can use in RadDataGrid a picture column using URL, not image from database
Best Regards
Zlatko Rusev
8 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 03 Nov 2009, 08:36 AM
Hi Zlatko Rusev,
You could use GridImageColumn to achieve the required functionality.
Set the ImageUrl property to a static value in order to appear the same in the entire column. You can set the DataImageUrlFields property to a field in the source that can be used to supply the image path and format it by setting the DataImageUrlFormatString property.
For more information, checkout the part "GridImageColumn" in the following documentation: Column types
-Shinu.
You could use GridImageColumn to achieve the required functionality.
Set the ImageUrl property to a static value in order to appear the same in the entire column. You can set the DataImageUrlFields property to a field in the source that can be used to supply the image path and format it by setting the DataImageUrlFormatString property.
For more information, checkout the part "GridImageColumn" in the following documentation: Column types
-Shinu.
0
Hi Zlatko,
You can use the built-in GridImageColumn for this purpose as presented on the following online demo of RadGrid for ASP.NET AJAX:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
Greetings,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You can use the built-in GridImageColumn for this purpose as presented on the following online demo of RadGrid for ASP.NET AJAX:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
Greetings,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Zlatko Rusev
Top achievements
Rank 1
answered on 04 Nov 2009, 07:17 PM
Hi,
Maybe I don't explain quite good, I meen WinForms GridView
And the pictures are stored in web site directory
Z.Rusev
Maybe I don't explain quite good, I meen WinForms GridView
And the pictures are stored in web site directory
Z.Rusev
0
Hello Zlatko Rusev,
RadGridView displays images either taken from a database or provided by the developer as Image objects. The rest of the scenario where the images are downloaded from a web site and converted to Image objects is custom and it requires implementation from your side.
If you have additional questions, feel free to contact me.
Best wishes,
Nikolay
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
RadGridView displays images either taken from a database or provided by the developer as Image objects. The rest of the scenario where the images are downloaded from a web site and converted to Image objects is custom and it requires implementation from your side.
If you have additional questions, feel free to contact me.
Best wishes,
Nikolay
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Zlatko Rusev
Top achievements
Rank 1
answered on 06 Nov 2009, 08:19 AM
Hi Nikolay,
Again, my application is Desktop one, and I have to use GridView (?) control for WinForms. It's not web site !
And other question is if a image (source -from directory) has random size, how I can set to be in custom size, and don't want free apace up & down of its in column cell
Thank you for answer
Z.Rusev
Again, my application is Desktop one, and I have to use GridView (?) control for WinForms. It's not web site !
And other question is if a image (source -from directory) has random size, how I can set to be in custom size, and don't want free apace up & down of its in column cell
Thank you for answer
Z.Rusev
0
Hello Zlatko Rusev,
My previous reply was about RadGridView for WinForms. When your images are not contained in a database, but they are contained at a custom directory, you need to create Image objects from them and assign these image objects to the cells in the GridViewImageColumn:
List<Image> images =
new
List<Image>();
private
void
Form1_Load(
object
sender, EventArgs e)
{
this
.customersTableAdapter.Fill(
this
.nwindDataSet.Customers);
GetImages();
GridViewImageColumn imageCol =
new
GridViewImageColumn();
imageCol.UniqueName =
"Images"
;
this
.radGridView1.Columns.Add(imageCol);
for
(
int
i = 0; i <
this
.radGridView1.Rows.Count; i++)
{
this
.radGridView1.Rows[i].Cells[
"Images"
].Value = images[i];
}
}
private
void
GetImages()
{
// Fill the images list
}
As to your second question, you can resize an image by creating a new Bitmap from the Image objects that you get from the directory:
Bitmap resizedBitmap =
new
Bitmap(originalBitmap,
new
Size(12, 12));
Another option is to set the ImageLayout of the GridViewImageColumn to Stretch. This will make the image fill the cell:
GridViewImageColumn imageCol =
new
GridViewImageColumn();
imageCol.UniqueName =
"Images"
;
imageCol.ImageLayout = ImageLayout.Stretch;
this
.radGridView1.Columns.Add(imageCol);
I hope this helps. If you have additional questions, feel free to contact me.
Best wishes,
Nikolaythe Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Luca
Top achievements
Rank 1
answered on 25 Jun 2013, 09:10 AM
what if the bitmap is in 'Resources' like Properties.Resources.mypicture ?
thanks
luca
thanks
luca
0
Hello Luca,
It does not matter where your image is, you just need to assign an Image object as a cell value in the image column:
I hope this helps.
Best Wishes, Stefan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
It does not matter where your image is, you just need to assign an Image object as a cell value in the image column:
this
.radGridView1.Rows[0].Cells[
"Images"
].Value = Resources.Image11;
I hope this helps.
Best Wishes, Stefan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.