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 6661871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:19:48+00:00 2026-05-26T02:19:48+00:00

I am new in list view . I am using this code to display

  • 0

I am new in list view .

I am using this code to display data from a text file in a list view,

        int iRecords = 0;
        int iDate = 0;

        using (var sr = File.OpenText("C:\\test.txt"))
        {
            string line;
            bool flag = true;

            while ((line = sr.ReadLine()) != null)
            {
                string[] reader2 = line.Split(',');
                string Date = reader2[0];
                string rate = reader2[1];
                string Sym = reader2[2];
                double price = Convert.ToDouble(reader2[3]);
                double Sell = Convert.ToDouble(reader2[4]);
                double Buy = Convert.ToDouble(reader2[5]);

                ListViewItem lItem = listView1.Items.Insert(iRecords, Date.ToString());
                //lItem.SubItems.Add(Date.ToString());
                lItem.UseItemStyleForSubItems = false;
                lItem.SubItems.Add(rate .ToString());
                lItem.SubItems.Add(Sym .ToString());
                lItem.SubItems.Add(Sell.ToString(), Color.White, Color.Red, lItem.Font);
                lItem.SubItems.Add(Buy .ToString()(), Color.Green, Color.Red, lItem.Font);
                iRecords++;
            }
        }

In this code ,it is displaying the date from a text file

For example

  • Apple – 5 Min,9532,Buy,20100104,90500,5225,5232,5210,5219.7,469950,0
  • Apple – 5 Min,9532,Sell,20100104,91000,5221.25,5225.9,5215,5221.7,387650,0

the first three arrays are same , they are * Apple – 5 Min,9532

I want to display the first line as it is ,
and the second line from sell, i want to hide the first three arrays in the second line

and later for Mange the same

  • Mango – 5 Min,9532,Buy,20100104,90500,5225
  • Mango – 5 Min,9532,Sell,20100104,91000,5221.25

I wanto to display something like this in a listview

  • Mango – 5 Min,9532,Buy,20100104,90500,5225

                 Sell,20100104,91000,5221.25
    

Thanks In Advance.

  • 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-26T02:19:49+00:00Added an answer on May 26, 2026 at 2:19 am

    Try This..

    Set the width of the column/s you want to hide to 0.

    Example:
    lstVItem.Columns[0].Width = 0;

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

Sidebar

Related Questions

i have this code: var list = new List<int>(); for(int i=0;i<10;i++) list.Add(i); for(int i=0;i<10;i++)
I am using list view to display access database data. I am a column
We have created a new List View Style that shows thumbnails from a picture
Given the following code: var people = new List<person>(){ new person { Name =
My App has a List-view to display values from an SQLite DB. There is
I am using this following code which creates a ListView with text and an
I'm using the new ASP.Net ListView control to list database items that will be
I'm adding a new field to a list and view. To add the field
I have a list like this Dim emailList as new List(Of String) emailList.Add(one@domain.com) emailList.Add(two@domain.com)
I am using listview to display data, inside listview i am using image in

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.