Click here to Skip to main content
15,923,087 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, My requirement is like I have 9 columns in a GridView.Duplicate values will exist in Each row at that time i have to display first value and other row values i need to disable. If data is not duplicate i have to show dat row as it is. This applies to all the 9 colums. I mean if any of the row data is getting repeated then i have to show only one and others should be disabled. Can anyone come across this type of requirement ?? If Yes please sugest the solution.
I tried in Rowdatabound with some logicam able to do for 1 or 2 colums but same is not happening for all the colums. Can anyone help on this. Thanks
Posted

1 solution

Remove them before they are bound by using SELECT DISTINCT in linq

such as

C#
public void Linq46()
{
    int[] factorsOf300 = { 2, 2, 3, 5, 5 };

    var uniqueFactors = factorsOf300.Distinct();

    Console.WriteLine("Prime factors of 300:");
    foreach (var f in uniqueFactors)
    {
        Console.WriteLine(f);
    }
}



http://msdn.microsoft.com/en-us/vcsharp/aa336761.aspx#distinct1[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900