5 Answers, 1 is accepted
0
Mark
Top achievements
Rank 1
answered on 25 Sep 2013, 02:07 PM
Is the reason there is no response because you can't filter on one-to-many fields from a db? All your example demos use one-to-one fields.
0
Hello Mark,
I am not quite sure that I fully understand the scenario. Could you please provide a more detail explanation of the exact requirement? Additionally if you could show us the table definitions and relations that would be great. Once we have a better understanding of the issue we should be able to provide a precise answer.
Regards,
Angel Petrov
Telerik
I am not quite sure that I fully understand the scenario. Could you please provide a more detail explanation of the exact requirement? Additionally if you could show us the table definitions and relations that would be great. Once we have a better understanding of the issue we should be able to provide a precise answer.
Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Mark
Top achievements
Rank 1
answered on 26 Sep 2013, 02:42 PM
Using RadGrid / RadFilter or any other control....
Id Name State
1 John CO
1 John AZ
1 John NY
3 Sally SD
3 Sally CO
I need to find someone who is in both states CO and NY. That should return just "John".
SQL would look like the below
select Distinct
Name
from License
where exists( select * from License as lic2 where lic2.State = 'CO' and lic2.Name = License.Name)
and exists( select * from License as lic2 where lic2.State = 'NY' and lic2.Name = License.Name)
Id Name State
1 John CO
1 John AZ
1 John NY
3 Sally SD
3 Sally CO
I need to find someone who is in both states CO and NY. That should return just "John".
SQL would look like the below
select Distinct
Name
from License
where exists( select * from License as lic2 where lic2.State = 'CO' and lic2.Name = License.Name)
and exists( select * from License as lic2 where lic2.State = 'NY' and lic2.Name = License.Name)
0
Mark
Top achievements
Rank 1
answered on 30 Sep 2013, 02:02 PM
@Angel Petrov - Well?
I'm guessing Telerik does not handle any one-to-many situations? Fine, just say so.
I'm guessing Telerik does not handle any one-to-many situations? Fine, just say so.
0
Hello Mark,
Indeed such a functionality is not available out of the box. However such behavior can be implemented with the help of a RadFilter and RadGrid. The idea here is to group the items by Name and use a RadFilter with an OR RadFilterGroupOperation to filter the grid. Once the data is filtered we can check whether the number of items in the group is equal to the filter expressions count if that is the case this means that the name is the one we are looking for. Following this approach I have assembled a sample website which can be found in attachments.
Regards,
Angel Petrov
Telerik
Indeed such a functionality is not available out of the box. However such behavior can be implemented with the help of a RadFilter and RadGrid. The idea here is to group the items by Name and use a RadFilter with an OR RadFilterGroupOperation to filter the grid. Once the data is filtered we can check whether the number of items in the group is equal to the filter expressions count if that is the case this means that the name is the one we are looking for. Following this approach I have assembled a sample website which can be found in attachments.
Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.