This question is locked. New answers and comments are not allowed.
Hello,
I'm using the GridView to display data returned from a SQL Server Analysis Services Cube. Rather than using any of the Aggregate functions, I'm going to be getting the aggregate values from the Cube itself.
I'd like to do the right thing and use TextBlock's that are bound to the backing ViewModel. But I can't seem to figure out how to make that happen. Is there are way to bind TextBlock objects in the Footer to an object outside of the object the GridView is bound to?
My thought was I currently get back a List of OlapRow's, List<OlapRow>, and bind the RadGridView to it. Everything works just fine.
Then I would have a seperate OlapRow that would represent the aggregations and bind the TextBlock's to the properties on that seperate aggregate OlapRow. But I think because the RadGridView is bound to the List<OlapRow> and the Footer is a child of RadGridView it cannot bind to an object outside the scope of the List<OlapRow>.
Is this correct?
I'm using the GridView to display data returned from a SQL Server Analysis Services Cube. Rather than using any of the Aggregate functions, I'm going to be getting the aggregate values from the Cube itself.
I'd like to do the right thing and use TextBlock's that are bound to the backing ViewModel. But I can't seem to figure out how to make that happen. Is there are way to bind TextBlock objects in the Footer to an object outside of the object the GridView is bound to?
My thought was I currently get back a List of OlapRow's, List<OlapRow>, and bind the RadGridView to it. Everything works just fine.
Then I would have a seperate OlapRow that would represent the aggregations and bind the TextBlock's to the properties on that seperate aggregate OlapRow. But I think because the RadGridView is bound to the List<OlapRow> and the Footer is a child of RadGridView it cannot bind to an object outside the scope of the List<OlapRow>.
Is this correct?
5 Answers, 1 is accepted
0
Hi Rick,
There is not problem to bind controls in the grid footer to something outside of the grid data context. I've attached small example to illustrate you this.
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
There is not problem to bind controls in the grid footer to something outside of the grid data context. I've attached small example to illustrate you this.
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rick Glos
Top achievements
Rank 1
answered on 07 Oct 2009, 11:20 PM
Hi Vlad,
Perhaps it is my ignorance. I don't understand how I would bind to something that isn't a StaticResource.
I've made a slight modification to your code to bind the DataContext to a ViewModel. I bind the grid to an ObservableCollection property like usual. It works. Now I have two additional properties hanging off the ViewModel. How do I bind things in the Footer to those properties?
Here's your example with modifications.
Perhaps it is my ignorance. I don't understand how I would bind to something that isn't a StaticResource.
I've made a slight modification to your code to bind the DataContext to a ViewModel. I bind the grid to an ObservableCollection property like usual. It works. Now I have two additional properties hanging off the ViewModel. How do I bind things in the Footer to those properties?
Here's your example with modifications.
0
Hi Rick,
Since the the grid footer DataContext is set explicitly to List<AggregateResult> and there is no property called MyAggregate2 for this context you cannot bind directly. You will need a converter for this binding or you can assign desired value programmatically.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Since the the grid footer DataContext is set explicitly to List<AggregateResult> and there is no property called MyAggregate2 for this context you cannot bind directly. You will need a converter for this binding or you can assign desired value programmatically.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rick Glos
Top achievements
Rank 1
answered on 09 Oct 2009, 09:27 PM
Hi Vlad,
I have successfully got it working programmatically.
I am however experiencing an exception of the 'Element is already the child of another element' if I try to set the Footer property to something other than just a value. So if I instantiate a TextBlock, set the TextBlock.Text property, set the TextBlock.HorizontalAlignment to Right and then set the Footer = TextBlock I get the error above.
Basically the same issue I had with the Header until I used an internal build, RadControls_for_Silverlight_2009_2_0911_Dev, as discussed here.
Are you aware of the Footer having the same issue as the Header and has it been addressed since the Sep 11 build?
I have successfully got it working programmatically.
I am however experiencing an exception of the 'Element is already the child of another element' if I try to set the Footer property to something other than just a value. So if I instantiate a TextBlock, set the TextBlock.Text property, set the TextBlock.HorizontalAlignment to Right and then set the Footer = TextBlock I get the error above.
Basically the same issue I had with the Header until I used an internal build, RadControls_for_Silverlight_2009_2_0911_Dev, as discussed here.
Are you aware of the Footer having the same issue as the Header and has it been addressed since the Sep 11 build?
0
Hello Rick,
We believe that this error is fixed already and most probably today we will upload our second Q3 beta.
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
We believe that this error is fixed already and most probably today we will upload our second Q3 beta.
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
