@maroua301
may we ask to give us some more details to the requirement as a look on XAML and the LINQ still let open some questions. Maybe you also can share some sample data with us.
Thank you for your reply, in fact i can’t share the link where the data is scraped from, what i’m trying to do is similar to what i did on the xaml file, just trying to do it with the linq query.
Normaly, there’s 3 values i have to look for, but each one come first than the others, like if there’s “Corporate”, we take, only if there’s no corporate, we take the second one which is “Small”, or if none of them found, than only than we take “Mobile”.
The query i did, before, works only if there’s a value “Corporate”, i have to keep the same query, but add the conditions of the two other values.
And once done, i copy that value to a datatable, as shown on the query, but since it works only if “Corporate” exists, well if it’s not it will not work.
Sure we respect every confidental needs. But sample data can be created even without breaking confidental needs:
Type_SERVICE | Col2 | Col1
###Corporate | 12|A3
###OtherText …
…
Have a look here:
it is a very good example on how visually and with abstract sample data the case was explained
Some sample data would really help. The mentioned above description / XAML is not razor sharp defining all requirements. (Does First mean first row, first occurence … all important requirements)
So please help us with some more details that we can work out a better fitting solution approach.
What i’m trying to do, is the value correspondent to one of the previous list, on a priority level.
For example :
Here we have “Corporate” and “Mobile”, since “Corporate” is priority, we take it, if “Corporate” wasn’t available we would take the second on list of priority, which is “Small”, since “Small” ain’t available too, we take “Mobile”, that’s what i did with the sample xaml example, but trying to simplify it with a linq query, only if possible…
i got your scenario and go thought your workflow, just you have to change for each row if condition nested put first if condition which will change corporate then put other if condition in else section of “corporate” if to check “Mobile” then in mobile else condition check “small”…