Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / December 2004

Tip: Looking for answers? Try searching our database.

Winforms Datagrid Control Sorting problem while drag-and-drop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sarang Bapat - 29 Dec 2004 09:27 GMT
Hi all,

I have an interesting problem here.

I have created a custom datagrid control which is inherited from the
Standard Winforms Datagrid(System.Windows.Forms.Datagrid). I have included
an additional capability of dragging and dropping the columns(ie. re-order
the columns) on the fly to the existing control. This works fine, but
problem arises when the AllowSorting property is set to true. When I drag
and drop the column with the AllowSorting property(of the grid or the
TableStyle) set to true, it automatically sorts the column which is
drag-n-dropped. I tried to set the AllowSorting property to false while
dragging the column, but it resets the whole stuff, ie. it does not preserve
the existing sort order after drag-and-drop.

Is there any way that can prevent this behaviour?
adr - 30 Dec 2004 14:34 GMT
Look at this article maybe it can help you.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html
/dragdrop_datagrid.asp

David
Sarang Bapat - 31 Dec 2004 05:46 GMT
Hi David,

I have used the same code in my app. My problem is after using this code,
the sorting order is not behaving as expected as I have mentioned in the
scenario.

Regards,
Sarang Bapat

> Look at this article maybe it can help you.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html
/dragdrop_datagrid.asp

> David

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.