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

Problem with changing background color of Row

Thread ID:

Created:

Updated:

Platform:

Replies:

59513 Apr 16,2007 12:34 PM UTC Apr 16,2007 12:37 PM UTC WinForms 1
loading
Tags: GridControl
Rahul Hans
Asked On April 16, 2007 12:34 PM UTC

Hi

This problem relates to

Syncfusion.Windows.Forms.Grid.GridControl

I am using a tabBarSplitterControl and am dynamically adding a GridControl to a TabBarPage and the TabBarPage to the tabBarSplitterControl.

I am also subscribing to the CurrentCellActivated
event of the new GridControl

In this event I am using the following code

GridControl item = (GridControl)sender;
GridCurrentCell cc = item.CurrentCell;
GridStyleInfo style = new GridStyleInfo();
GridStyleInfo style1 = new GridStyleInfo();
style.BackColor = VoucherBackGroundColor;
style1.BackColor = Color.LightGray;
if (cc.MoveToRowIndex != cc.MoveFromRowIndex)
{
item.ChangeCells(GridRangeInfo.Cells(cc.MoveFromRowIndex, 1, cc.MoveFromRowIndex, 6), style);
item.ChangeCells(GridRangeInfo.Cells(cc.MoveToRowIndex, 1, cc.MoveToRowIndex, 6), style1);
}

I have tried simply to change the background color of the curent row of the GridControl by using
item.RowStyles[cc.MoveFromRowIndex].BackColor = VoucherBackGroundColor;
item.RowStyles[cc.MoveToRowIndex].BackColor = Color.LightGray;

but this has not worked also

I would like the background color of the current row in this grid to change on the user changing the row thru keyboard / mouse

Kindly Help

Thanks & Regards
Rahul

Rahul Hans
Replied On April 16, 2007 12:37 PM UTC

Hi

I forgot to add that the GridControl is populated by populatevalues method and the source is a generic list.

Thanks Again
Rahul

>Hi

This problem relates to

Syncfusion.Windows.Forms.Grid.GridControl

I am using a tabBarSplitterControl and am dynamically adding a GridControl to a TabBarPage and the TabBarPage to the tabBarSplitterControl.

I am also subscribing to the CurrentCellActivated
event of the new GridControl

In this event I am using the following code

GridControl item = (GridControl)sender;
GridCurrentCell cc = item.CurrentCell;
GridStyleInfo style = new GridStyleInfo();
GridStyleInfo style1 = new GridStyleInfo();
style.BackColor = VoucherBackGroundColor;
style1.BackColor = Color.LightGray;
if (cc.MoveToRowIndex != cc.MoveFromRowIndex)
{
item.ChangeCells(GridRangeInfo.Cells(cc.MoveFromRowIndex, 1, cc.MoveFromRowIndex, 6), style);
item.ChangeCells(GridRangeInfo.Cells(cc.MoveToRowIndex, 1, cc.MoveToRowIndex, 6), style1);
}

I have tried simply to change the background color of the curent row of the GridControl by using
item.RowStyles[cc.MoveFromRowIndex].BackColor = VoucherBackGroundColor;
item.RowStyles[cc.MoveToRowIndex].BackColor = Color.LightGray;

but this has not worked also

I would like the background color of the current row in this grid to change on the user changing the row thru keyboard / mouse

Kindly Help

Thanks & Regards
Rahul

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

;