Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Geeks,

string[] items={'56','68'};
My Gridview:
C#
Style  56    62    68   74   80
  1    260   520   520  260  130
  2    -     130   260  520  260 


So How to add from 56 to 68 of row 1 with passing string[] items.

My code which is logically wrong..
C#
foreach (string li in listitems)
        {
            items = li.Split('-');
                while(dtfinals.Columns[items[k]].ColumnName.ToString()!=items[items.Length-1])
                {
                    itemlists.Add(dtfinals.Columns[items[k]].ColumnName.ToString());
                    k++;
                }


I mean, I just pass the range like 56-68 but it should 56+62+68 values of row 1 and when I pass the string[] items = 74-80, it should add values from 74-80(not 56-68) of row 1 and vice versa for other rows.
Posted
Updated 5-Aug-14 0:27am
v2
Comments
Manoj B. Kalla 14-Aug-14 5:27am    
You want to 6 nos. of gap while stepping ahead.

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