private void Button_Click(object sender, RoutedEventArgs e) { Excel_ReadFile owa = null; ExcelData exceldata = null; owa = (Excel_ReadFile)this.ModelItem.GetCurrentValue(); string workSheetName = owa.WorksheetName.Expression.ToString(); string strFilePath = owa.FilePath.Expression.ToString(); string workbookName = owa.FilePath.Expression.ToString(); //string strFilePath = owa.FilePath; //string workbookName = owa.FilePath; bool bIsHeader = owa.IsHeader; owa.ReadExcelData(workSheetName, strFilePath, workbookName, bIsHeader); if (owa.dt != null) { if (exceldata == null) { exceldata = new ExcelData(); } exceldata.SetData(owa.dt); exceldata.ShowDialog(); } }
private void Button_Click_1(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog fileDialog = new Microsoft.Win32.OpenFileDialog(); if (fileDialog.ShowDialog() == true) { //this.ModelItem.Properties["FilePath"].SetValue(fileDialog.FileName); Excel_ReadFile owa = null; owa = (Excel_ReadFile)this.ModelItem.GetCurrentValue(); owa.FilePath.Expression = fileDialog.FileName; } }