Hello,
Your code works fine for "int" type column "col2".
How can I make it also work for "datatime" type and "double" type columns?
Thanks,
>You would change two methods.
>
>
>private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
>{
> if (e.TableCellIdentity.GroupedColumn != null && e.TableCellIdentity.DisplayElement.ParentGroup != null
> && e.TableCellIdentity.DisplayElement.ParentGroup.Category is int
> )
> {
> if (e.TableCellIdentity.DisplayElement is CaptionRow
> && e.TableCellIdentity.GroupedColumn.Name == "Col2")
> {
> int cat = (int) e.TableCellIdentity.DisplayElement.ParentGroup.Category;
> string ret = "";
> switch (cat)
> {
> case 1:
> ret = " < 20";
> break;
> case 2:
> ret = "20 - 35";
> break;
> case 3:
> ret = "> 35";
> break;
> }
> e.Style.CellValue = String.Format("{0}: {1} Items.", ret, e.TableCellIdentity.DisplayElement.ParentGroup.GetChildCount());
> }
> }
>}
>
>
>public static int GetCategory(int i)
>{
> int ret = 0;
> if(i < 20)
> ret = 1;
> else if(i >= 20 && i < 35)
> ret = 2;
> else
> ret = 3;
> return ret;
>}
>