This question is locked. New answers and comments are not allowed.
I wrote a grid sample to populate a grid. It works fine, but it's not allowing the user to reorder the columns. Then, I replaced the grid control with a standard DataGrid, and the reorder feature worked.
Any ideas??
This is my code
XAML
<telerikGrid:RadGridView Grid.Row="1"
Name="RadGridView1"
CanUserReorderColumns="True"
AutoGenerateColumns="True"
/>
C#
var myList = new ObservableCollection<Product>();
myList.Add(new Product() { Id = 1, Name = "Frame"});
myList.Add(new Product() { Id = 2, Name = "Tire" });
myList.Add(new Product() { Id = 3, Name = "Break" });
RadGridView1.ItemsSource = myList;
Thanks in advance,
Marco
Any ideas??
This is my code
XAML
<telerikGrid:RadGridView Grid.Row="1"
Name="RadGridView1"
CanUserReorderColumns="True"
AutoGenerateColumns="True"
/>
C#
var myList = new ObservableCollection<Product>();
myList.Add(new Product() { Id = 1, Name = "Frame"});
myList.Add(new Product() { Id = 2, Name = "Tire" });
myList.Add(new Product() { Id = 3, Name = "Break" });
RadGridView1.ItemsSource = myList;
Thanks in advance,
Marco
6 Answers, 1 is accepted
0
Hello Marco Azofeifa,
I've tried your example and I'm able to reorder columns. You need to drop the dragged column on the second half of the column that you want to switch with.
We are missing some visual feedback on when the drop operation will reorder the columns (for Silverlight only) but we'll add it for the future release.
Sorry for the caused inconvenience.
Sincerely yours,
Hristo
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.
I've tried your example and I'm able to reorder columns. You need to drop the dragged column on the second half of the column that you want to switch with.
We are missing some visual feedback on when the drop operation will reorder the columns (for Silverlight only) but we'll add it for the future release.
Sorry for the caused inconvenience.
Sincerely yours,
Hristo
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
Jeremy
Top achievements
Rank 1
answered on 04 May 2009, 02:50 PM
There seems to be an issue with both Column ReOrdering and Grouping when a GridView is used inside of a RadWindow.
Following is an example of the grouping and ReOrdering working when the GridView is on the Root, however once the same User Control is used inside a RadWindow it will no longer ReOrder or Group at all.
Is there currently a work around for this issue?
Thank you for your help and input.
Jeremy
Page.xaml
Page.xaml.cs
ExampleGrid.xaml
ExampleGrid.xaml.cs
Following is an example of the grouping and ReOrdering working when the GridView is on the Root, however once the same User Control is used inside a RadWindow it will no longer ReOrder or Group at all.
Is there currently a work around for this issue?
Thank you for your help and input.
Jeremy
Page.xaml
| <UserControl x:Class="WindowExample.Page" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:WindowExample="clr-namespace:WindowExample" |
| > |
| <Grid x:Name="LayoutRoot" > |
| <Grid.RowDefinitions> |
| <RowDefinition Height="50"/> |
| <RowDefinition Height="*"/> |
| </Grid.RowDefinitions> |
| <StackPanel Grid.Row="0"> |
| <Button x:Name="OpenMinHeightWindowButton" Content="Open Min Height Window" Width="150" Height="25" Click="OpenMinHeightWindowButton_Click"/> |
| <Button x:Name="OpenNewWindowButton" Content="Open New Window" Width="150" Height="25" Click="OpenNewWindowButton_Click"/> |
| </StackPanel> |
| <WindowExample:ExampleGrid x:Name="ExampleGridView" Grid.Row="1"/> |
| </Grid> |
| </UserControl> |
| using System.Windows; |
| using System.Windows.Controls; |
| using Telerik.Windows.Controls; |
| namespace WindowExample { |
| public partial class Page : UserControl { |
| public Page() { |
| InitializeComponent(); |
| } |
| private void OpenMinHeightWindowButton_Click(object sender, RoutedEventArgs e) { |
| GetNewWindow(new ExampleGrid(){MinHeight = 400}).Show(); |
| } |
| private void OpenNewWindowButton_Click(object sender, RoutedEventArgs e) { |
| GetNewWindow(new ExampleGrid()).Show(); |
| } |
| private RadWindow GetNewWindow(object WindowContent) { |
| RadWindow NewWindow = new RadWindow(); |
| NewWindow.Content = WindowContent; |
| NewWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
| return NewWindow; |
| } |
| } |
| } |
ExampleGrid.xaml
| <UserControl x:Class="WindowExample.ExampleGrid" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| xmlns:GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" |
| > |
| <Grid x:Name="LayoutRoot" > |
| <Controls:RadGridView Name="sampleRadGridView" ColumnsWidthMode="Fill" AutoGenerateColumns="False" ShowGroupPanel="True"> |
| <Controls:RadGridView.Columns> |
| <Controls:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding ContactName}"> |
| <Controls:GridViewDataColumn.CellStyle> |
| <Style TargetType="GridView:GridViewCell"> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate> |
| <Button x:Name="ActionButton" Content="Some Action" Click="ActionButton_Click"> </Button> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| </Controls:GridViewDataColumn.CellStyle> |
| </Controls:GridViewDataColumn> |
| <Controls:GridViewDataColumn HeaderText="CustomerID" IsReadOnly="True" UniqueName="CustomerID" /> |
| <Controls:GridViewDataColumn HeaderText="CompanyName" IsReadOnly="True" UniqueName="CompanyName" /> |
| <Controls:GridViewDataColumn HeaderText="Country" UniqueName="Country" /> |
| <Controls:GridViewDataColumn HeaderText="City" UniqueName="City" /> |
| <Controls:GridViewDataColumn HeaderText="ContactName" UniqueName="ContactName" /> |
| </Controls:RadGridView.Columns> |
| </Controls:RadGridView> |
| </Grid> |
| </UserControl> |
ExampleGrid.xaml.cs
| using System.Collections.ObjectModel; |
| using System.Windows.Controls; |
| namespace WindowExample { |
| public partial class ExampleGrid : UserControl { |
| private ObservableCollection<Customer> dataSource = new ObservableCollection<Customer>(); |
| public ExampleGrid() { |
| InitializeComponent(); |
| SetCustomerDataSource(); |
| this.sampleRadGridView.ItemsSource = this.dataSource; |
| } |
| private void SetCustomerDataSource() { |
| for (int i = 0; i < 10; i++) { |
| Customer aCustomer = new Customer(); |
| aCustomer.CustomerID = i.ToString(); |
| aCustomer.ContactName = "Customer " + i.ToString(); |
| dataSource.Add(aCustomer); |
| } |
| } |
| private void ActionButton_Click(object sender, System.Windows.RoutedEventArgs e) { |
| //Perform some action |
| } |
| } |
| public class Customer { |
| public string CustomerID { get; set; } |
| public string CompanyName { get; set; } |
| public string Country { get; set; } |
| public string City { get; set; } |
| public string ContactName { get; set; } |
| public bool Bool { get; set; } |
| } |
| } |
0
Marco
Top achievements
Rank 1
answered on 04 May 2009, 03:27 PM
Good catch Jeremy! That's exactly what is happening to me.
I'm looking forward to finding a workaround to this issue
Thanks,
Marco
I'm looking forward to finding a workaround to this issue
Thanks,
Marco
0
Hi Marco,
We were aware of this problem with RadWindow and have already implemented a fix. It will be available on the next internal preview drop of RadControls for Silverlight. If you want to receive the new binaries sooner please send us a support ticket.
Greetings,
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.
We were aware of this problem with RadWindow and have already implemented a fix. It will be available on the next internal preview drop of RadControls for Silverlight. If you want to receive the new binaries sooner please send us a support ticket.
Greetings,
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
Marco
Top achievements
Rank 1
answered on 06 May 2009, 04:12 PM
Thanks Stefan,
When is this internal release going to be available? I want to consider the timing for my project deliverables.
Regards,
Marco
When is this internal release going to be available? I want to consider the timing for my project deliverables.
Regards,
Marco
0
Accepted
Hi Marco,
We are pushing weekly updates each Friday night our local time (CET +1). This means that later today latest binaries will be available for download in your Client.NET account.
Kind 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.
We are pushing weekly updates each Friday night our local time (CET +1). This means that later today latest binaries will be available for download in your Client.NET account.
Kind 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.