473,396 Members | 1,756 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,396 software developers and data experts.

Using Custom Expressions w/ GridView Buttons

I have a drop-down list the I want to use to control the visibility of
button fields. Here's an example of one of my button fields,

<asp:ButtonField Visible='<%$ Code:ddlReason.SelectedValue =
Status.Review %>' CommandName="Review" Text="Review" />
The value of ddlReason.SelectedValue within the custom expression is
constant even if I select another value from the dropdown. Why does
this occur?

The code for the custom expression builder is,

<ExpressionPrefix("Code")_
Public Class CodeExpressionBuilder
Inherits ExpressionBuilder
Public Overrides Function GetCodeExpression(ByVal Entry As
System.Web.UI.BoundPropertyEntry, ByVal ParsedData As Object, ByVal
Context As System.Web.Compilation.ExpressionBuilderContext) As
System.CodeDom.CodeExpression
Return New CodeSnippetExpression(Entry.Expression)
End Function
End Class

Cheers,
Aeden

Jul 13 '07 #1
2 2048
On Jul 14, 5:18 am, "aeden.jame...@gmail.com"
<aeden.jame...@gmail.comwrote:
I have a drop-down list the I want to use to control the visibility of
button fields. Here's an example of one of my button fields,

<asp:ButtonField Visible='<%$ Code:ddlReason.SelectedValue =
Status.Review %>' CommandName="Review" Text="Review" />

The value of ddlReason.SelectedValue within the custom expression is
constant even if I select another value from the dropdown. Why does
this occur?

The code for the custom expression builder is,

<ExpressionPrefix("Code")_
Public Class CodeExpressionBuilder
Inherits ExpressionBuilder

Public Overrides Function GetCodeExpression(ByVal Entry As
System.Web.UI.BoundPropertyEntry, ByVal ParsedData As Object, ByVal
Context As System.Web.Compilation.ExpressionBuilderContext) As
System.CodeDom.CodeExpression
Return New CodeSnippetExpression(Entry.Expression)
End Function
End Class

Cheers,
Aeden
hi,
did you set autopostback=true to your dropdown??
nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd

Jul 14 '07 #2
On Jul 13, 10:57 pm, nahid <nahid...@gmail.comwrote:
On Jul 14, 5:18 am, "aeden.jame...@gmail.com"

<aeden.jame...@gmail.comwrote:
I have a drop-down list the I want to use to control the visibility of
button fields. Here's an example of one of my button fields,
<asp:ButtonField Visible='<%$ Code:ddlReason.SelectedValue =
Status.Review %>' CommandName="Review" Text="Review" />
The value of ddlReason.SelectedValue within the custom expression is
constant even if I select another value from the dropdown. Why does
this occur?
The code for the custom expression builder is,
<ExpressionPrefix("Code")_
Public Class CodeExpressionBuilder
Inherits ExpressionBuilder
Public Overrides Function GetCodeExpression(ByVal Entry As
System.Web.UI.BoundPropertyEntry, ByVal ParsedData As Object, ByVal
Context As System.Web.Compilation.ExpressionBuilderContext) As
System.CodeDom.CodeExpression
Return New CodeSnippetExpression(Entry.Expression)
End Function
End Class
Cheers,
Aeden

hi,
did you set autopostback=true to your dropdown??

nahidhttp://nahidulkibria.blogspot.com/http://www.kaz.com.bd- Hide quoted text -

- Show quoted text -
Yes it is.

Jul 15 '07 #3

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

Similar topics

1
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be...
1
by: ABC | last post by:
I have an idea. I need to write a common gridview block which contains labels, textboxs, one girdview and some buttons. Then, I think the above block will apply on several girdview with...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
0
by: NateDawg | last post by:
Ok, I’ve noticed a few gridview problems floating around the forum. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state...
1
by: Mark Olbert | last post by:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So far I've spent going on two days trying to get the following...
9
by: lilOlMe | last post by:
Hi there! I have generated a GridView that looks something like: SportName| CompanyNameX |CompanyNameY |CompanyNameZ Hockey.....| Shipping------------ |Accounting-------- |Shipping------------...
1
by: neobonzi | last post by:
Hello! I'm dynamically creating a GridView bound to a datatable using custom template columns using the following method: protected void ShowGrid(DataTable dt) { ...
2
by: selvasofti11 | last post by:
hi, i have to create a custom control for gridview (with additional features like a-z buttons at bottom.. go to page button, search button).. i dont know how to .. please help me.. thank you ...
0
by: Andy B | last post by:
I have set up for the GridView to auto generate delete buttons for each row. I was wondering if I can put custom code in the Row_Deleting event to handle some custom processing while the GridView...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.