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.
I found out what is breaking it...If I leave AutoGenerateColumns="true", I can get your example working with my data 100% properly. The only thing is, this leaves me with column names taken straight from the DB (TaskStatus, TaskOwner, etc...).If I leave absolutely everything else the same, but change AutoGenerateColumns="false", and add the following column defenitions, the result is as I described in the opening post of this thread, regardless of whether "TaskStatus" or "Status" is used in the codebehind.
Columns
<ig:BoundDataField DataFieldName="TaskStatus" DataType="System.String"
Key
<Header Text="Status"
</ig:BoundDataField
<ig:BoundDataField DataFieldName="TaskTitle" DataType="System.String"
<Header Text="Title"
<ig:BoundDataField DataFieldName="TaskOwner" DataType="System.String"
<Header Text="Owner"
<ig:BoundDataField DataFieldName="TaskID" DataType="System.Int32" Hidden="True"
<Header Text="BoundColumn_3"
<ig:BoundDataField DataFieldName="TaskDueDate" DataType="System.DateTime"
<Header Text="Due Date"
<ig:BoundDataField DataFieldName="TaskStatusUpdate" DataType="System.String"
="BoundColumn_5">
<Header Text="Update Info"
<ig:BoundDataField DataFieldName="TaskStatusUpdateDate" DataType="System.DateTime"
="BoundColumn_6">
<Header Text="Last Updated"
</Columns
Yes, and to be more specific, I had inadvertantly been using the DataFieldName value in the code-behind instead of the BoundDataField's Key value.
I am just posting what you mentioned in support case CAS-46537-BVCYGC. This was a user error and not a bug or defect in the control so that others are aware of it. Thanks.
Though it is still in the "Awaiting Assignment" phase, I have submitted a request for support on this bug.
Support Request CAS-46537-BVCYGC