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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:34:40+00:00 2026-06-01T17:34:40+00:00

Using AddRange in a ListView When you have a custom collection and want to

  • 0

Using AddRange in a ListView When you have a custom collection and want to add 2 columns (properties) of the collection Items to the ListView

Preferably do this via Telerik ListView

a similar code- it is not correct because of this line :

ListViewDataItem(wi.Name, wi.ID)

I want a better approach if possible

        ListViewDataItem[] elements ;
        ListViewDataItem lvi; 
        int c = 0 ;
        Collection.ForEach(wi =>
        {
            lvi = new ListViewDataItem(wi.Name, wi.ID);
            elements[c]  = lvi ;
            c += 1 ;
            //LvCollection.Items.Add(wi.Name, wi.ID);
        });

        LvCollection.Items.AddRange(elements);

thanks,
any help would be appreciated

  • 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-01T17:34:41+00:00Added an answer on June 1, 2026 at 5:34 pm

    Just a guess, but looking at the Telerik documentation something like

    LvCollection.Items.AddRange( 
        Collection.Select(wi => new ListViewDataItem( 
            wi.Name, new string[]{wi.ID.ToString()} ) ).ToArray() );
    

    or

    LvCollection.Items.AddRange( 
        Collection.Select(wi => new ListViewDataItem( 
            'test', new string[]{wi.Name, wi.ID.ToString()} ) ).ToArray() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using listview control with the following parameters set: this.listView1.BackColor = System.Drawing.Color.Gainsboro; this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[]
I have created an asp.net application using Entity Framework. In this I want to
I have tried to remove specific items from a listview using the RemoveAt() method.
I have a ListView to show some images (using ImageList ). Everything works fine
I have an array of objects that I'm trying to add to the Items
I've a ListView with two columns and i'm filling the ListView using the code
(note: I have labelled this C# but I am using Monotouch, so it might
I create a Range object and then add this Range to selection window.getSelection ().addRange(myRange);
I have a collection lets say list of integers and looping through it using
I have the following query which I want to sort or filter using projected

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.