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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:50:01+00:00 2026-05-23T16:50:01+00:00

I am now doing a silverlight application, language is C# and I have successfully

  • 0

I am now doing a silverlight application, language is C# and I have successfully retrieved the data from web service reference and is able to display it on the mainpage.xaml in grid view. However is there any way for me to store my data as array/arraylist so that instead of displaying all the column data in the grid view, I only want it to display only one column of data. Any experts that can help me out on this? Below is my current basic code

  [OperationContract]
  public List<location> Getlocations()
  {
     DataClassesDBDataContext db = new DataClassesDBDataContext();

     var mlocations = from location in db.locations
                      select location;
     return mlocations.ToList();
  }
  • 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-23T16:50:02+00:00Added an answer on May 23, 2026 at 4:50 pm

    if you are using wcf service you have a ability to change the return type.

    In Add Service Reference click on the “Advanced” button at the bottom.
    A new modal dialog box opens “Service reference settings” there you can select “Collection Type” as Arraylist/Array/List.

    Now whenever you return List from web method you will receive the one which you have selected in “Collection Type”.(This is only available in wcf web service (.svc) and not (.asmx)

    If that is not a option then you can just change the list to array.

    var list = new List<string>{"1","2"}
    string[] arrayVal =" list.ToArray();
    

    As the question is not very clear and you say you only want to show one column in the grid you can just return one column data while returning from the web methods like

     [OperationContract]
     public List<location> Getlocations()
     {
       var db = new DataClassesDBDataContext();
    
       var mlocations = (from x in db.locations
                        select new location
                        {
                           locationColName = x.something
                        }).ToList();
       return mlocations;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight application that needs to scroll some data (like stock information)
I have been away from C++ for a couple of years now doing AS3/Flex
Right now I'm doing this: SELECT * FROM messages WHERE location_id = 7 AND
I have been doing active development in C# for several years now. I primarily
I have an OOB Silverlight 4 application (I can upgrade to Silverlight 5 if
I have a Silverlight 3 application the inside of whose grid layout root looks
I've been doing quite large application recently with Java - Swing. Now I'd like
I am now doing an application that shows the HDD usage in the system.
I have created a nice silverlight control doing exactly what I want it to
I have written a Silverlight application that is basically an account registration form. I

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.