Hi, I am using the following line of code to set FilterDescriptors.Expression programatically from a string in SQL-like format:
this.portfolioGrid.FilterDescriptors.Expression = newFiltersExpr;
I discovered the following issue when using a string like
src_sec_prim_id in ('4008030','4008032','4010014','4025022','4029402','4032004','4150008','4150009','4150010','4150011','4150012')
Note that all the items in the above list have single quotes around them. But the resulting FilterDescriptors.Expression looks like this:
[src_sec_prim_id] IN (4008030,4008032,4010014,4025022,4029402,4032004,4150008,4150009,4150010,4150011,4150012)
That is, all the single quotes got eliminated! I imagine the issue is the setter of FilterDescriptors.Expression recognizes all the items as numbers and decides to remove the single quotes.
To test this, I used a list that has some items that could not be mistaken for numerical, and indeed this did not happen!
This is an undesirable behavior for me, since I later need to use the FilterDescriptors.Expression to construct an actual SQL query, that breaks if the single quotes are absent.
Would you advise anything that could help me override this behavior?
Thank you!
this.portfolioGrid.FilterDescriptors.Expression = newFiltersExpr;
I discovered the following issue when using a string like
src_sec_prim_id in ('4008030','4008032','4010014','4025022','4029402','4032004','4150008','4150009','4150010','4150011','4150012')
Note that all the items in the above list have single quotes around them. But the resulting FilterDescriptors.Expression looks like this:
[src_sec_prim_id] IN (4008030,4008032,4010014,4025022,4029402,4032004,4150008,4150009,4150010,4150011,4150012)
That is, all the single quotes got eliminated! I imagine the issue is the setter of FilterDescriptors.Expression recognizes all the items as numbers and decides to remove the single quotes.
To test this, I used a list that has some items that could not be mistaken for numerical, and indeed this did not happen!
This is an undesirable behavior for me, since I later need to use the FilterDescriptors.Expression to construct an actual SQL query, that breaks if the single quotes are absent.
Would you advise anything that could help me override this behavior?
Thank you!