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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:32:52+00:00 2026-05-24T08:32:52+00:00

So I have a datagrid in Silverlight that is bound to a WCF that

  • 0

So I have a datagrid in Silverlight that is bound to a WCF that populates a list of class. I basically a pass a parameter to a Linq query. When I do a second query I get double the results, a third triple and so forth. What can I do to make it so when I send a call out to the service that I only get one set of results. I have attached my code in case it helps anyone.

    private void button1_Click(object sender, RoutedEventArgs e)
    {

        dgOrder.ItemsSource = null;
        Uri address = new Uri(Application.Current.Host.Source, "../Services/Service1.svc");
        //var client = new Services.dataserviceClient("CustomBinding_dataservice", address.AbsoluteUri);
        var client = new ServiceReference2.Service1Client("CustomBinding_Service1", address.AbsolutePath);

        client.GetOrderCompleted += (s, ea) =>
            {
                dgOrder.AutoGenerateColumns = false;
                //dgOrder.ColumnWidth.Value = 100;





                dgOrder.Columns.Add(CreateTextColumn("SKU", "SKU"));
                dgOrder.Columns.Add(CreateTextColumn("productname", "Product Name"));
                dgOrder.Columns.Add(CreateTextColumn("itemnumber", "Item Number"));
                dgOrder.Columns.Add(CreateTextColumn("cost", "Cost"));
                dgOrder.Columns.Add(CreateTextColumn("asin", "ASIN"));
                dgOrder.Columns.Add(CreateTextColumn("pendingorder", "Rank"));
                dgOrder.Columns.Add(CreateTextColumn("rank", "Node"));
                //dgOrder.Columns.Add(CreateTextColumn("w4", "AMZN"));
                dgOrder.Columns.Add(CreateTextColumn("amazon", "AMZN"));
                dgOrder.Columns.Add(CreateTextColumn("ourprice", "OurPrice"));
                dgOrder.Columns.Add(CreateTextColumn("bbprice", "BuyBox"));
                dgOrder.Columns.Add(CreateTextColumn("afner", "AFN"));
                dgOrder.Columns.Add(CreateTextColumn("quantity", "INV"));
                dgOrder.Columns.Add(CreateTextColumn("w4", "W4"));
                dgOrder.Columns.Add(CreateTextColumn("w3", "W3"));
                dgOrder.Columns.Add(CreateTextColumn("w2", "W2"));
                dgOrder.Columns.Add(CreateTextColumn("w1", "W1"));
                dgOrder.Columns.Add(CreateTextColumn("order", "Order"));
                dgOrder.Columns.Add(CreateTextColumn("total", "Total"));
                dgOrder.Columns.Add(CreateTextColumn("profit", "Profit"));
                dgOrder.Columns.Add(CreateTextColumn("percent", "Percent"));
                dgOrder.Columns.Add(CreateHyperlink("asin"));
                dgOrder.ItemsSource = ea.Result;
                Original = ea.Result;

            };
        client.GetOrderAsync(txtCompany.Text);

    }
  • 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-24T08:32:53+00:00Added an answer on May 24, 2026 at 8:32 am

    The problem is , you are creating a new(duplicate) event handler every time you press the Button. Due to having an extra event for each button pres you do, you get extra sets of data. You need to create your Event.Completed method outside the Button.Cliked event.

    To clarify:

        public partial class NewPage : Page
        {
            Uri address = new Uri(Application.Current.Host.Source, "../Services/Service1.svc");
            ServiceReference2.Service1Client client = new ServiceReference2.Service1Client("CustomBinding_Service1", address.AbsolutePath);
    
            public NewPage()
            {
                client.GetOrderCompleted += (s, ea) =>
                {
                    //YOUR CODE
                };
            }
    
            private void button1_Click(object sender, RoutedEventArgs e)
            {
    
                dgOrder.ItemsSource = null;
                client.GetOrderAsync(txtCompany.Text);
    
            }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight 2.0 DataGrid that contains a list of items that needs
I have found that datagrid columns can be dynamically created and bound in Silverlight.
I have a Silverlight 4 application that uses a DataGrid. This DataGrid is bound
I have 2 silverlight controls on a form; datagrid which is bound to list
I have bound a DataGrid in Silverlight via WCF RIA services and have custom
I have a Silverlight DataGrid that contains a single template column which displays a
I have a Silverlight DataGrid that's being populated with different types of data for
I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I have a Silverlight application that is using a DataGrid. Inside of that DataGrid
I have a Silverlight 4 DataGrid which has its ItemsSource bound to an ObservableCollection

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.