Hide DataList Item

Discussion in 'ASP .Net Web Controls' started by STech, Oct 19, 2005.

  1. STech

    STech Guest

    How can I hide a DataListItem from a datalist. I have tried the PreRender,
    ItemCreated, ItemDatabound to hide the item but it does not work.

    I have tried both:
    e.Item.Visible = false;
    and
    DataList1.Items[0].Vislble = false;

    Thanks.
    stech
     
    STech, Oct 19, 2005
    #1
    1. Advertising

  2. Try any of the following 3 options:
    if (e.Item.ItemIndex ==1) e.Item.CssClass ="Hidden";
    if (e.Item.ItemIndex ==2) e.Item.Controls[1].Visible =false;
    if (e.Item.ItemIndex ==3) e.Item.Controls.Clear();

    In the Style section of your page add:
    <style>
    .Hidden {display:none;}
    </style>
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "STech" wrote:

    > How can I hide a DataListItem from a datalist. I have tried the PreRender,
    > ItemCreated, ItemDatabound to hide the item but it does not work.
    >
    > I have tried both:
    > e.Item.Visible = false;
    > and
    > DataList1.Items[0].Vislble = false;
    >
    > Thanks.
    > stech
     
    Phillip Williams, Oct 19, 2005
    #2
    1. Advertising

  3. Thanks for Philip's informative inputs,

    Hi Stech,

    I think Philip's suggestion on using CSS style "display" to hide the
    DataList item is a good idea. You can apply the code in either ItemCreated
    or ItemDatabound....

    Thanks,


    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: Hide DataList Item
    | thread-index: AcXUwzuvrFav8FXkTlGir2cKPDduyQ==
    | X-WBNR-Posting-Host: 207.230.226.92
    | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    <>
    | References: <>
    | Subject: RE: Hide DataList Item
    | Date: Wed, 19 Oct 2005 08:39:03 -0700
    | Lines: 28
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11372
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Try any of the following 3 options:
    | if (e.Item.ItemIndex ==1) e.Item.CssClass ="Hidden";
    | if (e.Item.ItemIndex ==2) e.Item.Controls[1].Visible =false;
    | if (e.Item.ItemIndex ==3) e.Item.Controls.Clear();
    |
    | In the Style section of your page add:
    | <style>
    | .Hidden {display:none;}
    | </style>
    | --
    | HTH,
    | Phillip Williams
    | http://www.societopia.net
    | http://www.webswapp.com
    |
    |
    | "STech" wrote:
    |
    | > How can I hide a DataListItem from a datalist. I have tried the
    PreRender,
    | > ItemCreated, ItemDatabound to hide the item but it does not work.
    | >
    | > I have tried both:
    | > e.Item.Visible = false;
    | > and
    | > DataList1.Items[0].Vislble = false;
    | >
    | > Thanks.
    | > stech
    |
     
    Steven Cheng[MSFT], Oct 20, 2005
    #3
  4. STech

    STech Guest

    Steven,
    I already knew about the "hacks" Philips mentioned.

    I would still like to know why I am not able to hide an item. I am even
    willing to write a custom control that inherits the datalist if you could
    tell me where to fix it.

    Thanks,
    -stech

    "Steven Cheng[MSFT]" wrote:

    > Thanks for Philip's informative inputs,
    >
    > Hi Stech,
    >
    > I think Philip's suggestion on using CSS style "display" to hide the
    > DataList item is a good idea. You can apply the code in either ItemCreated
    > or ItemDatabound....
    >
    > Thanks,
    >
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    > --------------------
    > | Thread-Topic: Hide DataList Item
    > | thread-index: AcXUwzuvrFav8FXkTlGir2cKPDduyQ==
    > | X-WBNR-Posting-Host: 207.230.226.92
    > | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    > <>
    > | References: <>
    > | Subject: RE: Hide DataList Item
    > | Date: Wed, 19 Oct 2005 08:39:03 -0700
    > | Lines: 28
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11372
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | Try any of the following 3 options:
    > | if (e.Item.ItemIndex ==1) e.Item.CssClass ="Hidden";
    > | if (e.Item.ItemIndex ==2) e.Item.Controls[1].Visible =false;
    > | if (e.Item.ItemIndex ==3) e.Item.Controls.Clear();
    > |
    > | In the Style section of your page add:
    > | <style>
    > | .Hidden {display:none;}
    > | </style>
    > | --
    > | HTH,
    > | Phillip Williams
    > | http://www.societopia.net
    > | http://www.webswapp.com
    > |
    > |
    > | "STech" wrote:
    > |
    > | > How can I hide a DataListItem from a datalist. I have tried the
    > PreRender,
    > | > ItemCreated, ItemDatabound to hide the item but it does not work.
    > | >
    > | > I have tried both:
    > | > e.Item.Visible = false;
    > | > and
    > | > DataList1.Items[0].Vislble = false;
    > | >
    > | > Thanks.
    > | > stech
    > |
    >
    >
     
    STech, Oct 20, 2005
    #4
  5. "STech" wrote:

    >
    > Steven,
    > I already knew about the "hacks" Philips mentioned.
    >
    > I would still like to know why I am not able to hide an item. I am even
    > willing to write a custom control that inherits the datalist if you could
    > tell me where to fix it.


    The purpose of the databound controls is to display the items from the data
    source. Hiding an item, as you are trying to do, means in business terms,
    deleting a record in the underlying datasource (e.g. when a user clicks
    delete or when in the programming logic you have to delete a record) If so,
    you can delete the record in the underlying datatable (or whatever other
    IEnumerable object one might use). In this approach you would not have to use
    “hacks†(as you referred to them) to manipulate the display of the rendered
    HTML.

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com
     
    Phillip Williams, Oct 21, 2005
    #5
  6. Hi Steve,

    When I tried a datagrid and a repeater; both of them accept setting the
    visible property to false on the DataGridItem or the RepeaterItem, and did
    not render any HTML for the corresponding datarows.

    Why does the DataListItem expose a Visible property but not utilize it? It
    is a bug that is to be corrected in future releases or is it there by design
    for a reason?

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Steven Cheng[MSFT]" wrote:

    > Thanks for Philip's informative inputs,
    >
    > Hi Stech,
    >
    > I think Philip's suggestion on using CSS style "display" to hide the
    > DataList item is a good idea. You can apply the code in either ItemCreated
    > or ItemDatabound....
    >
    > Thanks,
    >
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    > --------------------
    > | Thread-Topic: Hide DataList Item
    > | thread-index: AcXUwzuvrFav8FXkTlGir2cKPDduyQ==
    > | X-WBNR-Posting-Host: 207.230.226.92
    > | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    > <>
    > | References: <>
    > | Subject: RE: Hide DataList Item
    > | Date: Wed, 19 Oct 2005 08:39:03 -0700
    > | Lines: 28
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11372
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | Try any of the following 3 options:
    > | if (e.Item.ItemIndex ==1) e.Item.CssClass ="Hidden";
    > | if (e.Item.ItemIndex ==2) e.Item.Controls[1].Visible =false;
    > | if (e.Item.ItemIndex ==3) e.Item.Controls.Clear();
    > |
    > | In the Style section of your page add:
    > | <style>
    > | .Hidden {display:none;}
    > | </style>
    > | --
    > | HTH,
    > | Phillip Williams
    > | http://www.societopia.net
    > | http://www.webswapp.com
    > |
    > |
    > | "STech" wrote:
    > |
    > | > How can I hide a DataListItem from a datalist. I have tried the
    > PreRender,
    > | > ItemCreated, ItemDatabound to hide the item but it does not work.
    > | >
    > | > I have tried both:
    > | > e.Item.Visible = false;
    > | > and
    > | > DataList1.Items[0].Vislble = false;
    > | >
    > | > Thanks.
    > | > stech
    > |
    >
    >
     
    Phillip Williams, Oct 21, 2005
    #6
  7. Thank you for your further investigation Phillip,

    As for the inconsistent behavior between DataListItem and DataGridItem,
    RepeaterItem, think this is a bug and based on my further testing I'm
    afraid it still exists in the in the new 2.0 version. I'll report this
    request to our dev team so as to address it soon.

    Hi Stech,

    I'm afraid due to the current limitation, the DataListItem's visble dosn't
    work as expected due to some internal bug in the render method (which is
    hidden through interface ...). Currently you can consider Philip's
    suggestion on adjusting the datasource collection or use the css style to
    hide the item.

    Sorry for the inconvenience it brings you.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)






    --------------------
    | Thread-Topic: Hide DataList Item
    | thread-index: AcXV1MLDHwxlcS/wTR+yGPw2tkfz5g==
    | X-WBNR-Posting-Host: 207.230.226.92
    | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    <>
    | References: <>
    <>
    <>
    <>
    | Subject: RE: Hide DataList Item
    | Date: Thu, 20 Oct 2005 17:17:02 -0700
    | Lines: 27
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 8bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11431
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | "STech" wrote:
    |
    | >
    | > Steven,
    | > I already knew about the "hacks" Philips mentioned.
    | >
    | > I would still like to know why I am not able to hide an item. I am even
    | > willing to write a custom control that inherits the datalist if you
    could
    | > tell me where to fix it.
    |
    | The purpose of the databound controls is to display the items from the
    data
    | source. Hiding an item, as you are trying to do, means in business
    terms,
    | deleting a record in the underlying datasource (e.g. when a user clicks
    | delete or when in the programming logic you have to delete a record) If
    so,
    | you can delete the record in the underlying datatable (or whatever other
    | IEnumerable object one might use). In this approach you would not have to
    use
    | “hacks�(as you referred to them) to manipulate the display of the
    rendered
    | HTML.
    |
    | --
    | HTH,
    | Phillip Williams
    | http://www.societopia.net
    | http://www.webswapp.com
    |
    |
    |
    |
     
    Steven Cheng[MSFT], Oct 21, 2005
    #7
  8. Hi Stech,

    After some further research, the problem of the DataList's
    DataListItem.Visible property is utilized only when the RepeatLayout is set
    to "Flow" rather than "Table". When the RepeatLayout is set to "Table",
    the Visible property is ignored.
    Please have a try to see whether this helps.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | X-Tomcat-ID: 44062348
    | References: <>
    <>
    <>
    <>
    <>
    | MIME-Version: 1.0
    | Content-Type: text/plain
    | Content-Transfer-Encoding: 7bit
    | From: (Steven Cheng[MSFT])
    | Organization: Microsoft
    | Date: Fri, 21 Oct 2005 02:29:10 GMT
    | Subject: RE: Hide DataList Item
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | Message-ID: <jcNP#>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | Lines: 79
    | Path: TK2MSFTNGXA01.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11434
    | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    |
    | Thank you for your further investigation Phillip,
    |
    | As for the inconsistent behavior between DataListItem and DataGridItem,
    | RepeaterItem, think this is a bug and based on my further testing I'm
    | afraid it still exists in the in the new 2.0 version. I'll report this
    | request to our dev team so as to address it soon.
    |
    | Hi Stech,
    |
    | I'm afraid due to the current limitation, the DataListItem's visble
    dosn't
    | work as expected due to some internal bug in the render method (which is
    | hidden through interface ...). Currently you can consider Philip's
    | suggestion on adjusting the datasource collection or use the css style
    to
    | hide the item.
    |
    | Sorry for the inconvenience it brings you.
    |
    | Regards,
    |
    | Steven Cheng
    | Microsoft Online Support
    |
    | Get Secure! www.microsoft.com/security
    | (This posting is provided "AS IS", with no warranties, and confers no
    | rights.)
    |
    |
    |
    |
    |
    |
    | --------------------
    | | Thread-Topic: Hide DataList Item
    | | thread-index: AcXV1MLDHwxlcS/wTR+yGPw2tkfz5g==
    | | X-WBNR-Posting-Host: 207.230.226.92
    | | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    | <>
    | | References: <>
    | <>
    | <>
    | <>
    | | Subject: RE: Hide DataList Item
    | | Date: Thu, 20 Oct 2005 17:17:02 -0700
    | | Lines: 27
    | | Message-ID: <>
    | | MIME-Version: 1.0
    | | Content-Type: text/plain;
    | | charset="Utf-8"
    | | Content-Transfer-Encoding: 8bit
    | | X-Newsreader: Microsoft CDO for Windows 2000
    | | Content-Class: urn:content-classes:message
    | | Importance: normal
    | | Priority: normal
    | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | | Xref: TK2MSFTNGXA01.phx.gbl
    | microsoft.public.dotnet.framework.aspnet.webcontrols:11431
    | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | |
    | | "STech" wrote:
    | |
    | | >
    | | > Steven,
    | | > I already knew about the "hacks" Philips mentioned.
    | | >
    | | > I would still like to know why I am not able to hide an item. I am
    even
    | | > willing to write a custom control that inherits the datalist if you
    | could
    | | > tell me where to fix it.
    | |
    | | The purpose of the databound controls is to display the items from the
    | data
    | | source. Hiding an item, as you are trying to do, means in business
    | terms,
    | | deleting a record in the underlying datasource (e.g. when a user clicks
    | | delete or when in the programming logic you have to delete a record)
    If
    | so,
    | | you can delete the record in the underlying datatable (or whatever
    other
    | | IEnumerable object one might use). In this approach you would not have
    to
    | use
    | | “hacks�(as you referred to them) to manipulate the display of the
    | rendered
    | | HTML.
    | |
    | | --
    | | HTH,
    | | Phillip Williams
    | | http://www.societopia.net
    | | http://www.webswapp.com
    | |
    | |
    | |
    | |
    |
    |
     
    Steven Cheng[MSFT], Oct 21, 2005
    #8
  9. STech

    STech Guest

    Thank you Steven for looking that up. Hope they fix that bug soon. I can
    take it from here by writing a custom control and have that in place till you
    guys fix the bug.

    Please close this incident.
    Thanks again.


    "Steven Cheng[MSFT]" wrote:

    > Hi Stech,
    >
    > After some further research, the problem of the DataList's
    > DataListItem.Visible property is utilized only when the RepeatLayout is set
    > to "Flow" rather than "Table". When the RepeatLayout is set to "Table",
    > the Visible property is ignored.
    > Please have a try to see whether this helps.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > --------------------
    > | X-Tomcat-ID: 44062348
    > | References: <>
    > <>
    > <>
    > <>
    > <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain
    > | Content-Transfer-Encoding: 7bit
    > | From: (Steven Cheng[MSFT])
    > | Organization: Microsoft
    > | Date: Fri, 21 Oct 2005 02:29:10 GMT
    > | Subject: RE: Hide DataList Item
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | Message-ID: <jcNP#>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | Lines: 79
    > | Path: TK2MSFTNGXA01.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11434
    > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    > |
    > | Thank you for your further investigation Phillip,
    > |
    > | As for the inconsistent behavior between DataListItem and DataGridItem,
    > | RepeaterItem, think this is a bug and based on my further testing I'm
    > | afraid it still exists in the in the new 2.0 version. I'll report this
    > | request to our dev team so as to address it soon.
    > |
    > | Hi Stech,
    > |
    > | I'm afraid due to the current limitation, the DataListItem's visble
    > dosn't
    > | work as expected due to some internal bug in the render method (which is
    > | hidden through interface ...). Currently you can consider Philip's
    > | suggestion on adjusting the datasource collection or use the css style
    > to
    > | hide the item.
    > |
    > | Sorry for the inconvenience it brings you.
    > |
    > | Regards,
    > |
    > | Steven Cheng
    > | Microsoft Online Support
    > |
    > | Get Secure! www.microsoft.com/security
    > | (This posting is provided "AS IS", with no warranties, and confers no
    > | rights.)
    > |
    > |
    > |
    > |
    > |
    > |
    > | --------------------
    > | | Thread-Topic: Hide DataList Item
    > | | thread-index: AcXV1MLDHwxlcS/wTR+yGPw2tkfz5g==
    > | | X-WBNR-Posting-Host: 207.230.226.92
    > | | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    > | <>
    > | | References: <>
    > | <>
    > | <>
    > | <>
    > | | Subject: RE: Hide DataList Item
    > | | Date: Thu, 20 Oct 2005 17:17:02 -0700
    > | | Lines: 27
    > | | Message-ID: <>
    > | | MIME-Version: 1.0
    > | | Content-Type: text/plain;
    > | | charset="Utf-8"
    > | | Content-Transfer-Encoding: 8bit
    > | | X-Newsreader: Microsoft CDO for Windows 2000
    > | | Content-Class: urn:content-classes:message
    > | | Importance: normal
    > | | Priority: normal
    > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | | Xref: TK2MSFTNGXA01.phx.gbl
    > | microsoft.public.dotnet.framework.aspnet.webcontrols:11431
    > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | |
    > | | "STech" wrote:
    > | |
    > | | >
    > | | > Steven,
    > | | > I already knew about the "hacks" Philips mentioned.
    > | | >
    > | | > I would still like to know why I am not able to hide an item. I am
    > even
    > | | > willing to write a custom control that inherits the datalist if you
    > | could
    > | | > tell me where to fix it.
    > | |
    > | | The purpose of the databound controls is to display the items from the
    > | data
    > | | source. Hiding an item, as you are trying to do, means in business
    > | terms,
    > | | deleting a record in the underlying datasource (e.g. when a user clicks
    > | | delete or when in the programming logic you have to delete a record)
    > If
    > | so,
    > | | you can delete the record in the underlying datatable (or whatever
    > other
    > | | IEnumerable object one might use). In this approach you would not have
    > to
    > | use
    > | | “hacks�(as you referred to them) to manipulate the display of the
    > | rendered
    > | | HTML.
    > | |
    > | | --
    > | | HTH,
    > | | Phillip Williams
    > | | http://www.societopia.net
    > | | http://www.webswapp.com
    > | |
    > | |
    > | |
    > | |
    > |
    > |
    >
    >
     
    STech, Oct 24, 2005
    #9
  10. Thanks for your response.

    Yes, and if possible, you can use the "Flow" layout currently so as to
    avoid the problem. Anyway, it's my pleasure working with you. Thanks again
    for your understanding.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | Thread-Topic: Hide DataList Item
    | thread-index: AcXYVUbftTWhQ/idSDS57Ukq5OC0Tg==
    | X-WBNR-Posting-Host: 165.91.46.79
    | From: "=?Utf-8?B?U1RlY2g=?=" <>
    | References: <>
    <>
    <>
    <>
    <>
    <jcNP#>
    <>
    | Subject: RE: Hide DataList Item
    | Date: Sun, 23 Oct 2005 21:42:02 -0700
    | Lines: 156
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 8bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11471
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    |
    | Thank you Steven for looking that up. Hope they fix that bug soon. I can
    | take it from here by writing a custom control and have that in place till
    you
    | guys fix the bug.
    |
    | Please close this incident.
    | Thanks again.
    |
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Hi Stech,
    | >
    | > After some further research, the problem of the DataList's
    | > DataListItem.Visible property is utilized only when the RepeatLayout is
    set
    | > to "Flow" rather than "Table". When the RepeatLayout is set to
    "Table",
    | > the Visible property is ignored.
    | > Please have a try to see whether this helps.
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | > --------------------
    | > | X-Tomcat-ID: 44062348
    | > | References: <>
    | > <>
    | > <>
    | > <>
    | > <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain
    | > | Content-Transfer-Encoding: 7bit
    | > | From: (Steven Cheng[MSFT])
    | > | Organization: Microsoft
    | > | Date: Fri, 21 Oct 2005 02:29:10 GMT
    | > | Subject: RE: Hide DataList Item
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | Message-ID: <jcNP#>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | Lines: 79
    | > | Path: TK2MSFTNGXA01.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.webcontrols:11434
    | > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    | > |
    | > | Thank you for your further investigation Phillip,
    | > |
    | > | As for the inconsistent behavior between DataListItem and
    DataGridItem,
    | > | RepeaterItem, think this is a bug and based on my further testing
    I'm
    | > | afraid it still exists in the in the new 2.0 version. I'll report
    this
    | > | request to our dev team so as to address it soon.
    | > |
    | > | Hi Stech,
    | > |
    | > | I'm afraid due to the current limitation, the DataListItem's visble
    | > dosn't
    | > | work as expected due to some internal bug in the render method (which
    is
    | > | hidden through interface ...). Currently you can consider Philip's
    | > | suggestion on adjusting the datasource collection or use the css
    style
    | > to
    | > | hide the item.
    | > |
    | > | Sorry for the inconvenience it brings you.
    | > |
    | > | Regards,
    | > |
    | > | Steven Cheng
    | > | Microsoft Online Support
    | > |
    | > | Get Secure! www.microsoft.com/security
    | > | (This posting is provided "AS IS", with no warranties, and confers no
    | > | rights.)
    | > |
    | > |
    | > |
    | > |
    | > |
    | > |
    | > | --------------------
    | > | | Thread-Topic: Hide DataList Item
    | > | | thread-index: AcXV1MLDHwxlcS/wTR+yGPw2tkfz5g==
    | > | | X-WBNR-Posting-Host: 207.230.226.92
    | > | | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    | > | <>
    | > | | References: <>
    | > | <>
    | > | <>
    | > | <>
    | > | | Subject: RE: Hide DataList Item
    | > | | Date: Thu, 20 Oct 2005 17:17:02 -0700
    | > | | Lines: 27
    | > | | Message-ID: <>
    | > | | MIME-Version: 1.0
    | > | | Content-Type: text/plain;
    | > | | charset="Utf-8"
    | > | | Content-Transfer-Encoding: 8bit
    | > | | X-Newsreader: Microsoft CDO for Windows 2000
    | > | | Content-Class: urn:content-classes:message
    | > | | Importance: normal
    | > | | Priority: normal
    | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | | Path:
    TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | | Xref: TK2MSFTNGXA01.phx.gbl
    | > | microsoft.public.dotnet.framework.aspnet.webcontrols:11431
    | > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | |
    | > | | "STech" wrote:
    | > | |
    | > | | >
    | > | | > Steven,
    | > | | > I already knew about the "hacks" Philips mentioned.
    | > | | >
    | > | | > I would still like to know why I am not able to hide an item. I
    am
    | > even
    | > | | > willing to write a custom control that inherits the datalist if
    you
    | > | could
    | > | | > tell me where to fix it.
    | > | |
    | > | | The purpose of the databound controls is to display the items from
    the
    | > | data
    | > | | source. Hiding an item, as you are trying to do, means in business
    | > | terms,
    | > | | deleting a record in the underlying datasource (e.g. when a user
    clicks
    | > | | delete or when in the programming logic you have to delete a
    record)
    | > If
    | > | so,
    | > | | you can delete the record in the underlying datatable (or whatever
    | > other
    | > | | IEnumerable object one might use). In this approach you would not
    have
    | > to
    | > | use
    | > | | “hacksâ�(as you referred to them) to manipulate the
    display of the
    | > | rendered
    | > | | HTML.
    | > | |
    | > | | --
    | > | | HTH,
    | > | | Phillip Williams
    | > | | http://www.societopia.net
    | > | | http://www.webswapp.com
    | > | |
    | > | |
    | > | |
    | > | |
    | > |
    | > |
    | >
    | >
    |
     
    Steven Cheng[MSFT], Oct 24, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,964
  2. lydia sista via DotNetMonster.com

    auto show/hide item's data

    lydia sista via DotNetMonster.com, Mar 26, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    669
    Eliyahu Goldin
    Mar 27, 2005
  3. Chris Kettenbach

    Hide DataList Items

    Chris Kettenbach, Oct 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,220
    Chris Kettenbach
    Oct 28, 2005
  4. Daves
    Replies:
    2
    Views:
    3,110
    Daves
    Apr 22, 2006
  5. deepee
    Replies:
    4
    Views:
    176
    deepee
    Apr 26, 2006
Loading...

Share This Page