本文整理汇总了C#中Xceed.Wpf.DataGrid.DataGridControl类的典型用法代码示例。如果您正苦于以下问题:C# DataGridControl类的具体用法?C# DataGridControl怎么用?C# DataGridControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridControl类属于Xceed.Wpf.DataGrid命名空间,在下文中一共展示了DataGridControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserControl_DataContextChanged
private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
var selectedItem = (DataContext as IEntityGridViewModel).SelectedItem;
if (selectedItem == null)
return;
Type type = selectedItem.GetType();
var relationshipProperties = type.GetProperties()
.Where(t =>
t.Name != "Relationships" &&
t.GetGetMethod().IsVirtual &&
t.PropertyType.IsGenericType &&
t.PropertyType.GetGenericTypeDefinition() == typeof(ICollection<>))
.ToList();
foreach (var property in relationshipProperties)
{
//Binding binding = new Binding() { Path = new PropertyPath("SelectedItem." + property.Name), Source = this.DataContext };
TextBlock textBlock = new TextBlock() { Text = property.Name };
//BindingOperations.SetBinding(textBlock, TextBlock.TextProperty, binding);
relatedEntitiesStackPanel.Children.Add(textBlock);
Binding binding = new Binding() { Path = new PropertyPath("SelectedItem." + property.Name), Source = this.DataContext };
DataGridControl listView = new DataGridControl();
var value = property.GetValue(selectedItem) as System.Collections.IEnumerable;
//listView.ItemsSource = value;
BindingOperations.SetBinding(listView, DataGrid.ItemsSourceProperty, binding);
relatedEntitiesStackPanel.Children.Add(listView);
}
}
示例2: GeneratorNodeFactory
public GeneratorNodeFactory( NotifyCollectionChangedEventHandler itemsChangedHandler,
NotifyCollectionChangedEventHandler groupsChangedHandler,
EventHandler<ExpansionStateChangedEventArgs> expansionStateChangedHandler,
EventHandler isExpandedChangingHandler,
EventHandler isExpandedChangedHandler,
DataGridControl dataGridControl )
{
if( itemsChangedHandler == null )
throw new ArgumentNullException( "itemsChangedHandler" );
if( groupsChangedHandler == null )
throw new ArgumentNullException( "groupsChangedHandler" );
if( expansionStateChangedHandler == null )
throw new ArgumentNullException( "expansionStateChangedHandler" );
if( isExpandedChangingHandler == null )
throw new ArgumentNullException( "isExpandedChangingHandler" );
if( isExpandedChangedHandler == null )
throw new ArgumentNullException( "isExpandedChangedHandler" );
m_itemsChangedHandler = itemsChangedHandler;
m_groupsChangedHandler = groupsChangedHandler;
m_expansionStateChangedHandler = expansionStateChangedHandler;
m_isExpandedChangingHandler = isExpandedChangingHandler;
m_isExpandedChangedHandler = isExpandedChangedHandler;
if( dataGridControl != null )
{
m_dataGridControl = new WeakReference( dataGridControl );
}
}
示例3: CreateGenerator
internal static CustomItemContainerGenerator CreateGenerator( DataGridControl parentGridControl, CollectionView collectionView, DataGridContext dataGridContext )
{
CustomItemContainerGenerator newGenerator = new CustomItemContainerGenerator( collectionView, dataGridContext, parentGridControl );
dataGridContext.SetGenerator( newGenerator );
return newGenerator;
}
示例4: SelectionManager
public SelectionManager( DataGridControl owner )
{
if( owner == null )
throw new ArgumentNullException( "owner" );
m_owner = owner;
}
示例5: BuildDetailStructure
/// <summary>
/// Builds collectionSource DetailDescriptions.ItemProperties and collection of detail columns.
/// </summary>
/// <param name="collectionSource"></param>
/// <param name="xceedControl"></param>
/// <param name="detail"></param>
public void BuildDetailStructure(DataGridCollectionViewSource collectionSource, DataGridControl xceedGrid,
DetailConfiguration detail)
{
Debug.Assert(null != collectionSource.DetailDescriptions);
Debug.Assert(1 == collectionSource.DetailDescriptions.Count);
_BuildCollectionSource(collectionSource.DetailDescriptions[0].ItemProperties);
_BuildColumnsCollection(detail.Columns);
// Add stops as detail of route.
xceedGrid.DetailConfigurations.Clear();
xceedGrid.DetailConfigurations.Add(detail);
// NOTE: Set this property so that columns with custom order properties from default
// settings were not added to grid automatically.
xceedGrid.DetailConfigurations[0].AutoCreateColumns = false;
// Collapse all detail and reexpand it.
List<DataGridContext> dataGridContexts = new List<DataGridContext>(xceedGrid.GetChildContexts());
foreach (DataGridContext dataGridContext in dataGridContexts)
{
dataGridContext.ParentDataGridContext.CollapseDetails(dataGridContext.ParentItem);
dataGridContext.ParentDataGridContext.ExpandDetails(dataGridContext.ParentItem);
}
}
示例6: ff_DataContextChanged
private void ff_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
control = sender as DataGridControl;
this.inpc = e.NewValue as INotifyPropertyChanged;
if (this.inpc != null)
{
this.propInfo = e.NewValue.GetType().GetProperty(this.Path);
Debug.WriteLine("New DataContext: {0}", e.NewValue);
this.inpc.PropertyChanged += this.inpc_PropertyChanged;
}
}
示例7: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 13 "..\..\..\..\..\bin\Common\UserControls\ShowProcessFile.xaml"
((System.Windows.Controls.TextBlock)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.TextBlock_MouseDown);
#line default
#line hidden
return;
case 2:
this.GridDetails = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
#line 19 "..\..\..\..\..\bin\Common\UserControls\ShowProcessFile.xaml"
this.GridDetails.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.GridDetails_MouseDoubleClick);
#line default
#line hidden
return;
case 3:
this.tbView = ((Xceed.Wpf.DataGrid.Views.TableView)(target));
return;
}
this._contentLoaded = true;
}
示例8: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.KitAssembly = ((WpfFront.Views.KitAssemblyView)(target));
return;
case 2:
this.stpDocList2 = ((System.Windows.Controls.StackPanel)(target));
return;
case 3:
this.txtSearch = ((System.Windows.Controls.TextBox)(target));
#line 59 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.txtSearch.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtSearch_TextChanged);
#line default
#line hidden
return;
case 4:
this.chkLate = ((System.Windows.Controls.CheckBox)(target));
#line 60 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.chkLate.Checked += new System.Windows.RoutedEventHandler(this.chkLate_Checked);
#line default
#line hidden
#line 60 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.chkLate.Unchecked += new System.Windows.RoutedEventHandler(this.chkLate_Checked);
#line default
#line hidden
return;
case 5:
#line 61 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
((System.Windows.Controls.Image)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_MouseDown);
#line default
#line hidden
return;
case 6:
this.dgDocument = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
#line 73 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.dgDocument.GotFocus += new System.Windows.RoutedEventHandler(this.dgDocument_Click);
#line default
#line hidden
return;
case 7:
this.ctnColsMenu1 = ((System.Windows.Controls.ContextMenu)(target));
return;
case 8:
#line 85 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
((System.Windows.Controls.MenuItem)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.MenuItem_MouseEnter);
#line default
#line hidden
return;
case 9:
this.tabMenu = ((System.Windows.Controls.TabControl)(target));
return;
case 10:
this.lvDocumentData = ((System.Windows.Controls.ListView)(target));
return;
case 11:
this.xRefresh = ((System.Windows.Controls.Image)(target));
#line 197 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.xRefresh.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.xRefresh_MouseDown);
#line default
#line hidden
return;
case 12:
this.btnRecTkt = ((System.Windows.Controls.Button)(target));
#line 200 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.btnRecTkt.Click += new System.Windows.RoutedEventHandler(this.btnRecTkt_Click);
#line default
#line hidden
return;
case 13:
this.ucDirectPrint = ((WpfFront.Common.UserControls.DirectPrint)(target));
return;
case 14:
this.btnPrintOpc = ((System.Windows.Controls.Button)(target));
#line 212 "..\..\..\..\Trace\Views\KitAssemblyView.xaml"
this.btnPrintOpc.Click += new System.Windows.RoutedEventHandler(this.btnPrintOpc_Click);
#line default
#line hidden
return;
case 15:
this.cboStatus = ((System.Windows.Controls.ComboBox)(target));
return;
//.........这里部分代码省略.........
示例9: switch
//.........这里部分代码省略.........
case 33:
this.textProgressInformation = ((System.Windows.Controls.TextBlock)(target));
return;
case 34:
this.TextName = ((System.Windows.Controls.TextBox)(target));
return;
case 35:
#line 446 "..\..\..\..\..\Trace\Views\QueriesView.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 36:
this.btnUpd = ((System.Windows.Controls.Button)(target));
#line 448 "..\..\..\..\..\Trace\Views\QueriesView.xaml"
this.btnUpd.Click += new System.Windows.RoutedEventHandler(this.btnUpd_Click);
#line default
#line hidden
return;
case 37:
this.btnDelRep = ((System.Windows.Controls.Button)(target));
#line 451 "..\..\..\..\..\Trace\Views\QueriesView.xaml"
this.btnDelRep.Click += new System.Windows.RoutedEventHandler(this.btnDelRep_Click);
#line default
#line hidden
return;
case 38:
this.GridDetails = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
return;
case 39:
this.tbView = ((Xceed.Wpf.DataGrid.Views.TableView)(target));
return;
case 40:
this.popUcFilters = ((System.Windows.Controls.Primitives.Popup)(target));
return;
case 41:
this.brDocList = ((System.Windows.Controls.Border)(target));
return;
case 42:
this.stkFilters = ((System.Windows.Controls.WrapPanel)(target));
return;
case 43:
this.btnPop = ((System.Windows.Controls.Button)(target));
#line 532 "..\..\..\..\..\Trace\Views\QueriesView.xaml"
this.btnPop.Click += new System.Windows.RoutedEventHandler(this.btnPop_Click);
#line default
#line hidden
return;
case 44:
#line 535 "..\..\..\..\..\Trace\Views\QueriesView.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
#line default
#line hidden
return;
case 45:
示例10: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.Direccion_Solicitante = ((System.Windows.Controls.Grid)(target));
return;
case 2:
this.border_Copy7 = ((System.Windows.Controls.Border)(target));
return;
case 3:
this.datagrid1 = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
return;
case 4:
this.But_Agregar = ((System.Windows.Controls.Button)(target));
#line 67 "..\..\..\..\..\Objs\Controles\Visitas\us_CitasMotivos.xaml"
this.But_Agregar.Click += new System.Windows.RoutedEventHandler(this.But_Agregar_Click);
#line default
#line hidden
return;
case 5:
this.But_Buscar_Copy = ((System.Windows.Controls.Button)(target));
return;
}
this._contentLoaded = true;
}
示例11: CustomItemContainerGenerator
private CustomItemContainerGenerator( CollectionView collectionView, DataGridContext dataGridContext, DataGridControl gridControl )
{
if( collectionView == null )
{
throw new ArgumentNullException( "collectionView" );
}
if( dataGridContext == null )
{
throw new ArgumentNullException( "dataGridContext" );
}
if( gridControl == null )
{
throw new ArgumentNullException( "gridControl" );
}
m_dataGridControl = gridControl;
m_dataGridContext = dataGridContext;
m_collectionView = collectionView;
IList listInterface = m_collectionView as IList;
if( listInterface == null )
{
listInterface = m_collectionView.SourceCollection as IList;
}
m_listInterface = listInterface;
//initialize explicitly (set a local value) to the DataItem attached property (for nested DataGridControls)
CustomItemContainerGenerator.SetDataItemProperty( m_dataGridControl, CustomItemContainerGenerator.NotSet );
//Notify to the ItemCollection CollectionChanged event.
CollectionChangedEventManager.AddListener( m_collectionView, this );
//Notify to the DataGridControl's or DetailConfiguration GroupConfigurationSelector Changed event.
GroupConfigurationSelectorChangedEventManager.AddListener( m_dataGridContext, this );
CollectionChangedEventManager.AddListener( m_dataGridContext.DetailConfigurations, this );
// It would have been neat to create a DependencyPropertyChangedEventManager but the
// WeakEventManager was not made to work with DependencyPropertyDescriptor.AddValueChanged.
//identifies a Master generator
if( m_dataGridContext.SourceDetailConfiguration == null )
{
ItemsSourceChangeCompletedEventManager.AddListener( m_dataGridControl, this );
ViewChangedEventManager.AddListener( m_dataGridControl, this );
ThemeChangedEventManager.AddListener( m_dataGridControl, this );
}
m_nodeFactory = new GeneratorNodeFactory( this.OnGeneratorNodeItemsCollectionChanged,
this.OnGeneratorNodeGroupsCollectionChanged,
this.OnGeneratorNodeExpansionStateChanged,
this.OnGroupGeneratorNodeIsExpandedChanging,
this.OnGroupGeneratorNodeIsExpandedChanged );
m_headerFooterDataContextBinding = new Binding();
m_headerFooterDataContextBinding.Source = m_dataGridControl;
m_headerFooterDataContextBinding.Path = new PropertyPath( DataGridControl.DataContextProperty );
this.ResetNodeList();
this.IncrementCurrentGenerationCount();
}
示例12: _InitPrintConfiguration
/// <summary>
/// Method inits grid's print configuration
/// </summary>
/// <param name="xceedGrid"></param>
private void _InitPrintConfiguration(DataGridControl xceedGrid)
{
// if current page contains "Print" button and print configuration defined in structure
if (_headerTemplate != null)
{
PrintTableView view = new PrintTableView();
view.PageHeaders.Add(_headerTemplate);
view.PageFooters.Add((DataTemplate)App.Current.FindResource(PRINT_FOOTER_RESOURCE_NAME));
xceedGrid.PrintView = view;
}
}
示例13: ProcessDrop
private void ProcessDrop(DataGridControl lvDest, GetPositionDelegate mousePoint)
{
if (curSource == lvDest)
return;
if (sourceIndex < 0)
return;
int index = this.GetCurrentIndex(mousePoint, lvDest);
if (index < 0)
index = 0; //return;
((IList<IqReportColumn>)curSource.Items.SourceCollection).Remove(selectedItem);
if (curSource.Name == "lvDest")
//Remueve de los seleccionados cambia el visible a false
RemoveFromSelected(this, new DataEventArgs<IqReportColumn>(selectedItem));
//Destination Operation
if (((IList<IqReportColumn>)lvDest.Items.SourceCollection).Where(f => f.ReportColumnId == selectedItem.ReportColumnId).Count() == 0)
{
//Add Trask By User
if (lvDest.Name == "lvDest")
AddToSelected(this, new DataEventArgs<IqReportColumn>(selectedItem));
((IList<IqReportColumn>)lvDest.Items.SourceCollection).Insert(index, selectedItem);
}
lvDest.Items.Refresh();
curSource.Items.Refresh();
}
示例14: switch
//.........这里部分代码省略.........
#line default
#line hidden
return;
case 7:
#line 115 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
((System.Windows.Controls.Image)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_MouseDown);
#line default
#line hidden
return;
case 8:
this.bntReset = ((System.Windows.Controls.Button)(target));
#line 119 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
this.bntReset.Click += new System.Windows.RoutedEventHandler(this.bntReset_Click);
#line default
#line hidden
return;
case 9:
this.ucDocList = ((WpfFront.Common.UserControls.DocumentList)(target));
return;
case 10:
this.tabStep = ((System.Windows.Controls.TabControl)(target));
#line 141 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
this.tabStep.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.tabStep_SelectionChanged);
#line default
#line hidden
return;
case 11:
this.docName = ((System.Windows.Controls.StackPanel)(target));
return;
case 12:
this.chkAll = ((System.Windows.Controls.TextBlock)(target));
#line 153 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
this.chkAll.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.chkAll_MouseDown);
#line default
#line hidden
return;
case 13:
this.uncheckAll = ((System.Windows.Controls.TextBlock)(target));
#line 155 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
this.uncheckAll.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.uncheckAll_MouseDown);
#line default
#line hidden
return;
case 14:
this.dgDetails = ((System.Windows.Controls.ListView)(target));
#line 170 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
this.dgDetails.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dgDetails_SelectionChanged);
#line default
#line hidden
#line 171 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
this.dgDetails.AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new System.Windows.RoutedEventHandler(this.dgDetails_Click));
#line default
#line hidden
return;
case 15:
this.gvLines = ((System.Windows.Controls.GridView)(target));
return;
case 17:
this.dgVendorDetails = ((System.Windows.Controls.ListView)(target));
return;
case 18:
this.txtComment = ((System.Windows.Controls.TextBox)(target));
return;
case 19:
this.dgSelected = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
return;
case 20:
this.cboProcess = ((System.Windows.Controls.ComboBox)(target));
return;
case 21:
#line 375 "..\..\..\..\..\Trace\Views\OrderMngrV2View.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
case 22:
this.popup3 = ((System.Windows.Controls.Primitives.Popup)(target));
return;
case 23:
this.ucDocLine = ((WpfFront.Common.UserControls.AdminDocumentLine)(target));
return;
}
this._contentLoaded = true;
}
示例15: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.AdminTrackOption = ((WpfFront.Views.AdminTrackOptionView)(target));
return;
case 2:
this.stkSearchForm = ((System.Windows.Controls.StackPanel)(target));
return;
case 3:
this.dgSearch = ((System.Windows.Controls.Grid)(target));
return;
case 4:
this.btnNew = ((System.Windows.Controls.Button)(target));
#line 50 "..\..\..\..\..\General\Views\AdminTrackOptionView.xaml"
this.btnNew.Click += new System.Windows.RoutedEventHandler(this.btnNew_Click);
#line default
#line hidden
return;
case 5:
this.dgList = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
#line 65 "..\..\..\..\..\General\Views\AdminTrackOptionView.xaml"
this.dgList.GotFocus += new System.Windows.RoutedEventHandler(this.dgList_GotFocus);
#line default
#line hidden
return;
case 6:
this.stkEdit = ((System.Windows.Controls.StackPanel)(target));
return;
case 7:
this.frmNotification = ((Core.WPF.FormNotification)(target));
return;
case 8:
this.dgEdit = ((System.Windows.Controls.Grid)(target));
return;
case 9:
this.btnSave = ((System.Windows.Controls.Button)(target));
#line 189 "..\..\..\..\..\General\Views\AdminTrackOptionView.xaml"
this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}