|
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
dataGrid.CellRenderers.Remove("CaptionSummary");
dataGrid.CellRenderers.Add("CaptionSummary", new GridCaptionSummaryCellRendererExt());
dataGrid.GroupCaptionTextFormat = "{ColumnName} is Grouped by {Key} with Count- {ItemsCount} Items in the view";
}
}
public class GridCaptionSummaryCellRendererExt : GridCaptionSummaryCellRenderer
{
public GridCaptionSummaryCellRendererExt()
{
}
public override void OnInitializeDisplayView(DataColumnBase dataColumn, SfLabel view)
{
base.OnInitializeDisplayView(dataColumn, view);
view.HorizontalTextAlignment = TextAlignment.Center;
view.BackgroundColor = Color.DarkCyan;
view.FontAttributes = FontAttributes.Bold;
view.FontSize = 18;
view.LineBreakMode = LineBreakMode.WordWrap;
view.TextColor = Color.White;
}
} |
Hi Charles,Sorry for the inconvenienced caused.We have checked your query for the “Unable to view complete sentence when Grouping with GroupCaptionTextFormat”. The provided solution is not suited for your case because you have not set LoadUIView as true while creating column in the grid in the given .CS file. We suspect that’s why this case is not worked in your project. Please set the LoadUIView as true in the GridColumn of DataGrid to get resolve this issue.Regards,Jayaraman.