BKI_DichVuMatDat.f304_cac_khoan_khac.m_txt_chon_file_Click C# (CSharp) Method

m_txt_chon_file_Click() private method

private m_txt_chon_file_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void m_txt_chon_file_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            // Set filter options and filter index.
            openFileDialog1.Filter = "xls Files|*.xls|xlsx Files|*.xls|All Files (*.*)|*.*";
            openFileDialog1.Multiselect = false;
            var userClickedOK = openFileDialog1.ShowDialog();
            try
            {

                if(userClickedOK == System.Windows.Forms.DialogResult.OK)
                {
                    DataTable v_dt_source = new DataTable();
                    WinFormControls.load_xls_to_data_table(openFileDialog1.FileName, ref v_dt_source);
                    m_grc_main.DataSource = v_dt_source;
                }
            }
            catch(Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }