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.

Accessing a RECORD in a GridDataBoundGrid Control

Thread ID:

Created:

Updated:

Platform:

Replies:

78584 Dec 18,2008 12:26 PM Dec 20,2008 04:14 AM Windows Forms 3
loading
Tags: GridControl
Henry Thacker
Asked On December 18, 2008 12:26 PM

Can I get a Record object for a GDBG like you can from a grouped grid using the code:

Record r=this.gridGroupingControl1.Table.Records[RecordIndex];

????

If not.. I HAVE to be able to populate a record with the data, it is essential for my project.

Thanks,

Henry


Sameer Khan
Replied On December 18, 2008 01:28 PM

If that is what you are after .,, then you can index the records collection; but you have the Collection object too [the one which is the source of your grid] Wouldn't you rather have the retrieval operation on the Collection rather than the grid?

And if you are looking for the index of the grid; then the record will absolutely exist.


Henry Thacker
Replied On December 19, 2008 07:58 AM

But a RECORD object is stored in Syncfusion.Grouping.Record, so I don't think this would be applicable to something from a Data bound grid (not a grouped one).

I am quite happy to access the data source, but I need a RECORD like object.. i.e. I can access a particular column from a given record by name.. something like a hashmap for a given row in the data source.


Rajadurai C [Syncfusion]
Replied On December 20, 2008 04:14 AM

Hi Henry,

Thanks for your interest in Syncfusion products.

Apologies for the delay.

Please try the following code snippet in buttonclick event handler where it retrieves the data of the selected record through the columnname.

CurrencyManager cm = (CurrencyManager)this.BindingContext[this.gridDataBoundGrid1.DataSource];
GridRangeInfoList list;
list = this.gridDataBoundGrid1.Selections.GetSelectedRows(true, false);
foreach (GridRangeInfo range in list)
{
for (int i = range.Top; i <= range.Bottom; i++)
Console.WriteLine(((DataView)cm.List).Table.Rows[this.gridDataBoundGrid1.Binder.RowIndexToPosition(i)]["Department"]);
}


Here is a minimal sample in which this code has been implemented. Please refer to this.
http://www.syncfusion.com/support/user/uploads/F78584_eb006cf0.zip

Regards,
Rajadurai



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.

;