Professional Web Applications Themes

Using an IF statment within an ItemTemplate - ASP.NET Data Grid Control

Hello, I have a datagrid listing bill to addresses. One column specifies whether or not the bill to is the primary for the customer. Here's my dilemma: I would like to add the option to set another bill to to primary within the data grid. So something like this <% if container.dataitem("bitPrimary") = 1 then %> Primary <% else %> <asp:LinkButton Runat="server" commandname="setPrimary(<%#container.dataitem("ID" )%>)">Make Primary</asp:LinkButton> <% end if %> So, if the item is already primary, it will simply state that. If it is not, then give the user the option to set it. I can hanld ethe function setPrimary(), ...

  1. #1

    Default Using an IF statment within an ItemTemplate

    Hello,

    I have a datagrid listing bill to addresses. One column specifies whether or
    not the bill to is the primary for the customer. Here's my dilemma: I would
    like to add the option to set another bill to to primary within the data
    grid. So something like this

    <% if container.dataitem("bitPrimary") = 1 then %>
    Primary
    <% else %>
    <asp:LinkButton Runat="server"
    commandname="setPrimary(<%#container.dataitem("ID" )%>)">Make
    Primary</asp:LinkButton>
    <% end if %>

    So, if the item is already primary, it will simply state that. If it is not,
    then give the user the option to set it. I can hanld ethe function
    setPrimary(), but this IF statement doesn't work within the datagrid.

    Thanks!


    --
    David Lozzi
    Web Applications Developer
    [email]dlozzi(remove-this)delphi-ts.com[/email]


    David Lozzi Guest

  2. #2

    Default Using an IF statment within an ItemTemplate

    Hi David,

    Instead in HTML section, you can process your logic in
    ItemDataBound event. It's easy for you to code any logic.

    HTH

    Elton Wang
    [email]elton_wanghotmail.com[/email]
    >-----Original Message-----
    >Hello,
    >
    >I have a datagrid listing bill to addresses. One column
    specifies whether or
    >not the bill to is the primary for the customer. Here's
    my dilemma: I would
    >like to add the option to set another bill to to primary
    within the data
    >grid. So something like this
    >
    ><% if container.dataitem("bitPrimary") = 1 then %>
    > Primary
    ><% else %>
    > <asp:LinkButton Runat="server"
    >commandname="setPrimary(<%#container.dataitem("ID ")%
    >)">Make
    >Primary</asp:LinkButton>
    ><% end if %>
    >
    >So, if the item is already primary, it will simply state
    that. If it is not,
    >then give the user the option to set it. I can hanld ethe
    function
    >setPrimary(), but this IF statement doesn't work within
    the datagrid.
    >
    >Thanks!
    >
    >
    >--
    >David Lozzi
    >Web Applications Developer
    >dlozzi(remove-this)delphi-ts.com
    >
    >
    >.
    >
    Elton Wang Guest

Similar Threads

  1. I want to display Income Statment...
    By Ather Ali Shaikh in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: September 8th, 03:17 PM
  2. For Statment question
    By K-Parker in forum Macromedia Flash
    Replies: 3
    Last Post: December 12th, 09:17 AM
  3. how to tidy this if statment
    By LeeD in forum Macromedia Director Lingo
    Replies: 7
    Last Post: September 4th, 03:29 PM
  4. php 4.2.3 on AIX - include statment cause seg. fault
    By Pm Wong in forum PHP Development
    Replies: 0
    Last Post: August 30th, 03:15 AM
  5. help with where criteria in sql statment
    By aneurin in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 10th, 07:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139