mtxtBdate.Value = dataGridView1.SelectedRows[0].Cells["Birthdate"].Value.ToString();
i want this on data Grid view.. this type of syntax use in all other textboxs.. but now how to use this datepicker control syntax.. this sytax is wrong plzz tell me write
meas any date that user select on the datetimepicker is show on the datagrid..
mtxtfname.text = datagridView1.SelectRows[0].Cells["fIrstname"].value.ToString();
this sytanx will for text box but for data picker ???
DataTimepicker Dates On Data Grid control
Page 1 of 12 Replies - 231 Views - Last Post: 16 July 2012 - 08:30 AM
Replies To: DataTimepicker Dates On Data Grid control
#2
Re: DataTimepicker Dates On Data Grid control
Posted 16 July 2012 - 08:23 AM
type of mtxtBdate.Value is a DateTime.
Before you assign value to mtxtBdate you will need convert dataGridView1.SelectedRows[0].Cells["Birthdate"].Value to DateTime
Before you assign value to mtxtBdate you will need convert dataGridView1.SelectedRows[0].Cells["Birthdate"].Value to DateTime
#3
Re: DataTimepicker Dates On Data Grid control
Posted 16 July 2012 - 08:30 AM
You obviously are just using Intellisense to write your code and not bothering to read the documentation.
Assuming that mtxtBdate is a DateTimePicker, then the Value property takes a DateTime, not a string. Read here: http://msdn.microsof...cker.value.aspx
So if dataGridView1.SelectedRows[0].Cells["Birthdate"].Value, is already a DateTime, just assign it. No need to convert to a string. If not, then you'll have to do some magic to convert it to a DateTime.
Assuming that mtxtBdate is a DateTimePicker, then the Value property takes a DateTime, not a string. Read here: http://msdn.microsof...cker.value.aspx
So if dataGridView1.SelectedRows[0].Cells["Birthdate"].Value, is already a DateTime, just assign it. No need to convert to a string. If not, then you'll have to do some magic to convert it to a DateTime.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|