Click here to Skip to main content
14,268,797 members
Rate this:
Please Sign up or sign in to vote.
See more:
I need to bind Gridview from First grid based on check box checked on below condition

1) 2 Adult Male Not Allowed
2) More than 2 female is allowed
3) Children below 18 Year (Non Adult) Allowed

What I have tried:

If tried to bind dataset from checked member list, filter this with more than 18 years and Gender. if it return 2 then clear grid view, but it is not working....
--- HERE IS CODE----
DataTable dt_DistinctAadharLandOwners_Merge = new DataTable();

// Some code to bind the Datatable
// Check below if the condition satisfy

if (dt_DistinctAadharLandOwners_Merge.AsEnumerable().Where(c => c.Field("Age") >= 18 && c.Field("Gender") == "Male").Count() > 2)
Updated 13-Aug-19 0:08am
Maciej Los 13-Aug-19 6:11am
Sorry, but your question is not clear. Please, be more specific and provide more details.
Anuragintit 13-Aug-19 6:33am
solved this with adding >= 2 in condition.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100