Hi,
I created one question paper using listbox in silverlight. now i want to implement paging for it. i am fetching data from database in to listbox. for that i return dataset in websevice and i attach that to listbox. now i took datapager control to implement the paging . but i am not able to implement . can any body help me
Thanks & Regards
P.Nagaraju
Loading
Dinesh BeniwalPosted Aug 2, 2011, 12:25 AM
If your query is solved then Mark as Accepted answer.
Thanks
nagarajuPosted Aug 2, 2011, 12:22 AM
Priya LingePosted Aug 1, 2011, 8:22 AM
Try this.
public MainPage()
{
InitializeComponent();
getdata();
}
public void getdata()
{
ServiceReference1.Service1Client ser = new ServiceReference1.Service1Client();
ser.DoWorkCompleted += new EventHandler
ser.DoWorkAsync();
}
void ser_DoWorkCompleted(object sender, ServiceReference1.DoWorkCompletedEventArgs e)
{
PagedCollectionView pcv = new PagedCollectionView(e.Result);
dataPager1.Source = pcv;
dataPager1.PageSize = 3;
listBox1.ItemsSource = pcv;
//listBox1.ItemsSource = e.Result;
listBox1.DisplayMemberPath = "Name";
}
Please see attached file.
Hope this will help you.
Thanks.