Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Everyone,

i have gridpanel containing n no. rows. the problem is, in this gridpanel i have n no. of rows with same userid. i want send a document to user based on user id. Suppose if i select 10 userids in which 5 userid are same then it consider that userid only once not 5 times. how can i achieve it?

i am using 1st json then stringbuilder to get selected row values.
any help is deeply appreciated.
Posted
Comments
Jameel VM 15-Jan-14 13:25pm    
Can you post the code what you had done so far?
sunitha korakandla 17-Jan-14 5:05am    
Hai i have used the below code:
string json = e.ExtraParams["Values"];

Dictionary<string,>[] companies = JSON.Deserialize<dictionary><string,>[]>(json);

StringBuilder sb = new StringBuilder();
sb.Append("<table cellspacing='15'>");
bool addHeader = true;
foreach (Dictionary<string,> row in companies)
{


foreach (KeyValuePair<string,> keyValuePair in row)
{
if (keyValuePair.Key.ToString().Equals("USER_ID"))
{
User_Id = keyValuePair.Value.ToString();
}
if (keyValuePair.Key.ToString().Equals("USER_ROLE"))
{
Session.Add("InvstTit", keyValuePair.Value.ToString());

InvstTit = keyValuePair.Value.ToString();


}
if (keyValuePair.Key.ToString().Equals("INVESTMENT_TITLE"))
{

Account_Name = keyValuePair.Value.ToString();


}
if (keyValuePair.Key.ToString().Equals("ACCOUNT_NAME"))
{

Date = keyValuePair.Value.ToString();


}
if (keyValuePair.Key.ToString().Equals("DOCUMENT_TYPE"))
{

Account = keyValuePair.Value.ToString();


}

//sb.Append("</td>");
}
user = User_Id + "@" + InvstTit + "@" + Account_Name + "@" + Account + "@" + Date;

if (!userslist.Contains(user))
{
userslist.Add(user);
}

}

now i here in userslist i am getting all the selected row values. now i need to get row values based on distinct user_id.how can i achieve this by using linq ?

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