Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Change DATE FORMAT for selected columns in datagridvew
Aditya B
Jan 25 2016 5:34 AM
313
Reply
Hi,
I have a data displaying in DataGridView. Among those few columns are having DATE columns where i need to change the format from MM/DD/YYYY to DD/MM/YYYY and DD/MM/YYYY to MM/DD/YYYY .
I have created a button in FORM1. After clicking FORM1 (button), Another form opens where i have to select the column from the dropdown and click on OK. Form2 should close and Date format for selected should change in FORM1.
Please help me on this. Below is the code:
private void button3_Click(object sender, EventArgs e)
{
Date_Format df = new Date_Format();
df.cmbColumns.DataSource = cmbList;
df.ShowDialog();
string iString = df.cmbColumns.SelectedValue.ToString();
System.Globalization.CultureInfo.GetCultureInfo("en-GB");
DateTime oDate = DateTime.ParseExact(iString, "dd/MM/yyyy hh:mm:ss", System.Globalization.CultureInfo.CurrentCulture);//
MessageBox.Show(oDate.ToString());
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to disable save as button in excel plugin?
Regarding Application Error Event