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

  • SEARCH
  • Home
  • 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 7308365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:32:51+00:00 2026-05-28T23:32:51+00:00

This is my first attempt at asp.net and webforms, windowsforms, all of it. I

  • 0

This is my first attempt at asp.net and webforms, windowsforms, all of it. I originally populated data in a listbox, but I could only get one column and thought the listView sounded like it would do what I wanted.

The most promising solution I found was this:

    DataSet listData = new DataSet();
    CancellationsControls cancelCtrl = new CancellationsControls();
    listData = cancelCtrl.GetScheduledReleaseDataSet();

    DataTable dtable = listData.Tables[0];

    scheduledReleasesTag.Items.Clear();
    foreach (DataRow row in dtable.Rows)
    {
        string[] ar = Array.ConvertAll(row.ItemArray, p => p.ToString());
        scheduledReleasesTag.Items.Add(new ListViewDataItem(ar));
    }

The dtable is a custom table of a query joining a number of tables.

in the foreach loop the ar string array succesfully shows the colums of data that I want, but the ListViewDataItem requires two int arguments instead of a string array like the example I pulled this from.

I’ve tried to figure out more about how the listView control works, but this is as close as I have been able to get to getting anything. Any help with explanations would be very appreciated.

Thank you 🙂

  • 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-05-28T23:32:52+00:00Added an answer on May 28, 2026 at 11:32 pm

    I’m pretty beginner in asp, but to bind ListView control with data, smth like this should work:

    DataSet listData = new DataSet();
    CancellationsControls cancelCtrl = new CancellationsControls();
    listData = cancelCtrl.GetScheduledReleaseDataSet();
    
    DataTable dtable = listData.Tables[0];
    ListView1.DataSource = dtable;
    ListView1.DataBind();
    

    Now we have to create an ItemTemplate. Your ListView control should look like:

    <asp:ListView ID="ListView1" runat="server">
           <ItemTemplate>
          <tr id="Tr1" class="item" runat="server">
            <td>
              <asp:Label ID="column_name" runat="server" Text='<%# Eval("column_name") %>' />
            </td>
            </tr>
            <tr id="Tr2" class="item" runat="server">
            <td>
              <asp:Label ID="another_column_name" runat="server" Text='<%# Eval("another_column_name") %>' />
            </td>
            </tr>
            </ItemTemplate> 
    </asp:ListView>
    

    Just replace markers(column_name,another_column_name) with names of columns, that contains data you want to display. This template displays pairs of rows values from two columns one by one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first attempt at doing roles for asp.net, what I have is
This is my first attempt to build an ASP.NET server control. Writing the control
I have compiled a simple ASP.NET project to test first data global gateway API
this if my first attempt at using streaming for WCF, and I am struggling
This is my first attempt to create a GUI in MATLAB. I haven't been
this is my first attempt at a responsive design so excuse me if this
Because this is my first attempt at an extension method that seems quite useful
This is pretty strange (admitedly, this is my first attempt with python / sqlite),
I'm trying to create a simple threading procedure (granted this is my first attempt
Preface I've rarely ever been a JS developer and this is my first attempt

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.