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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

75406 Jul 24,2008 03:59 PM UTC Jul 29,2008 01:48 PM UTC WinForms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 24, 2008 03:59 PM UTC

I have a a grid with a master-detail relationship. I would like to iterate through each row and column and check the cell values one by one. I can't find a sample that helps me out 100%. There won't be any selected items at the time I want to do this and no events will be fired by the grid to kick off this process. Can anyone assist?

Thanks


Sri Rajan [Syncfusion]
Replied On July 25, 2008 10:28 AM UTC

Hi MrMad,

Thank you for your interest in Syncfusion products.

You need to handle TableControlPrepareViewStyleInfo event to iterate each cell and check the values in MasterDetail GridGroupingControl. Please refer the below code for more details.

void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
if (e.Inner.Style.Text == "40")
{
e.Inner.Style.BackColor = Color.Red;
}
}

Please let me know if this helps.

Best Regards,
Srirajan.


Administrator [Syncfusion]
Replied On July 25, 2008 12:13 PM UTC

Hi Srirajan,

Thanks for your assistance. The event you mentioned will not be fired at the time I want to scan through the cell values. I'm actually trying to convert an Infragistics grid and replace the following code:

foreach (Infragistics.Win.UltraWinGrid.UltraGridBand oBand in grdTasks.DisplayLayout.Bands)
{
foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn oColumn in oBand.Columns)
{
foreach (Infragistics.Win.UltraWinGrid.UltraGridRow oRow in grdTasks.Rows)
{
string cellValue = oRow.Cells[oColumn].Text
}
}
}

Thanks


Sri Rajan [Syncfusion]
Replied On July 28, 2008 07:29 AM UTC

Hi MrMad,

Thank you for your interest in Syncfusion products.

If your intension is to iterate through each row and column and check the cell values one by one, then please refer the code below. But if you want to change the cell properties(just like backcolor, celltype etc.,), then you can do that only using TableControlPrepareViewStyleInfo or QueryCellInfo events.

int rc=this.gridGroupingControl1.TableControl.Model.RowCount;
int cc=this.gridGroupingControl1.TableControl.Model.ColCount;
for (int i = 4; i <=rc; i++)
{
for (int j = 1; j <=cc; j++)
{
Console.WriteLine(this.gridGroupingControl1.TableControl.Model[i, j].Text);
}
}


Please let me know if you have any further questions.

Best Regards,
Srirajan.



Administrator [Syncfusion]
Replied On July 29, 2008 01:48 PM UTC

Very useful. Thanks.


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

;