Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Using Custom Expressions w/ GridView Buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aeden.jameson@gmail.com - 14 Jul 2007 00:18 GMT
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
nahid - 14 Jul 2007 06:57 GMT
On Jul 14, 5:18 am, "aeden.jame...@gmail.com"
<aeden.jame...@gmail.com> wrote:
> 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,
[quoted text clipped - 22 lines]
> Cheers,
> Aeden

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

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
aeden.jameson@gmail.com - 15 Jul 2007 08:03 GMT
> On Jul 14, 5:18 am, "aeden.jame...@gmail.com"
>
[quoted text clipped - 32 lines]
>
> - Show quoted text -

Yes it is.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.