I've tried to follow the example code, but my current result is that the sort field does get added to the GroupSettings area above the grid, but the grid is not grouped. I can then drag the same column name up to the grouping area... the grid becomes grouped, but the grouping area shows the column header twice.
Any ideas or suggestions would certainly be appreciated.
-Gary
p.s. here is my code:
<
="700px"
="True">
>
="BoundColumn_0">
/>
="BoundColumn_1">
="BoundColumn_2">
="BoundColumn_3">
="BoundColumn_4">
="Single">
="{0}: {1}">
using
System;
System.Collections.Generic;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Infragistics.Web.UI.GridControls;
public
partial class Default3 : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
}
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
ColumnGroupingSetting setting = new ColumnGroupingSetting();
setting.ColumnKey =
"TaskStatus";
setting.GroupComparer =
new AlphabetGroupComparer();
this.WebHierarchicalDataGrid1.GroupingSettings.ColumnSettings.Add(setting);
this.WebHierarchicalDataGrid1.GroupingSettings.GroupedColumns.Add("TaskStatus");
else
this.WebHierarchicalDataGrid1.GroupingSettings.ColumnSettings["TaskStatus"].GroupComparer = new AlphabetGroupComparer();
public class AlphabetGroupComparer : GroupEqualityComparer<string>
public override bool Equals(string x, string y)
if (x.Substring(0, 1).ToLower() == y.Substring(0, 1).ToLower())
return true;
return false;
public override string GroupName(string value)
if (value.Length == 0)
return string.Empty;
return value.Substring(0, 1).ToUpper();
Hi Gary,
I have checked the sample that you mentioned. In that sample the LastName column is disabled for dragging if it is already grouped by using the custom code. Is the "TaskStatus" column not disabled for you after the custom groupby ? This is to avoid the column being grouped by twice. I made up an example just like this one and it seems to work like the example on the samples browser. Can you please try again with a new example.