|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using an IF statment within an ItemTemplateI 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 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 elton_w***@hotmail.com >-----Original Message----- specifies whether or >Hello, > >I have a datagrid listing bill to addresses. One column >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 that. If it is not, > ><% 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 Show quoteHide quote >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 > > >. >
Datagrid postback problem?!?
Searched Datagrid with Paging? Using Server.Transfer with HyperLinkColumn in a datagrid Export to PDF Questions concerning detailsview or datagrid ASP.NET 2.0 How can I export a Dataview to Excel customising PagerStyle Showing x to y of z records Fonction de recherche dans un datagrid "Single record" edit control |
|||||||||||||||||||||||