Hello,
I'm trying to implement dynamic conditional formatting in the RadGrid. The conditional formatting settings are supplied dynamically as a collection of filters that I need to apply on the server and have the grid display the corresponding styling. I can't find any relevant documentation that could enable me to do so. There's this example:
But the problem is that I don't know if it will be one boolean clause or three. So the condition may be "Title == "Home"" or it could be "Title == Home AND Amount <= 10" So I need to be able to dynamically build out the filter conditions.
I tried using the OnRowDataBound client side event and construct the javascript dynamically in C#, but the event is not firing because I'm not binding on the client side, but in the OnNeedDataSource event.
Any ideas?
I'm trying to implement dynamic conditional formatting in the RadGrid. The conditional formatting settings are supplied dynamically as a collection of filters that I need to apply on the server and have the grid display the corresponding styling. I can't find any relevant documentation that could enable me to do so. There's this example:
protected void RadGrid1_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e)
{
//Is it a GridDataItem
if (e.Item is GridDataItem)
{
//Get the instance of the right type
GridDataItem dataBoundItem = e.Item as GridDataItem;
//Check the formatting condition
if (int.Parse(dataBoundItem["Size"].Text) > 100 )
{
dataBoundItem[ "Received"].ForeColor = Color.Red;
dataBoundItem[ "Received"].Font.Bold = true;
//Customize more...
}
}
}
But the problem is that I don't know if it will be one boolean clause or three. So the condition may be "Title == "Home"" or it could be "Title == Home AND Amount <= 10" So I need to be able to dynamically build out the filter conditions.
I tried using the OnRowDataBound client side event and construct the javascript dynamically in C#, but the event is not firing because I'm not binding on the client side, but in the OnNeedDataSource event.
Any ideas?