This is a migrated thread and some comments may be shown as answers.

[Solved] GridView Row Ordering

12 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yuri
Top achievements
Rank 1
Yuri asked on 01 Dec 2009, 01:46 PM
Hi All,

Is there a way to change GridView row ordering by drag & drop?

Best,
Yuri

12 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 01 Dec 2009, 04:06 PM
Hi Yuri,

We are preparing a blog post about this functionality. Hopefully we will be able to post the article by the end of this week. Stay tuned.


Kind regards,
Milan
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
Yuri
Top achievements
Rank 1
answered on 07 Dec 2009, 08:41 AM
Hi Milan,

Thanks for the answer! Hopefully you give me the reference to that blog.

Best,
Yuri
0
Jeremy Pryor
Top achievements
Rank 1
answered on 15 Dec 2009, 08:37 PM
Has the blog for this been posted yet?  Please help, I need to have this functionality as well.

Thanks,

JP
0
Patrick Holloway
Top achievements
Rank 1
answered on 15 Dec 2009, 11:42 PM
Please post this as soon as possible. Some of us have been waiting a long time for it.
0
Milan
Telerik team
answered on 16 Dec 2009, 05:38 PM

Hi Patrick Holloway,

Here is a sample that demonstrates row reordering with RadGridView. We would really appreciate any feedback regarding the row reorder functionality.

Thank your for your patience. 


All the best,
Milan
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
Jeremy Pryor
Top achievements
Rank 1
answered on 16 Dec 2009, 11:38 PM
Thank you Milan!

I am trying to convert this project into VB.NET and I think that I have all of it except for one line of the code in the ApplicationHelper class.  I converted the following line into VB:

    Return

 

System.Windows.Application.Current.Windows.Cast(Of Window)().FirstOrDefault(Function(w) w.IsActive)

This line is giving me the errors:
1.  'Windows' is not a member of 'System.Windows.Application'
2.  Type 'Window' is not defined.

I am not sure what this line of code is actually doing, can you help please?

Thanks,

JP

 

0
Milan
Telerik team
answered on 17 Dec 2009, 10:41 AM
Hello Jeremy Pryor,

 

This line is specific to WPF and you could remove it if you are only using Silverlight. You should also remove the conditional statements like "#if SILVERLIGHT",  "else", and "endif". 

Hope this helps.


Regards,
Milan
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
Patrick Holloway
Top achievements
Rank 1
answered on 17 Dec 2009, 05:48 PM
Works beautifully! Thanks!!

0
Jeremy Pryor
Top achievements
Rank 1
answered on 17 Dec 2009, 08:32 PM
Hi Milan.

I greatly appreicate all of you help. 

I removed all of the references to #if Silverlight and fixed those issues with my VB.NET version, but I am having difficulties with getting it to run.  Please help if you can.  I wish my company would let me code in C#, but it is a VB shop.

I have attached a screenshot of what I get.  I see the move, but the data does not show up in the drag image.  Also, none of the rows are dropping correctly either.  Again, your C# code is working fine, do you have any ideas?  I would send you my code if this

Thanks,

Jeremy
0
Patrick Holloway
Top achievements
Rank 1
answered on 17 Dec 2009, 09:59 PM
Hi Jeremy - regarding the data not showing up in the drag image, you just need to change the binding in the XAML UserControl.Resources section, here:

<DataTemplate x:Key="DraggedItemTemplate">  
   <StackPanel Orientation="Horizontal" Margin="2">  
      <TextBlock Text="{Binding Sender}" FontWeight="Bold" /> 
      <TextBlock Text=", (" Foreground="Gray" /> 
      <TextBlock Text="{Binding Subject}" Foreground="Gray" /> 
      <TextBlock Text=")" Foreground="Gray" /> 
   </StackPanel> 
</DataTemplate> 

Replace "Sender" and "Subject" with whatever you need from your data.

Hope this helps
-ph
0
Milan
Telerik team
answered on 18 Dec 2009, 08:32 AM
Hi Jeremy Pryor,

 

Patrick is correct. The DraggedItemTemplate is the template that defines the appearance of the dragged items. 

Thank you Patrick for your involvement.


Kind regards,
Milan
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
Jeremy Pryor
Top achievements
Rank 1
answered on 18 Dec 2009, 04:19 PM
Pat and Milan,

Thank you for your help.  I still don't have it working, but I will keep you updated...  You guys Rock!

JP
Tags
GridView
Asked by
Yuri
Top achievements
Rank 1
Answers by
Milan
Telerik team
Yuri
Top achievements
Rank 1
Jeremy Pryor
Top achievements
Rank 1
Patrick Holloway
Top achievements
Rank 1
Share this question
or