The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team August 31, 2006 10:40 AM UTC
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
ADAdministrator Syncfusion Team September 1, 2006 02:01 AM UTC
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