Good afternoon.
I want to change the color according to the Data value of a certain column in Cardview.
Cardview does not have a CellFormatting in the Gridview or Listview.
I change the color of the entire item using Cardview's VisualItemFormatting.
private void RadCardView1_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
{
if (e.VisualItem.Data["EIFSTATUS"].Equals("OFF"))
{
e.VisualItem.BackColor = Color.Red;
e.VisualItem.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}
}
But I do not want it.
I would like to change Backcolor only for "OFF" value only when the column value of "EIFSTATUS" is "OFF" instead of whole.
I want to change it like the Grid screen below.
private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.HeaderText == "EIFSTATUS")
{
if (e.CellElement.RowInfo.Cells["EIFSTATUS"].Value.Equals("OFF"))
{
e.CellElement.DrawFill = true;
e.CellElement.GradientStyle = GradientStyles.Solid;
e.CellElement.BackColor = Color.Red;
}
}
}
I would appreciate your help.