borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Dynamically Creating Controlls in VB.net)Next Topic (Crystal Report Formula field related question?) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : How to insert picture in the cell of the datagrid ?
Poster Message
tri_inn
Level: Regular User
Registered: 26-08-2002
Posts: 395

icon How to insert picture in the cell of the datagrid ?

please tell me how can i insert picture in the cell of the datagrid and provide small sample code.

03-12-2003 at 01:22 PM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: How to insert picture in the cell of the datagrid ?

do you want to add this Image dynamically or during design time?

You must first add a template column to your columns collections in the datagrid. You then add an item teplate to your template column and finally the asp image tag. In the tag you can set the necessary attributes.. such as ImageUrl , imagealiagn etc..

here is one example of dynamically adding the url in the column.

<asp:TemplateColumn HeaderText="MyImages">
<ItemTemplate>
<asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem,"Image")%>' ImageAlign=AbsBottom>
</asp:Image>
</ItemTemplate>
</asp:TemplateColumn>


if you are adding the image at design time you can set the ImageUrl attribute to point to where your image is

____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

03-12-2003 at 03:31 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : How to insert picture in the cell of the datagrid ?
Previous Topic (Dynamically Creating Controlls in VB.net)Next Topic (Crystal Report Formula field related question?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder