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


i have a grid view with columns like from(defines the project asigned day)and to(defines project completion date)...From and To are Numerics....

My requirement is from should be less than to i.e.,if from is 1 to should be >1..

and when i enter to next row from value should be greater than to in previous row

from to
---- ----
1 2
3 4
like this...
as i am developing window app i want this code in c#
Posted
Comments
Member 9068558 11-Jul-12 3:35am    
i want to enter the data manually in gridcell...i dnt want to get it from backend
pradiprenushe 11-Jul-12 3:47am    
where you are having data in array?
Member 9068558 11-Jul-12 3:51am    
no iwant to enter data in grid view manually
pradiprenushe 11-Jul-12 3:56am    
manually means what you are taking it from textbox or array, datatable. Can you past your code? It will be easy to understand your requirement.

1 solution

Go through this logic. If you are adding data then this will help.
DataTable table = new DataTable();
     table.Columns.Add("From", typeof(int));
     table.Columns.Add("To", typeof(int));
     for (int i = 1; i < 10; i++)
     {
         table.Rows.Add(i, i + 1);
         i++;
     }

     GridView1.DataSource = table;


If you are getting data from database then please elaborate some more.
 
Share this answer
 
v4

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