Hi,
I am afraid but the solution hasn't worked as expected.
1. I do not want to assign individual style properties using style.backcolor = value. I want the whole of the style object to be implemented as the user is going to format the cells and can change n no. of properties.
2. Even individual style properties get implemented but only till the time the focus remains on the cell. the moment I select another cell, the style is lost.
3. How can I make the style persist? for e.g. i select two cells, make their font size = 10 through the formatting window. then i select another two cells and make their font color = red. the changes made to the previous two cells should persist.
4. i am attaching a sample which i tried on grid control earlier on. Can you please send a small sample application depicting the same functionality in grid grouping control...
just right click onto the grid and try formatting..
That would be of great help...
thanks
vivek
>Hi Vivek,
You can not set any cell specific properties for the GroupingGrid other than the CellValue using ChangeCells method. You need to handle the TableControlPrepareViewStyleInfo (or QueryCellStyleInfo) event to do this. Through this event you can set the style properties for the grid. Here is a code snippet that set the IsChangeCells flag in Format's menu click event and check that flag in QueryCellStyleInfo event for setting the selected cell style ina grid. Please try the suggestion and let me know if this helps.
//global variable..
bool IsChangeCalls = false;
GridStyleInfo style;
//format menu click event.
style = ggc.TableControl.Model.GetCombinedStyle(rangeList);
foreach (GridRangeInfo range in rangeList)
{
IsChangeCalls = true;
ggc.TableControl.RefreshRange(range); //Refresh method does call the QueryCellStyleInfo event.
IsChangeCalls = false;
}
//QueryCellStyleInfo event.
e.Style.CellType = style.CellType;
e.Style.BackColor = style.BackColor;
Best regards,
Haneef
GridControl_FormattingCells.zip