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.

Retrieving row in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

48607 Aug 31,2006 06:04 AM Aug 31,2006 10:01 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 31, 2006 06:04 AM

Hi, I have a GDBG and the DataSource of this grid is bounded to an ArrayList of objects. Is there a way that I can get the corresponding object(s) that the user selected from the grid?

Thanks.

Administrator [Syncfusion]
Replied On August 31, 2006 06:40 AM

Hi Kai,

Try this code to get the selected object from the grid. Please refer the attached sample for more details.

CurrencyManager cm = this.BindingContext[this.gridDataBoundGrid1.DataSource] as CurrencyManager;
ArrayList arr = cm.List as ArrayList;
Console.WriteLine("For Current Item >>>>>>>" + cm.Current);

Console.WriteLine("For Selected Item >>>>>>>" );
foreach( GridRangeInfo info in this.gridDataBoundGrid1.Selections.GetSelectedRows(false,true))
for(int i = info.Top ;i < info.Bottom;i++)
Console.WriteLine("Item >>>>>>>" + arr[i]);

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GArrayList_56ef0749.zip

Let me know if this helps.
Best Regards,
Haneef

Administrator [Syncfusion]
Replied On August 31, 2006 10:01 PM


It works as expected. Thanks.
>Hi Kai,

Try this code to get the selected object from the grid. Please refer the attached sample for more details.

CurrencyManager cm = this.BindingContext[this.gridDataBoundGrid1.DataSource] as CurrencyManager;
ArrayList arr = cm.List as ArrayList;
Console.WriteLine("For Current Item >>>>>>>" + cm.Current);

Console.WriteLine("For Selected Item >>>>>>>" );
foreach( GridRangeInfo info in this.gridDataBoundGrid1.Selections.GetSelectedRows(false,true))
for(int i = info.Top ;i < info.Bottom;i++)
Console.WriteLine("Item >>>>>>>" + arr[i]);

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GArrayList_56ef0749.zip

Let me know if this helps.
Best Regards,
Haneef

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.

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.

;