GridGroupingControl CustomCellType

hi!

i would like to apply a CustomCellType to a GridGroupingControl.
i do as the following:

private void BuildDatagrid()
{
LinkLabelCellModel dgSentCell = new LinkLabelCellModel(dgSent.TableModel);

dgSent.TableModel.CellModels["aa"] = dgSentCell;
}

void TableControl_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.ColIndex == 1 && e.RowIndex >2)
{
e.Style.CellType = "aa";
e.Style.TextColor = System.Drawing.Color.Blue;
}

}

It''s working well if there is no Group Column.
I have attached some image files to explain my problem..
The file "Right.jpg" is i expected. The "Wrong.jpg" is the problem.

Thanks!

CustomCellType.zip

4 Replies

AD Administrator Syncfusion Team September 4, 2006 08:39 AM UTC

Hi Lim,

Try the below code snippet to solve this.

GridTableCellStyleInfo info = e.Style as GridTableCellStyleInfo;

//To check for the record .
if( info.TableCellIdentity.DisplayElement != null && info.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record )
{
//to check for particular column name "Col1"
if( info.TableCellIdentity.Column != null && info.TableCellIdentity.Column.Name == "Col1" )
{
e.Style.CellType = "aa";
e.Style.TextColor = System.Drawing.Color.Blue;
}
}

Best Regards,
Haneef


AD Administrator Syncfusion Team September 4, 2006 09:20 AM UTC

hi! May i know the namespace of the GridTableCellStyleInfo

Thanks!


AD Administrator Syncfusion Team September 4, 2006 11:22 AM UTC

Hi Lim,

Yes. The namespace of the GridTableCellStyleInfo is "Syncfusion.Windows.Forms.Grid.Grouping"

Thanks,
Haneef


AD Administrator Syncfusion Team September 5, 2006 06:21 AM UTC

Hi! It''s Working!

Thanks a lot! :)

Loader.
Up arrow icon