473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting Value from databound control in desgn mode

Hello,

I know that in a databound control I can render the value of a certain field
with the syntax <%#Eval("PROD_NAME")%>.
But how do I, in design mode (not in code behind), display something
depending on the value of a field.

<Gridview control....>

<ItemTemplate>
<%If #Eval("PROD_STOCK_SIZE") 0 then %>
...display some text....
<%End if%>

</ItemTemplate>

</Gridview control...>

This doen't work, what is the workaround?

Kind regards

Remco
Aug 22 '08 #1
1 1011
don't know vb, in c# its:

<%# ((int) Eval("PROD_STOCK_SIZE")) 0 ? "string 1" : "" %>

-- bruce (sqlwork.com)
"Remco" wrote:
Hello,

I know that in a databound control I can render the value of a certain field
with the syntax <%#Eval("PROD_NAME")%>.
But how do I, in design mode (not in code behind), display something
depending on the value of a field.

<Gridview control....>

<ItemTemplate>
<%If #Eval("PROD_STOCK_SIZE") 0 then %>
...display some text....
<%End if%>

</ItemTemplate>

</Gridview control...>

This doen't work, what is the workaround?

Kind regards

Remco
Aug 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: kscdavefl | last post by:
I ahve a datagrid on a web form. I need to change the value in column 3 as follows. If the value in column 3 reads 0, I want to change it to read YES. How can I accomplish this task. ...
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
12
by: Dennis | last post by:
I have a form which has a ListView control named ListView1 added at design time. When I add items using the following code, they don't appear in the list view. However, if I create a ListView...
6
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im...
1
by: Owen Blacker | last post by:
I've spent loads of time Googling to try to work this one out and I'm sure it's something obvious. I get an InvalidOperationException reading "Databinding methods such as Eval(), XPath(), and...
8
by: BB | last post by:
Hi, I am using FormView Contol, TextBox (Hidden ) and Submit button whose caption is "View Page" in my aspx page. Here is what I am tryin to do.When page loads I generate dynamic url in text box...
3
by: podi | last post by:
Hi, I just wonder if there is a way to set a selected item in dropdown list which items are retreived from database without touching c# code ? I mean, i have in gridview, in edit mode one...
1
by: mailbox73 | last post by:
Hi, c# 2008 express edition. Can anyone please help me figure out why I cannot get any value from one form to another when the controls are databound. (the formY.txtbox lands up empty) in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.