Re: Conditional use of Eval in asp.net 2.0 with Gridview

Tech-Archive recommends: Fix windows errors by optimizing your registry



The wrapper function is my suggestion also.


That's kinda what "presentation" layer means.

You "present" the data the way you want to.

Keep in mind, that if you want to edit, you need to use a checkbox.
Or write a custom user control...which maybe has a drop down list of
--Select--
True
False

.....



<idletask@xxxxxxx> wrote in message
news:1138647357.870737.198420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I have an SQLDataSource control, which is bound to an ASP.net 2.0
> GridView control. It outputs a list of documents that a user can check
> in or check out of the database.
>
> In my gridview, I have a column called "checked out" which is bound to
> a column in my database, called "checkedout". A zero means no, and a
> one means yes (that the document is checked out).
>
> Showing a 0 or 1 is ugly and I want to use No or Yes. I can't figure
> out how to get at my SQLDataSource control's rows so that I can look at
> them and write text out, rather than what's in the database (a 0 or 1).
>
> My code is like this:
>
> <asp:Label ID="CheckedOut" runat="server" text='<%# Eval("CheckedOut")
> %>' />
>
> I've tried assiging the return value of Eval("CheckedOut") to a local
> variable, but I get asp errors telling me that Eval must be used in a
> databound control.
>
> I want to do something like this:
>
> If Eval("CheckedOut") = "0" Then
> ...
> Else
> ...
> End Of
>
> I can post real code if that helps- but it's more the approach I am
> looking for...
>
> Thanks for any help
>
> idletask.
>


.



Relevant Pages

  • Re: Conditional use of Eval in asp.net 2.0 with Gridview
    ... GridView control. ... a column in my database, called "checkedout". ... I can post real code if that helps- but it's more the approach I am ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Global datasets
    ... Sticking with the first method again. ... Populate my DataSet from the Database ... Create another control object instance ... re-instantiating it. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: instant Lisp web application publishing
    ... flow of control (e,g. first log in the user, then show page x, than ... of Lisp if they want) ... flexible database that can be easily mapped into OOP terminology (so you ... Also I don't have a good candidate server to deploy it too. ...
    (comp.lang.lisp)
  • RE: 438 - Object doesnt support this property or method
    ... I created a new database and imported everything from the original. ... Missing is the Reference to the EzFTP control. ... Set con = Application.CurrentProject.Connection ...
    (microsoft.public.access.formscoding)
  • Re: Communication Log
    ... May I send you copy of the database that I made? ... a communication log in the database so that it will store the Date, ... ContactMethodID ... The above controls are set up in a page using te tab control. ...
    (microsoft.public.access.tablesdbdesign)