I have an array of objects “AllClaimants” that has 2 properties (UserInfo & UserID);
Example:
AllClaimants[AllClaimantsCounter].UserInfo = "Santhalingam Sugirtha, 1980-06-05";
AllClaimants[AllClaimantsCounter].UserID = "1076073";
My AllClaimants[AllClaimantsCounter].UserInfo
information contains 2 things “Name + Date of Birth”.
How can I sort (by UserInfo - in Userinfo I want to sort it by Name part only not by Date of Birth) and add unique values to select dropdown (ClaimantsDropDown) with text as开发者_如何转开发 AllClaimants[AllClaimantsCounter].UserInfo
and value as AllClaimants[AllClaimantsCounter].UserID
?
Thanks
You could convert the array to List with
Array.AsList(array)
and the use linq with something like
list.OrderBy(x=> x.Key)
And depend on the type of the dropdrown you have to fill it, if it is a dropdown from aspnet server control you could use the list as datasource.
精彩评论