all groups > dotnet windows forms databinding > december 2004 >
You're in the

dotnet windows forms databinding

group:

Winforms Datagrid Control Sorting problem while drag-and-drop


Winforms Datagrid Control Sorting problem while drag-and-drop Sarang Bapat
12/29/2004 2:57:46 PM
dotnet windows forms databinding:
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?

Re: Winforms Datagrid Control Sorting problem while drag-and-drop adr
12/30/2004 6:34:22 AM
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
Re: Winforms Datagrid Control Sorting problem while drag-and-drop Sarang Bapat
12/31/2004 11:16:55 AM
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

[quoted text, click to view]

AddThis Social Bookmark Button