|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Removing a control from a DataListcircumstances in which I would like to remove a control from a DataList's EditItemTemplate. Here's the current setup, slightly simplified: <asp:datalist id="DataList1" Width="100%" runat="server" CellPadding="0" CellSpacing="0" runat="server"> <EditItemTemplate> <TABLE class="HR_Pane_w_Border" id="Table27" cellSpacing="0" cellPadding="2" align="left"> {......} <TD width="45%" align="left"> <asp:DropDownList id="ddl_JFSType" runat="server"> </asp:DropDownList> </TD> </EditItemTemplate> </asp:DataList> What I'd like to do is remove the "ddl_JFSType" dropdown list from the DataList. How can I do this, if at all possible? Call DataList1.FindControls() in the Page Load, then remove ddl_JFSType? Something along those lines? I'm open to suggestions. Thanks! Hi,
those circumstances probably can be applied in ItemdataBound method (which runs for every row when dataList is bound)? There you can FindControl the DDL (against the dataListItem) and for example: set its Visible property to false. Show quoteHide quote "Steve Hershoff" <babba***@nowhere.com> wrote in message news:O9BHy5k%23HHA.536@TK2MSFTNGP06.phx.gbl... >I have no idea if this is possible, but just in case: I have certain >circumstances in which I would like to remove a control from a DataList's >EditItemTemplate. Here's the current setup, slightly simplified: > > <asp:datalist id="DataList1" Width="100%" runat="server" CellPadding="0" > CellSpacing="0" runat="server"> > <EditItemTemplate> > <TABLE class="HR_Pane_w_Border" id="Table27" cellSpacing="0" > cellPadding="2" align="left"> > {......} > <TD width="45%" align="left"> > <asp:DropDownList id="ddl_JFSType" runat="server"> > </asp:DropDownList> > </TD> > </EditItemTemplate> > </asp:DataList> > > What I'd like to do is remove the "ddl_JFSType" dropdown list from the > DataList. How can I do this, if at all possible? Call > DataList1.FindControls() in the Page Load, then remove ddl_JFSType? > Something along those lines? I'm open to suggestions. > > Thanks! > > > >
Key in Dictionary
How to retrive value that is invisible in gridview Visual Studio 2005 -- Multi-Tabbed Control Strange Problem: Removing rows from Table object doesnt update rowcount of Gridview Unable to retrieve schema - Divide by zero error encountered Bryan, Help! Creating a Datagrid HyperLinkColumn with Multiple Querystring Values datagrid to excel with image Newbie Delete question Re: having trouble with drag-n-drop of multiple items |
|||||||||||||||||||||||