Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:47:56+00:00 2026-06-18T05:47:56+00:00

I have a dynamic Listview which is bind to three different tables with one

  • 0

I have a dynamic Listview which is bind to three different tables with one to many relations i.e. one table row may contain many rows in other table. When i run my application i get this output.
original output

But i want to get Listview in this format although this image has been edited using Photshop.

Edited using Photoshop

Here is Listview HTML.

<asp:ListView runat="server" ID="LV_ViewQuestion" DataKeyNames="UID, Question_ID">
                <EmptyDataTemplate>
                    <table id="Table1" runat="server" style="">
                        <tr>
                            <td>No Surveys.</td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <ItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Label ID="SURVEY_TYPELabel" runat="server" Text='<%# Eval("Survey_Type")%>' />
                        </td>
                        <td>
                            <asp:Label ID="SURVEY_TITLELabel" runat="server" Text='<%# Eval("Survey_Title") %>' />
                        </td>
                        <td>
                            <asp:Label ID="Question_TextLabel" runat="server" Text='<%# Eval("Question_Text")%>' />
                        </td>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Option_Text")%>' />
                        </td>
                        <td>
                            <asp:LinkButton runat="server" ID="lb_DelQuestion" Text="Delete" CommandArgument='<%# Eval("Question_ID")%>' CommandName="XDelQuestion" CssClass="GeneralInput" />&nbsp;
                            <asp:LinkButton runat="server" ID="lb_AddMoreQuest" Text="Add Question" CommandArgument='<%# Eval("UID")%>' CommandName="XAddAnotQuestion" CssClass="GeneralInput" />&nbsp;
                            <asp:LinkButton runat="server" ID="lb_Publish" Text="Publish" CommandArgument='<%# Eval("UID")%>' CommandName="XPublishSurvey" CssClass="GeneralInput" />

                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <table id="Table2" runat="server">
                        <tr id="Tr1" runat="server">
                            <td id="Td1" runat="server">
                                <table id="itemPlaceholderContainer" runat="server" class="nobordered" style="width: 580px;">
                                    <tr id="Tr2" runat="server" style="">
                                        <th id="Th1" runat="server">Type</th>
                                        <th id="Th2" runat="server">Title</th>
                                        <th id="Th6" runat="server">Question</th>
                                        <th id="Th4" runat="server">Options</th>
                                        <th id="Th3" runat="server" style="width: 200px;">Actions</th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr3" runat="server">
                            <td id="Td2" runat="server" style="">
                                <asp:DataPager ID="DataPager1" runat="server">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" ButtonCssClass="GeneralButton" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
            </asp:ListView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:47:57+00:00Added an answer on June 18, 2026 at 5:47 am

    You can accomplish this hiding the cells in the ItemDataBound event of the ListView. Your code should look like this:

    first add three global properties in your page

        string type = string.Empty;
        string title = string.Empty;
        string question = string.Empty; 
    

    Then add the OnItemDataBound event to your list view

    protected void LV_ViewQuestion_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        if (e.Item.ItemType == ListViewItemType.DataItem)
        {
            Label SURVEY_TYPELabel = (Label)e.Item.FindControl("SURVEY_TYPELabel");                 
            Label SURVEY_TITLELabel = (Label)e.Item.FindControl("SURVEY_TITLELabel");                 
            Label Question_TextLabel = (Label)e.Item.FindControl("Question_TextLabel");                 
    
            if (SURVEY_TYPELabel.Text == type && SURVEY_TITLELabel == title && 
                Question_TextLabel == question)
            {
                SURVEY_TYPELabel.Visible = false;
                SURVEY_TITLELabel.Visible = false;
                Question_TextLabel.Visible = false;          
                // Do the same for all the other control in cells you need to hide
            }
            else
            {
                type = SURVEY_TYPELabel.Text;
                title = SURVEY_TITLELabel.Text;
                question = Question_TextLabel.Text;
            }
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic ListView which uses an ArrayAdapter . When a name is
I have created a dynamic listview which contains a CheckBox.what I want is at
I have a WPF ListView control for which I am dynamically creating columns. One
I have a dynamic listview with one text and one checkbox per line.when i
I have dynamic listview in which textview and edittext are two columns. The textview
I have seen some ListView dynamic growing implementations which use OnScrollListener. I would like
I have dynamic listview on my android client app that receive data from remote
I have a doubt in listview android. I am getting 3 dynamic values from
I have dynamic array filled with bytes, which are read from .raw file with
I have a dynamic tableview which has a prototype cell with a button that,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.