Data Grid and DateTimePicker

Status
Not open for further replies.

JAM

Member
Joined
Mar 9, 2003
Messages
24
Hi Every one
Im trying to pick a date from date and time picker, as a result the date will be inserted into a datagrid cell or column. I was able to do it with a textbox but I have no idea how to do it with a datagrid.
Please help.
 
you can do something like this...
Code:
Datagrid1.Item(Datagrid1.CurrentCell.RowNumber, _
        Datagrid1.CurrentCell.ColumnNumber) = _
        calendar1.SelectionStart.ToLongDateString
Or set a couple of member variables to make sure that the user
actually selected a cell. You can do this in the DataGrid1_CurrentCellChanged event.
Code:
m_nSelectedCell = Datagrid1.CurrentCell.ColumnNumber
m_nRowNumber = Datagrid1.CurrentCell.RowNumber
so you would check the value of these variables prior to 
assigning any values to them (so they dont crap-out)
 
Eric, did you even try? Please open a new thread if you have a specific question as this one is a few months old and JAM has not been on for over a month.
 
Status
Not open for further replies.
Back
Top