---
title: "How do I hide particular label in nested listview"  
description: "How do I hide particular label in nested listview"  
author: "syeda s"  
published: 2016-08-14  
updated: 2023-07-03  
canonical: https://www.mindstick.com/forum/34163/how-do-i-hide-particular-label-in-nested-listview  
category: ".net"  
tags: ["asp.net"]  
reading_time: 3 minutes  

---

# How do I hide particular label in nested listview

[listview](https://www.mindstick.com/articles/12744/listview-in-android) is the [parent](https://www.mindstick.com/blog/154/how-to-find-parent-of-control-in-wpf) [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) in that i took the child control for popup.my [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that with child control i want to hide the particluar [label](https://www.mindstick.com/articles/12835/print-label-tracking-how-do-these-features-make-auspost-woocommerce-plugin-better) so that the user when clicked on popup the details should be showned which [admin](https://www.mindstick.com/articles/12934/3-functionalities-that-a-magento-admin-mobile-app-can-empower-you-with) wanted to show.please help me out..i saw in [internet](https://www.mindstick.com/articles/44650/what-should-you-do-during-an-internet-outage) that we can do with [event bubbling](https://www.mindstick.com/forum/34486/how-to-stop-event-bubbling-in-javascript) like [nested](https://www.mindstick.com/forum/45/itemcommand-event-in-nested-repeater-and-listview) listview inside linkbutton..but i want nested listview inside label to b hidden.\
\
**What I have tried:**\
\

```
<tbody id="divcomp" runat="server"><asp:ListView ID="ddlcomputers" runat="server" DataKeyNames="Cid" OnItemCommand="ddlcomputers_ItemCommand" OnItemDeleted="ddlcomputers_ItemDeleted"><asp:Label ID="lblComputerNamee" runat="server" Text='<%#Eval("ComputerName") %>'><img class="md-trigger" data-modal='<%#Eval("ComputerName") %>' align="absmiddle" src="../html/images/info.png" runat="server" width="24" height="24" alt="" /><asp:Label ID="lblCid" runat="server" Text='<%#Eval("Cid") %>' Visible="false"><asp:ListView ID="ListView1" runat="server">
```

\
\

## Computer Details

```
Computer Name :<%#Eval("ComputerName") %>IP Address :<%#Eval("IPAddress") %>Computer Type :<%#Eval("ComputerType") %>Department :<%#Eval("Department") %>Smps :<%#Eval("Cpu") %>Processor :<%#Eval("Processor") %>Ram :<%#Eval("Ram") %>Board :<%#Eval("Board") %>HardDisk :<%#Eval("HardDisk") %>Mouse :<%#Eval("Mouse") %>KeyBoard :<%#Eval("Keyboard") %>Monitor :<%#Eval("Monitor") %>Status:<%#Eval("Status") %>Date:<%#Eval("Date") %>WhoBrought :<%#Eval("WhoBrought") %>WhoAdded :<%#Eval("WhoAdded") %><button class="md-close"></button><%#Eval("ComputerType") %> <asp:ImageButton ID="imgedit" runat="server" ImageUrl="~/html/images/edit.png" Width="24" CommandName="Edit" Height="24" alt="" /> <asp:ImageButton ID="imgrepair" runat="server" ImageUrl="~/html/images/repair.png" Width="24" Height="24" CommandName="Repair" alt="" /> <asp:ImageButton ID="imgdel" runat="server" ImageUrl="~/@@@html/images/Dead.jpg" Width="24" Height="24" alt="" CommandName="Dead" OnClientClick="return confirm('Do you want to Dead this Computer?');" /> <td runat="server" visible="false"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/html/images/delete.png" Width="24" Height="24" alt="" CommandName="Delete" OnClientClick="return confirm('Do you want to delete this Computer?');" /><asp:Label ID="LblOther" runat="server" Text='<%#Eval("Status") %>'>
```

## Replies

### Reply by Aryan Kumar

Sure, here are the steps on how to hide a particular label in a nested ListView in ASP.NET MVC:

1. In your code-behind file, create a variable to store the ID of the label you want to hide.
2. In the `OnItemDataBound` [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) of the outer ListView, get the nested ListView and the label you want to hide.
3. Set the `Visible` property of the label to `false`.

Here is an example of the code:

C#

```plaintext
public partial class NestedListViewController : Controller
{
    private int _labelIDToHide;

    public NestedListViewController()
    {
        _labelIDToHide = 1;
    }

    [HttpGet]
    [Route("nested-listview")]
    public ActionResult Index()
    {
        return View();
    }

    protected void OnItemDataBound(object sender, ListViewItemEventArgs e)
    {
        // Get the nested ListView
        ListView nestedListView = e.ItemContainer.FindControl("NestedListView") as ListView;

        // Get the label you want to hide
        Label label = nestedListView.FindControl("LabelID") as Label;

        // Set the Visible property of the label to false
        if (label.ID == _labelIDToHide)
        {
            label.Visible = false;
        }
    }
}
```

This code will hide the label with the ID `1` in the nested ListView when it is bound to data. You can change the ID of the label to hide by changing the value of the `_labelIDToHide` variable in the code-behind file.


---

Original Source: https://www.mindstick.com/forum/34163/how-do-i-hide-particular-label-in-nested-listview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
