IT Community - Software Programming, Web Development and Technical Support

Is it possible to use a dynamic image button in datagrid control?

This is a discussion on Is it possible to use a dynamic image button in datagrid control? within the C# Programming forums, part of the Software Development category; I have a SqlDataSource that returns name, state and key. I have a gridview control that I want to have ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-29-2008, 09:19 PM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Is it possible to use a dynamic image button in datagrid control?

I have a SqlDataSource that returns name, state and key. I have a gridview control that I want to have 3 columns. Column 1 & 2 are bound with the datafield and third column to display imagebutton. . The possible images for the button are stored in a web directory so I would need to set the button ImageUrl to http://+ key from datasource + .jpg from the C# code behind ?
__________________
Shaalini.S
Be the Best of Whatever you are...

Last edited by shaalini : 01-29-2008 at 09:24 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-09-2008, 11:12 PM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: Is it possible to use a dynamic image button in datagrid control?

Hi,
I dont think that there is necessity to add the image button in the GridView dynamically because the third column is anyway going to be a column with image buttons right? Only thing is you are going to bind the image source dynamically.And you can do that by

<asp:ImageButton ID='lblButton' ImageUrl='<%# Eval("url") %>' runat="server" />

The value url must be assigned from the server side.
__________________
Sathish Kumar.R
Knowledge is meant to SHARE

Last edited by Sathish Kumar : 03-10-2008 at 12:14 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing the Image file thumbnail view in ListView control using VC++ 6.0 prabhat.singh C and C++ Programming 0 01-17-2008 10:53 PM
How to create an image from panel background Image S.Vinothkumar C# Programming 1 10-22-2007 03:52 AM
use of Custom Control and User Control? a.deeban ASP and ASP.NET Programming 1 08-20-2007 08:25 AM
I am having checkbox in datagrid and treeview, while click the button i need to check kingmaker C# Programming 3 08-14-2007 09:39 AM
Can I make a button on my page work as the browser's Back button in javascript? kingmaker HTML, CSS and Javascript Coding Techniques 1 07-26-2007 01:27 AM


All times are GMT -7. The time now is 02:39 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0