Hello,
I use Radgrid for viewing my web application logs. These logs has 7 different types, so in order to filter the grid, I added before radgrid, a CheckBoxList that contains the ID of log types. So the code is something like this:
The code is more than this one, it consider also the filter operations made by radgrid filter columns, so, in checbox select index changed, the rdgrid.Mastertableview.FilterExpression could be like this:
"(iif(Azienda == null, "", Azienda).ToString().ToUpper() = "Azienda 1".ToUpper()) AND ((CodTipologiaLog = 2) OR(CodTipologiaLog = 3))"
It perfectly works if you choose a filter in the filterrow (in this case Azienda = Azienda 1) and THEN you select one or more items in checlistbox.
BUT... if you select one checkbox and then you choose a filter in the filter-row, the filters programmatically created is not taken in consideration. I tried to catch ItemCommand event of radgrid and, when FilterCommandName is fired, recalculate the filters obtained by checboxes. In this case, even if filterexpression contains the correct query, rows are filtered only for Azienda = Azienda 1 query.
The same if I recaculate the filter on every postback.
Where am I wrong?
Thanks
Mario
I use Radgrid for viewing my web application logs. These logs has 7 different types, so in order to filter the grid, I added before radgrid, a CheckBoxList that contains the ID of log types. So the code is something like this:
For Each lItem As ListItem In chkTipologieLog.Items
If lItem.Selected Then
lstrFiltro += "(CodTipologiaLog = " + lItem.Value.ToString + ") OR"
End If
Next
rdgrid.Mastertableview.FilterExpression = "(" + lstrFiltro + ")"
rdgrid.Mastertableview
.rebind
The code is more than this one, it consider also the filter operations made by radgrid filter columns, so, in checbox select index changed, the rdgrid.Mastertableview.FilterExpression could be like this:
"(iif(Azienda == null, "", Azienda).ToString().ToUpper() = "Azienda 1".ToUpper()) AND ((CodTipologiaLog = 2) OR(CodTipologiaLog = 3))"
It perfectly works if you choose a filter in the filterrow (in this case Azienda = Azienda 1) and THEN you select one or more items in checlistbox.
BUT... if you select one checkbox and then you choose a filter in the filter-row, the filters programmatically created is not taken in consideration. I tried to catch ItemCommand event of radgrid and, when FilterCommandName is fired, recalculate the filters obtained by checboxes. In this case, even if filterexpression contains the correct query, rows are filtered only for Azienda = Azienda 1 query.
The same if I recaculate the filter on every postback.
Where am I wrong?
Thanks
Mario