Jon Bergquist
Top achievements
Rank 1
Jon Bergquist
asked on 12 Feb 2009, 08:55 PM
Hi - is it possible to rotate our columns and rows when we databind a list object to the grid? Basically, we are attempting to rotate our data so that the columns become rows and rows become columns.
Thanks
Jon
Thanks
Jon
9 Answers, 1 is accepted
0
Hi Jon,
Currently the grid does not support this functionality. The only way to achieve this is to transform your data source. I have prepared an example solution that shows how to achieve this for any .NET collection (IEnumerable<T>). Hope you will find it useful.
Regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Currently the grid does not support this functionality. The only way to achieve this is to transform your data source. I have prepared an example solution that shows how to achieve this for any .NET collection (IEnumerable<T>). Hope you will find it useful.
Regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 17 Feb 2009, 07:26 PM
That is some fancy code. I don't quite follow it but it does do the trick. One more thing - is it possible to label the side bars? What I'm looking to do is rotate the columns but also l would like to label the sides - similar to what you would see in a spreadsheet. I have a screenshot of a mockup but I don't think attachments can be uploaded in your site.
Thanks
Thanks
0
Jon Bergquist
Top achievements
Rank 1
answered on 18 Feb 2009, 08:29 PM
0
Hello Jon Bergquist,
The only way to create something similar to a spreadsheet labeling is to define an unbound column with a custom cell style. I'm sending you a sample project that demonstrates that.
I've created a custom cell style that host a TextBox which is bound to the cell's data context and uses a converter to determine that label should be applied to each row.
Hope this works.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The only way to create something similar to a spreadsheet labeling is to define an unbound column with a custom cell style. I'm sending you a sample project that demonstrates that.
I've created a custom cell style that host a TextBox which is bound to the cell's data context and uses a converter to determine that label should be applied to each row.
Hope this works.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 20 Feb 2009, 11:14 PM
Thank you for that. In the ConvertToList method I would like to conditionally prevent objects from getting loaded in the list. I can't seem to access the transposed fields though. Is this possible?
0
Hello Jon Bergquist,
You can define a where clause to filter the transposed result. Look at line 5.
All the best,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You can define a where clause to filter the transposed result. Look at line 5.
public Page() | |
{ | |
InitializeComponent(); | |
Func<object, bool> whereClause = (obj) => obj.GetType().GetProperty("Customer 1").GetValue(obj, null).Equals(1); | |
IList<Customer> customers = Customer.GetAll(); | |
IEnumerable transposed = customers.Transpose(); | |
TranspodedCustomersList = ConvertToList(transposed).Where(whereClause).ToList(); | |
GridView.ItemsSource = customers; | |
GridViewTransposed.ItemsSource = new ProxyEnumerable(TranspodedCustomersList); | |
} |
All the best,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Le_Roy
Top achievements
Rank 2
answered on 08 Apr 2010, 10:49 AM
Hello. Got some troubles.
I was trying to transpond data received from asmx web service.
It doesn't works. Data is shown somehow weird %)
Screenshot attached.
Hope for your help. Tx.
I'll try to post code, a little bit later.
UPDATE: Found my mistake. Tx alot!
I was trying to transpond data received from asmx web service.
It doesn't works. Data is shown somehow weird %)
Screenshot attached.
Hope for your help. Tx.
I'll try to post code, a little bit later.
UPDATE: Found my mistake. Tx alot!
0
Manish Kumar
Top achievements
Rank 1
answered on 28 Sep 2010, 03:00 PM
Hi there,
I am facing similar problem while rendering Rad gridview with the transposed data. for reference i have attached the image of the screenshot. I want to show data in gridview where column acts as Horizontal and rows are shown vertically
Thanks... problem identified...
thanks
Manish Kumar
I am facing similar problem while rendering Rad gridview with the transposed data. for reference i have attached the image of the screenshot. I want to show data in gridview where column acts as Horizontal and rows are shown vertically
Thanks... problem identified...
thanks
Manish Kumar
0
Hi,
Vlad
the Telerik team
You can use the approach demonstrated in this blog post.
Sincerely yours,Vlad
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items