Click here to Skip to main content
15,920,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friend i want to show my data grid view like this

e.g.
 Collapse | Copy Code
set NO        date                day
 
1        1/1/2005             Monday
2        7/1/2005             Monday
3        14/1/2005            Monday
4        21/1/2005            Monday
5        28/1/2005            Monday
6        5/2/2005             Monday
7        12/2/2005            Monday
8        19/2/2005            Monday
9        26/2/2005            Monday  

as user enter the fist date in date cell , the day column should fill with day name and setNO fill with 1 now as he press enter key the cursor move to the next cell of date column increase date with 7 day set dayName to assosiate day cell and 2 for setNO...an so on...

please friend help me ..what i have to do...please please please.......

thanks in advanced
Posted
Updated 28-Dec-11 20:06pm
v2
Comments
[no name] 29-Dec-11 1:59am    
can any buddy solve my problem?????????? :( :( :(
Supriya Srivastav 29-Dec-11 2:01am    
How many rows you want in gridview.
[no name] 29-Dec-11 2:04am    
supriya please help me if u can?????
[no name] 29-Dec-11 2:06am    
my table...

setno int 4 1
setdate smalldatetime 4 1
[no name] 29-Dec-11 2:03am    
less than date 31/4/2011 this is date of lats financial year which already save in table

Dear LakhanP

From your question I understood that when you press enter key the focus should pass from cell to cell in a row.
Here you have to use
_KeyPress
event.

This link useful to you


http://stackoverflow.com/questions/325677/how-to-get-keypressed-keydown-events-from-datagridview-data-cells[^]

and follow cell_update and dt.DateAdd function as amith said in the above comment

Thanks
 
Share this answer
 
v6
k,you can generate desired rows in backend in a datatable then give it as a datasource to gridview.You can also edit them later as bind in itemtemplate with the columns name of datatable.
 
Share this answer
 
Comments
[no name] 29-Dec-11 2:10am    
i have try many thing .....but :( :( :(
[no name] 29-Dec-11 2:11am    
if u understand my problem please help me...
Supriya Srivastav 29-Dec-11 2:14am    
if it's mandatory to do so on enter key press event,then you just add a single row in gridview and the textbox in which date is entered,just add another row on textchanged event of that textbox.
amit28august 29-Dec-11 2:21am    
you can also have cell_update event and have some datatable then take the current value of the date and find the day and update the current row and create another new row to the DT with DateAdd(7) to that cell and then rebind the grid again.

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