TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
479
2.9k
197.9k
Selection CHANGED NOT WORK
Mar 24 2018 4:09 AM
SELECTION CHANGED IF COLUMN VALUE NULL TO DATETIMEPICKER?
Here is problem...what to do if is column with datetime in datagrid empty...
Wheh is column populated everything working fine...
if
(prijava_radnikaDataGridView.SelectedRows.Count > 0 && vrijemeprijaveDateTimePicker == null && vrijemeodjaveDateTimePicker == null)
I am create on top solution if can help
private
DateTime emptydate = DateTime.Parse(
"2018-01-01 00:00:00"
);
public
static
string datumprijaveprijavnice =
""
;
public
static
string datumpodjaveprijavnice =
""
;
This is my code
private
void
prijava_radnikaDataGridView_SelectionChanged(object sender, EventArgs e)
{
// if (prijava_radnikaDataGridView.SelectedRows.Count > 0 )
// if (prijava_radnikaDataGridView.SelectedRows.Count > 0 && vrijemeprijaveDateTimePicker == null && vrijemeodjaveDateTimePicker == null)
if
(prijava_radnikaDataGridView.SelectedRows.Count > 0 && vrijemeodjaveDateTimePicker == null)
{
string id = prijava_radnikaDataGridView.CurrentRow.Cells[
"dataGridViewTextBoxColumn1"
].FormattedValue.ToString();
string radnik = prijava_radnikaDataGridView.CurrentRow.Cells[
"dataGridViewTextBoxColumn9"
].FormattedValue.ToString();
string redni_broj = prijava_radnikaDataGridView.CurrentRow.Cells[
"redni_broj"
].FormattedValue.ToString();
radnikComboBox.Text = radnik;
vrijemeprijaveDateTimePicker.Value = Convert.ToDateTime(prijava_radnikaDataGridView.SelectedRows[0].Cells[
"dataGridViewTextBoxColumn2"
].Value);
vrijemeodjaveDateTimePicker.Value = Convert.ToDateTime(prijava_radnikaDataGridView.SelectedRows[0].Cells[
"dataGridViewTextBoxColumn3"
].Value);
redni_brojTextBox.Text = redni_broj;
idPrijavaTextBox.Text = id;
}
}
Reply
Answers (
1
)
what is trace.axd in mvc
How to convert Entire Excel Workbook into PDf in C#