We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do i indent/outdent rows in griddatabound hierachy

Thread ID:

Created:

Updated:

Platform:

Replies:

99287 May 11,2011 09:02 AM UTC May 24,2011 06:11 PM UTC Windows Forms 1
loading
Tags: GridControl
saumyasri
Asked On May 11, 2011 09:02 AM UTC

Hi,

i am using a griddatabound control, for displaying items in hierachial structure and i have requirement to indent/outdent the rows. i,e by clikcing on indent, the child should become the parent and parent to chils.

is it possible using Griddataboundgrid or please suggest an alternative.

thanks

Saumya


Christopher Issac Sunder K [Syncfusion]
Replied On May 24, 2011 06:11 PM UTC

Hi Saumya,

Thank you for your interest in Syncfusion products.

You can use GridGroupingControl for displaying hierarchical levels which will give us better clarifications than GridDataBoundGrid. I have created a sample for GridGroupingControl. You can make use of the below method to swap parents and children. Likewise, you can modify the method as per your application.

static void MoveCollectionItem(IList list, int oldIndex, int newIndex)
{
var temp = list[oldIndex];

if (newIndex > oldIndex)
for (var i = oldIndex; i < newIndex; ++i)
list[i] = list[i + 1];

if (newIndex < oldIndex)
for (var i = oldIndex; i > newIndex; --i)
list[i] = list[i - 1];

list[newIndex] = temp;
}

Please refer to the following sample which illustrates the same.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=SyncFusionGridProblem-1920350998.zip

Let me know if you have any other concerns.

Regards,
Christo.




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;