how to display 10000 records in silver light grid

Posted by Venky.Net under Silverlight on 6/27/2013 | Points: 10 | Views : 1158 | Status : [Member] | Replies : 2
hi
i am using silverlight grid display the values,my table contain 10000 records .but not show the values ,i got "server returned error message" how to solve this problem please anyone help me




Responses

Posted by: Vuyiswamb on: 6/27/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Let us see your Code

Thank you for posting at Dotnetfunda
[Administrator]

Venky.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Venky.Net on: 6/27/2013 [Member] Starter | Points: 25

Up
0
Down
this is my code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using SilverlightQU.ServiceReference1;
using System.Windows.Browser;
using System.Collections.ObjectModel;

namespace SilverlightQU
{
public partial class ProductItemMaster : Page
{
Storyboard _timer = new Storyboard();
ObservableCollection<ProductItemMasterInfo> StoreProjectDetails = new ObservableCollection<ProductItemMasterInfo>();
List<string> listSortOrder = new List<string>();
bool editing;
Service1Client client = null;
public ProductItemMaster()
{
InitializeComponent();
client = new Service1Client();

client.Endpoint.Address = HelperClass.GetAddress;
client.GetProductItemMasterGetCompleted += new EventHandler<GetProductItemMasterGetCompletedEventArgs>(client_GetProductItemMasterGetCompleted);
client.GetProductItemMasterGetAsync("ProductItemMaserList");
dataGrid1.BeginningEdit += OnBeginningEdit;
client.CloseCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_CloseCompleted);
client.CloseAsync();
}
void OnBeginningEdit(object sender, DataGridBeginningEditEventArgs e)
{
editing = true;
}
void client_CloseCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
//throw new NotImplementedException();
}
void client_GetProductItemMasterGetCompleted(object sender, GetProductItemMasterGetCompletedEventArgs e)
{
dataGrid1.ItemsSource = e.Result;
lblcount.Content=" Total No. of Records : "+ e.Result.Count.ToString();
StoreProjectDetails = e.Result;
}
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
private void Edit_Click(object sender, RoutedEventArgs e)
{
ProductItemMasterInfo fi = dataGrid1.SelectedItem as ProductItemMasterInfo;
Uri url = new Uri("ProductItemMaster.aspx?IDs=" + fi.ID + "", UriKind.Relative);
HtmlPage.Window.Navigate(url);
}
PopupItem item;
void item_SubmitClicked(object sender, EventArgs e)
{
client = new Service1Client();
client.Endpoint.Address = HelperClass.GetAddress;
client.GetProductItemMasterGetCompleted += new EventHandler<GetProductItemMasterGetCompletedEventArgs>(client_GetProductItemMasterGetCompleted);
client.GetProductItemMasterGetAsync("ProductItemMaserList");
dataGrid1.BeginningEdit += OnBeginningEdit;
client.CloseCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_CloseCompleted);
client.CloseAsync();
}
private void linkunit_Click(object sender, RoutedEventArgs e)
{
ProductItemMasterInfo fields = dataGrid1.SelectedItem as ProductItemMasterInfo;
item = new PopupItem(Convert.ToInt32(fields.ID));
item.Show();
//item.MaxHeight = 500;

//item.MaxWidth = 500;
this.Visibility = System.Windows.Visibility.Visible;
this.Visibility = Visibility.Visible;
item.SubmitClicked += new EventHandler(item_SubmitClicked);
}
private void button1_Click(object sender, RoutedEventArgs e)
{
var filterdData = from data in StoreProjectDetails
where
data.Pro_ItemCode.ToUpper().StartsWith(txtproduct.Text != "" ? txtproduct.Text.ToUpper() : data.Pro_ItemCode.ToUpper())
select data;
dataGrid1.ItemsSource = filterdData;
txtproduct.ItemsSource = filterdData;
listSortOrder.Clear();
lblcount.Content = "Total No. of Records : " + filterdData.Count();

}
public bool CountryFilter(string text, object item)
{
ProductItemMasterInfo country = (ProductItemMasterInfo)item;
return ((country.Pro_ItemCode.StartsWith(text)) || (country.Pro_ItemCode.Contains(text)));
}
//private void txtproduct_TextChanged(object sender, RoutedEventArgs e)
//{
// txtproduct.ItemFilter = CountryFilter;
//}
private void lnldelete_Click(object sender, RoutedEventArgs e)
{
ProductItemMasterInfo field = dataGrid1.SelectedItem as ProductItemMasterInfo;
MessageBoxResult result = MessageBox.Show("Do you want to delete \"" + field.Pro_ItemCode + "\"?", "Delete", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
//List<object> = new List<object>();
//list.Add(field.CountryName);
ObservableCollection<object> list = new ObservableCollection<object>();
list.Add(field.Pro_ItemCode);
client = new Service1Client();
client.Endpoint.Address = HelperClass.GetAddress;
client.DeleteAllCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_DeleteAllCompleted);
client.DeleteAllAsync("ProductItemMaserDelete", list);
client.GetProductItemMasterGetCompleted += new EventHandler<GetProductItemMasterGetCompletedEventArgs>(client_GetProductItemMasterGetCompleted);
client.GetProductItemMasterGetAsync("ProductItemMaserList");
dataGrid1.BeginningEdit += OnBeginningEdit;
client.CloseCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_CloseCompleted);
client.CloseAsync();
MessageBox.Show("\"" + field.Pro_ItemCode + "\" Deleted Successfully!");
}
}

void client_DeleteAllCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
//throw new NotImplementedException();
}

}
}


Venky.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response