Hi, I need to show a boolean column in a RadGridView.
I would like to show the column as in the attached image, i.e. with a tick for the true value and nothing for the false value.
I would like to use GridViewCheckBoxColumn but, this column always shows values as checkboxes. In my case, the table is readonly, so the standard checkboxed makes the user to think that he can click to change the check value.
I tried using a GridViewTextBoxColumn and using CellFormatting event:
private void radGrid_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (this.DesignMode) return;
if (e.CellElement.ColumnInfo.FieldName == "ScambioPratiche") {
if ((bool)((System.Data.DataRowView)e.CellElement.RowInfo.DataBoundItem).Row["ScambioPratiche"] == true)
{
e.CellElement.Image = MyApp.Main.Properties.Resources.tick;
}
else
{
e.CellElement.Image = null;
}
e.CellElement.Text = string.Empty;
}
else
{
e.CellElement.ResetValue(LightVisualElement.ImageProperty, ValueResetFlags.Local);
}
}
In this way, however, the filter is a text filter and not a checkboxfilter...
Is there a better way to gain my goal, possibly by GridViewCheckBoxColumn ?