private void PageQuery_Click(object sender, RoutedEventArgs e) { try { FunctionCatalog catalogFunctionQuery = new FunctionCatalog(); catalogFunctionQuery.FunctionCode = txtQueryFunctionCode.Text; catalogFunctionQuery.FunctionName = txtQueryFunctionName.Text; if (ddlParentFunctionQuery.SelectedIndex > 0) { FunctionCatalogView navigationCatalog = ddlParentFunctionQuery.SelectedItem as FunctionCatalogView; catalogFunctionQuery.PFCID = navigationCatalog.PFCID; } if (ddlFormPageQuery.SelectedIndex > 0) { FormPageView formPage = ddlFormPageQuery.SelectedItem as FormPageView; catalogFunctionQuery.FPID = formPage.FPID; } List <FunctionCatalogView> lstFunctionCatalogQuery = GlobalFacade.ConfigurationFacade.GetFunctionCatalogList(catalogFunctionQuery).ToList(); dgQuery.ItemsSource = lstFunctionCatalogQuery; } catch (Exception ex) { //LogHelper.LogMsg("btnLogin_Click>>" + ex.Message, true); } }
/// <summary> /// gridview的绑定列方法,用于隐藏一些列 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e) { try { DataGrid dg = (DataGrid)sender; Hashtable htDataGridColumn = new Hashtable(); FunctionCatalogView catalogFunctionView = new FunctionCatalogView(); Hashtable htAllProperty = ClassHelper.TraversePropertyType(catalogFunctionView); foreach (DictionaryEntry property in htAllProperty) { if (!property.Value.ToString().Contains("Guid")) { htDataGridColumn.Add(property.Key, ""); } } foreach (DataGridColumn c in dg.Columns) { if (!htDataGridColumn.Contains(c.SortMemberPath)) { c.Visibility = Visibility.Hidden; } } //LanguageHelper.SetDataGridViewLanguage(dg); } catch (Exception ex) { //LogHelper.LogMsg(strClass + ".radGridView_AutoGeneratedColumns>>" + ex.Message, true); } }
private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (this.dgQuery.SelectedIndex == -1) { return; } FunctionCatalogView functionCatalogSelect = dgQuery.Items[dgQuery.SelectedIndex] as FunctionCatalogView; if (functionCatalogSelect == null) { return; } functionCatalogEdit = new FunctionCatalog(); functionCatalogEdit.FCID = functionCatalogSelect.FCID; functionCatalogEdit.FunctionCode = functionCatalogSelect.FunctionCode; functionCatalogEdit.FunctionName = functionCatalogSelect.FunctionName; functionCatalogEdit.CatalogIcon = functionCatalogSelect.CatalogIcon; functionCatalogEdit.Sequence = functionCatalogSelect.Sequence; functionCatalogEdit.Description = functionCatalogSelect.Description; functionCatalogEdit.CreatedUser = functionCatalogSelect.CreatedUserGuid; functionCatalogEdit.CreatedTime = functionCatalogSelect.CreatedTime; functionCatalogEdit.Disable = functionCatalogSelect.Disable; //tbMainContent.SelectedItem = tbiEdit; txtFunctionCodeEdit.Text = functionCatalogEdit.FunctionCode; txtFunctionNameEdit.Text = functionCatalogEdit.FunctionName; txtCatalogIconEdit.Text = functionCatalogEdit.CatalogIcon; ddlParentFunctionEdit.SelectedValue = functionCatalogSelect.PFCID; ddlFormPageEdit.SelectedValue = functionCatalogSelect.FPID; txtSequenceEdit.Text = functionCatalogEdit.Sequence.ToString(); txtDescriptionEdit.Text = functionCatalogEdit.Description; cbDisableEdit.IsChecked = functionCatalogEdit.Disable; tbMainContent.SelectedItem = tbiEdit; }