Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-18-2006, 06:19 AM   #1 (permalink)
rikb53
Registered User
 
Join Date: Jan 2006
Posts: 29
rikb53 is on a distinguished road
boundColumn,TemplateColumn,ButtonColumn

guys, can i have a bound column, then a template column and then a button column.
Everything works for me except when i put the Template column in - thats when it blows up.
i want to pass to the DataBinder.Eval, the path of the image, so the image will change based on the string path i pass. this has got to be doable if i can use the Text Field of the Button column to pass an image path as well.
any help here is appreciated
general code is below
thanks
rik

<Columns>
<asp:BoundColumn DataField="Enabled" HeaderText="Enabled">
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="ImageHere" >
<ItemTemplate>
<asp:image Runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "EnabledImg") %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn ButtonType="LinkButton" Text="&lt;img src=Images/Enable.gif border=0&gt;" HeaderText="Change Enable"
CommandName="Enable">
</asp:ButtonColumn>
</Columns>
rikb53 is offline   Reply With Quote
Old 02-18-2006, 06:41 AM   #2 (permalink)
rikb53
Registered User
 
Join Date: Jan 2006
Posts: 29
rikb53 is on a distinguished road
Solved it by mixing in a Template Column,Using a asp:image
and then passing the string path based on a sql case statement. then the string returned is the path of the image.

<asp:TemplateColumn HeaderText="IsEnabled">
<ItemTemplate>
<asp:image Runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "EnabledImg") %>' >
</asp:image>
</ItemTemplate>
</asp:TemplateColumn>
rikb53 is offline   Reply With Quote
Reply

Bookmarks

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

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



All times are GMT -8. The time now is 11:04 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting