In some cases i need to set the font of the row to italic and in some other cases i need to hide it from the user.
here is my code
void radGridViewSearchResults_RowFormatting(object sender, RowFormattingEventArgs e)
{
GridViewRowInfo gvri = e.RowElement.RowInfo;
myobject obj = gvri.DataBoundItem as myobject;
if (obj.IsDeleted)
{
gvri.IsVisible = false;
return;
}
if (obj.IsModified || obj.IsNew)
gvri.VisualElement.Font = new Font(gvri.VisualElement.Font.FontFamily, gvri.VisualElement.Font.SizeInPoints, FontStyle.Italic);
if (obj.IsOnError)
gvri.VisualElement.BackColor = Color.Red;
}
The problem is that the rows that should be hidden are still showing up and the ones that should be in red are not?
I've check the state of my objects and they are correct.
I've also remarked that the RowFormatting event is called tice for each item?
What is the correct way of hidding a row from the grid and customize its style?
thanks