Click here to Skip to main content
15,914,384 members

Comments by Member 13706784 (Top 2 by date)

Member 13706784 23-Nov-23 1:32am View    
Thank you so much Maciej Los and Richard Deeming.
I have tried this
Dim dd As DateTime
If DateTime.TryParse(dtgrdBranch.CurrentRow.Cells(4).Value.ToString(), dd) Then
txtDate.Text = dd.ToString("dd/MM/yyyy")
txtColorInDate.Text = dd.ToString("dd/MM/yyyy")
End If

But again the same issue I am encountering. txtDate.text shows the value stored in dd whereas txtColorInDate.text throws the same error NullReferenceException was unhandled.

I really can't understand that why the same value is not getting passed in two same kind of masked text box objects.
Please help
Member 13706784 23-Nov-23 1:32am View    
Thank you so much Maciej Los and Richard Deeming.
I have tried this
Dim dd As DateTime
If DateTime.TryParse(dtgrdBranch.CurrentRow.Cells(4).Value.ToString(), dd) Then
txtDate.Text = dd.ToString("dd/MM/yyyy")
txtColorInDate.Text = dd.ToString("dd/MM/yyyy")
End If

But again the same issue I am encountering. txtDate.text shows the value stored in dd whereas txtColorInDate.text throws the same error NullReferenceException was unhandled.

I really can't understand that why the same value is not getting passed in two same kind of masked text box objects.
Please help