Following code is okey in the WinForm Application.
http://vb.net-informations.com/datag...iew_import.htm
I need WPF version of that WinForm code.
Note: DataGridView is named DataGrid in the WPF.
Printable View
Following code is okey in the WinForm Application.
http://vb.net-informations.com/datag...iew_import.htm
I need WPF version of that WinForm code.
Note: DataGridView is named DataGrid in the WPF.
private void button1_Click_1(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Select file";
fdlg.InitialDirectory = @"c:";
fdlg.FileName = txtFileName.Text;
fdlg.Filter = "Excel Sheet(*.xls)|*.xls|All Files(*.*)|*.*";
fdlg.FilterIndex = 1;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
txtFileName.Text = fdlg.FileName;
Import();
Application.DoEvents();
}
}
private void button1_Click_1(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Select file";
fdlg.InitialDirectory = @"c:";
fdlg.FileName = txtFileName.Text;
fdlg.Filter = "Excel Sheet(*.xls)|*.xls|All Files(*.*)|*.*";
fdlg.FilterIndex = 1;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
txtFileName.Text = fdlg.FileName;
Import();
Application.DoEvents();
}
}