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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

looping through a databoundgrid

Thread ID:

Created:

Updated:

Platform:

Replies:

48877 Sep 5,2006 09:14 PM UTC Sep 6,2006 04:20 AM UTC WinForms 1
loading
Tags: GridControl
Charlie Mao
Asked On September 5, 2006 09:14 PM UTC

Hi,
I was wondering if anyone knows how to loop through a datagrid and find out the rows that have been selected.

Administrator [Syncfusion]
Replied On September 6, 2006 04:20 AM UTC

Hi Charlie,

If you want to implement a find functionality in the grid, refer the below forum thread for more details.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=45839

If you want to find a selected rows in the grid, use the Model.Selection property.The Model.Selections property manages the range selection in a grid. Below is a code snippet.

Console.WriteLine("Selected Ranges");
foreach( GridRangeInfo range in this.gridDataBoundGrid1.Model.Selections.Ranges)
{
Console.WriteLine(range.Info);
}

To loop through the grid, you can use the Model Property of the grid. Below is a code snippet.

for(int i = 0;i<= this.grid.Model.RowCount;i++)
{
for(int j = 0;j<= this.grid.Model.ColCount;j++)
Console.WriteLine("=>" + this.grid.Model[i,j]);
Console.WriteLine(" ");
}

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.

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

;