zimcoder Level: VB Lord

 Registered: 27-10-2003 Posts: 225
|
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
 
|