Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149074 | Nov 13,2019 03:33 PM UTC | Nov 14,2019 07:24 PM UTC | Xamarin.Android | 1 |
![]() |
Tags: SfDataGrid |
….
sfdataGrid.CellRenderers.Remove("TextView");
sfdataGrid.CellRenderers.Add("TextView", new CustomTextViewRenderer());
…
public class CustomTextViewRenderer : GridCellTextViewRenderer
{
public CustomTextViewRenderer()
{
}
protected override void OnRefreshDisplayValue(DataColumnBase dataColumn)
{
base.OnRefreshDisplayValue(dataColumn);
}
protected override void OnLayout(RowColumnIndex rowColumnIndex, View view, int left, int top, int right, int bottom)
{
var rowData = ((view as GridCell).DataColumn.RowData as DataRowView).Row.Table.Rows[rowColumnIndex.RowIndex - 1];
base.OnLayout(rowColumnIndex, view, left, top, right, bottom);
var count = rowData.Table.Columns.Count;
for (int i = 0; i <= count - 1; i++)
{
if (rowData.ItemArray[i].ToString().Contains("3") || rowData.ItemArray[i].ToString().Contains("8") )
{
(view.Parent as View).SetBackgroundColor(Color.Green);
}
}
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.