Hi, I want to change the GroupAreaText in the code behind similar like grid.GroupingSettings.EmptyGroupAreaText = "123".
How can I do this? I use the "BoundDataField" object and when I group a column I want to display the "Header.Text" value inside the "GroupAreaText"!
BR
Hi, this is my result:
Hello,
Using this code I get the header text set for each column written in the buttons. For example you have set
col5.Header.Text = "InjuryDate";
and if I group by this column then the text I receive in the marked place on your screenshot is "InjuryDate". As mentioned this value is taken from the Header.Text property of the given column.
Please let me know if you have further questions on the issue.
If you change your code behind this way, you will get this behaviour:
if (!IsPostBack)
{
this.WebHierarchicalDataGrid1.GridView.Columns.Clear();
this.WebHierarchicalDataGrid1.GridView.ClearDataSource();
this.WebHierarchicalDataGrid1.GroupingSettings.GroupedColumns.Clear();
BoundDataField col1 = new BoundDataField();
col1.DataFieldName = "ClaimNumber";
col1.Key = "ClaimNumber";
col1.Header.Text = "Claim Number";
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col1);
BoundDataField col2 = new BoundDataField();
col2.DataFieldName = "PatientLastName";
col2.Key = "PatientLastName";
col2.Header.Text = "Patient Last Name";
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col2);
BoundDataField col3 = new BoundDataField();
col3.DataFieldName = "PatientFirstName";
col3.Key = "PatientFirstName";
col3.Header.Text = "Patient First Name";
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col3);
BoundDataField col4 = new BoundDataField();
col4.DataFieldName = "SSN";
col4.Key = "SSN";
col4.Header.Text = "SSN";
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col4);
BoundDataField col5 = new BoundDataField();
col5.DataFieldName = "InjuryDate";
col5.Key = "InjuryDate";
col5.DataFormatString = "{0:dd/MM/yyyy}";
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col5);
BoundDataField col6 = new BoundDataField();
col6.DataFieldName = "Value";
col6.Key = "Value";
col6.Header.Text = "Value";
this.WebHierarchicalDataGrid1.GridView.Columns.Add(col6);
}
this.WebHierarchicalDataGrid1.DataKeyFields = this.WebHierarchicalDataGrid1.GridView.Columns[0].Key;
this.WebHierarchicalDataGrid1.GridView.DataKeyFields = this.WebHierarchicalDataGrid1.GridView.Columns[0].Key;
this.WebHierarchicalDataGrid1.DataSource = GetData();
this.WebHierarchicalDataGrid1.DataBind();
this.WebHierarchicalDataGrid1.RefreshBehaviors();
//this.WebHierarchicalDataGrid1.DataSource = GetData();
//this.WebHierarchicalDataGrid1.DataBind();
HTML:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" AutoGenerateColumns="false" StyleSetName="Ferrero"
runat="server" Height="100%" Width="100%"
OnGroupedRowInitialized="WebHierarchicalDataGrid1_GroupedRowInitialized">
<GroupingSettings EnableColumnGrouping="true"></GroupingSettings></ig:WebHierarchicalDataGrid>
I believe the text in the button should correspond to the header text set for the given column and this is how the grid behaves on my side. I was not able to reproduce this so it would be highly appreciated if you could send me an isolated sample that demonstrates this and I will investigate it for you.
Looking forward to hearing from you.
Hi, on my site it is not working as expacted. Please see screenshot in the attachemnt. Do you have an idea what is wrong on my site?