This question is locked. New answers and comments are not allowed.
hi i have a problem :)
i am very new on silverlight..
i am good on directx, directshow, winforms, actionscript etc.. but silverlight is very very interesting for me now..
i have an application works on winforms and i am converting all forms to silverlight from stratch.. (on winforms i am also using telerik radgrid)
the winforms works fast and good..
i am using silverlight because 1- some of our clients uses mac and 2- i am making many changes on application, i dont want to deploy each time ..
on silverlight, i have a problem, maybe it is not a big problem but i couldn't find a way to solve better..
i have 2 table
schedules and schedules_details
schedules table have scheduleID column
and schedules_details table also have a column named scheduleID
i used telerik orm to connect to sql 2008 express R2 on serverside..
i use linq query to get data from that 2 tables. put them in a single class.
i get data with mvc to silverlight, because i get a large data and i am compressing that single class containing 2 table, with ICSharpCode.SharpZipLib for on serverside and decompressing it with ICSharpCode.SharpZipLib for silverlight. (without compressing, the data is 20mb, when i compress it, it becomes 300kb so i dont want to use ria,domain etc services, i am fine with mvc) .
schedules table have 3 row
and the childs have more than 1.000 rows for each.. each row have 30 columns..
i get them to my silverlight application without any problem. i have each table data.
when i show them seperately on 2 different grid, i can see data without any problem.
4.000 rows of schedules_details comes very fast when i show it seperately on a grid.
but when i put them in hierachical view, it becomes very very very slow..
i see schedules rows fast but when i click on any rows (+) sign to drill down.. it takes more than 3 minutes to show the child.
is there any better way to join those 2 tables and show them faster?
or can you show me an example to join that 2 table and show them simpler as hierachical?
here is the xaml :
and here is the c# code:
i also attached a screenshot, there are 3 split panel. at the right side, you will see the master detail.. 3 rows of schedules, and 1 drilled child..
sorry for my english, it is not my native language.. :))
Serkan
i am very new on silverlight..
i am good on directx, directshow, winforms, actionscript etc.. but silverlight is very very interesting for me now..
i have an application works on winforms and i am converting all forms to silverlight from stratch.. (on winforms i am also using telerik radgrid)
the winforms works fast and good..
i am using silverlight because 1- some of our clients uses mac and 2- i am making many changes on application, i dont want to deploy each time ..
on silverlight, i have a problem, maybe it is not a big problem but i couldn't find a way to solve better..
i have 2 table
schedules and schedules_details
schedules table have scheduleID column
and schedules_details table also have a column named scheduleID
i used telerik orm to connect to sql 2008 express R2 on serverside..
i use linq query to get data from that 2 tables. put them in a single class.
i get data with mvc to silverlight, because i get a large data and i am compressing that single class containing 2 table, with ICSharpCode.SharpZipLib for on serverside and decompressing it with ICSharpCode.SharpZipLib for silverlight. (without compressing, the data is 20mb, when i compress it, it becomes 300kb so i dont want to use ria,domain etc services, i am fine with mvc) .
schedules table have 3 row
and the childs have more than 1.000 rows for each.. each row have 30 columns..
i get them to my silverlight application without any problem. i have each table data.
when i show them seperately on 2 different grid, i can see data without any problem.
4.000 rows of schedules_details comes very fast when i show it seperately on a grid.
but when i put them in hierachical view, it becomes very very very slow..
i see schedules rows fast but when i click on any rows (+) sign to drill down.. it takes more than 3 minutes to show the child.
is there any better way to join those 2 tables and show them faster?
or can you show me an example to join that 2 table and show them simpler as hierachical?
here is the xaml :
<telerik:RadGridView Margin="0,0,0,0" ShowGroupPanel="False" ShowColumnHeaders="True" IsReadOnly="True" IsBusy="False" Name="ScheduleGrid"> <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition /> </telerik:RadGridView.ChildTableDefinitions> <telerik:RadGridView.HierarchyChildTemplate> <DataTemplate> <telerik:RadGridView ScrollMode="Deferred" DataLoadMode="Asynchronous" AutoGenerateColumns="True" Name="childGrid" Loaded="childGrid_Loaded" ShowGroupPanel="False" ShowColumnHeaders="True" IsReadOnly="True" IsFilteringAllowed="False" CanUserResizeColumns="False" CanUserFreezeColumns="False" > </telerik:RadGridView> </DataTemplate> </telerik:RadGridView.HierarchyChildTemplate> </telerik:RadGridView>and here is the c# code:
private void UserControl_Loaded(object sender, RoutedEventArgs e) { initSettings(); client.getScheduleForDeviceCompleted += new EventHandler<silverlightservices.getScheduleForDeviceCompletedEventArgs>(client_getScheduleForDeviceCompleted); client.getScheduleForDeviceAsync(1); //1 is the id of schedule
}public silverlightservices.SilverlightServicesstgetSchedule st = new silverlightservices.SilverlightServicesstgetSchedule(); void client_getScheduleForDeviceCompleted(object sender, silverlightservices.getScheduleForDeviceCompletedEventArgs e) { Wrappers w = new Wrappers(); //i have a wrapper class to decompress and deserialize
st = (silverlightservices.SilverlightServicesstgetSchedule)w.DecompressAndDeserialize(st.GetType(), e.Result); ScheduleGrid.ItemsSource = null; ScheduleGrid.AutoGenerateColumns = true; ScheduleGrid.ItemsSource = st.schedule;//also i have st.scheduledetail ,
//two table comes with data as i wanted. problem starts here.
//i couldn't join them. so i use child loaded event
}private void childGrid_Loaded(object sender, RoutedEventArgs e) { var dataControl = (GridViewDataControl)sender; var schedule = (silverlightservices.Schedules)dataControl.ParentRow.DataContext;
//now i get the schedule row
var detail = new List<schedules_details>(); var worker = new BackgroundWorker(); worker.DoWork += (object s, DoWorkEventArgs args) => { (from i in st.scheduledetail where i.scheduleID==schedule.scheduleID ).ToList().ForEach(detail.Add); }; worker.RunWorkerAsync(); worker.RunWorkerCompleted += (object s, RunWorkerCompletedEventArgs args) => { dataControl.ItemsSource = null; dataControl.AutoGenerateColumns = true; dataControl.ItemsSource = detail; }; }i also attached a screenshot, there are 3 split panel. at the right side, you will see the master detail.. 3 rows of schedules, and 1 drilled child..
sorry for my english, it is not my native language.. :))
Serkan
