public Fenetre_Classement() { InitializeComponent(); CT_Get_Classement CT = new CT_Get_Classement(); Joueur[] classement = (Joueur[])CT.Exec(new Message()).Data[0]; GridView view = new GridView(); GridViewColumn col1 = new GridViewColumn(); col1.Header = "Nom"; col1.DisplayMemberBinding = new Binding("Nom"); view.Columns.Add(col1); GridViewColumn col2 = new GridViewColumn(); col2.Header = "Score"; col2.DisplayMemberBinding = new Binding("Score"); view.Columns.Add(col2); view.AllowsColumnReorder = false; this.ClassementListView.View = view; foreach (Joueur j in classement) { this.ClassementListView.Items.Add(new Item(j.Nom, j.Score)); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 8 "..\..\CaptureInterface.xaml" ((抓包程序.CaptureInterface)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: this.lsInterface = ((System.Windows.Controls.ListView)(target)); #line 10 "..\..\CaptureInterface.xaml" this.lsInterface.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.lsInterface_MouseDoubleClick); #line default #line hidden return; case 3: this.gridInterface = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.logList = ((System.Windows.Controls.ListView)(target)); return; case 2: this.storedLogs_ListView = ((System.Windows.Controls.GridView)(target)); return; case 3: this.liveGraph1 = ((WindowsPerformanceMonitor.Graphs.LiveLineGraph)(target)); return; case 4: this.liveGraph2 = ((WindowsPerformanceMonitor.Graphs.LiveLineGraph)(target)); return; case 5: this.logList2 = ((System.Windows.Controls.ListView)(target)); return; case 6: this.storedLogs_ListView2 = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.listView = ((System.Windows.Controls.ListView)(target)); return; case 2: this.gridView1 = ((System.Windows.Controls.GridView)(target)); return; case 3: this.button1 = ((System.Windows.Controls.Button)(target)); #line 25 "..\..\MainWindow.xaml" this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click); #line default #line hidden return; case 4: this.stackPanel = ((System.Windows.Controls.WrapPanel)(target)); return; case 5: this.textBox = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }
public TabularDataViewer(IBioLinkReport report, DataMatrix data, IProgressObserver progress) { InitializeComponent(); this.Data = data; _progress = progress; _report = report; var view = new GridView(); var columns = report.DisplayColumns; if (columns == null || columns.Count == 0) { columns = GenerateDefaultColumns(data); } var hcs = viewerGrid.Resources["hcs"] as Style; foreach (DisplayColumnDefinition c in columns) { DisplayColumnDefinition coldef = c; var column = new GridViewColumn { Header = BuildColumnHeader(coldef), DisplayMemberBinding = new Binding(String.Format("[{0}]", data.IndexOf(coldef.ColumnName))), HeaderContainerStyle = hcs }; view.Columns.Add(column); } lvw.AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(GridViewColumnHeaderClickedHandler)); lvw.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(lvw_MouseRightButtonUp); lvw.ItemsSource = Data.Rows; this.lvw.View = view; }
public void SetAlarmList() { GridView gridView = new GridView(); GridViewColumn column = new GridViewColumn(); column.Header = "ALARM NO"; column.Width = double.NaN; column.DisplayMemberBinding = new System.Windows.Data.Binding("AlarmNo"); gridView.Columns.Add(column); column = new GridViewColumn(); column.Header = "NAME"; column.Width = double.NaN; column.DisplayMemberBinding = new System.Windows.Data.Binding("AlarmName"); gridView.Columns.Add(column); //column = new GridViewColumn(); //column.Header = "DESCRIPTION"; //column.Width = double.NaN; //column.DisplayMemberBinding = new System.Windows.Data.Binding("Description"); //gridView.Columns.Add(column); column = new GridViewColumn(); column.Header = "SOLUTION"; column.Width = double.NaN; column.DisplayMemberBinding = new System.Windows.Data.Binding("Solution"); gridView.Columns.Add(column); listViewAlarmList.View = gridView; listViewAlarmList.FontFamily = new FontFamily("Tahoma"); listViewAlarmList.FontSize = 16; listViewAlarmList.FontWeight = FontWeights.Bold; }
public TableVisualiserPattern() { InitializeComponent(); TableListView.Width = Width - 50; TableListView.Height = Height - 50; var objCollection = SqlRepository.Schedules; //input smthing // var obj = objCollection.Cast<Models.Schedule>().FirstOrDefault(); var objType = typeof(Models.Schedule); var gridView = new GridView(); TableListView.View = gridView; foreach (var prop in objType.GetProperties().Where(prop => prop.PropertyType.IsPrimitive || prop.PropertyType == typeof(string) || prop.PropertyType == typeof(DateTime))) { gridView.Columns.Add(new GridViewColumn() { Header = prop.Name, DisplayMemberBinding = new Binding(prop.Name) }); } foreach (var o in objCollection.Cast<Models.Schedule>()) { TableListView.Items.Add(o); } }
public PluginWindow() { InitializeComponent(); _plugins = new Plugins(); var gridView = new GridView(); listViewPlugins.View = gridView; gridView.Columns.Add(new GridViewColumn { Header = "Name", DisplayMemberBinding = new Binding("Name") }); gridView.Columns.Add(new GridViewColumn { Header = "Status", DisplayMemberBinding = new Binding("Status") }); gridView.Columns.Add(new GridViewColumn { Header = "EventStart", DisplayMemberBinding = new Binding("EventStart") }); foreach (var item in new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }) { listViewPlugins.Items.Add(new { Name = "plugin " + item.ToString(), EventStart = "onLoad", Status = "Enable" }); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ddl_Category = ((System.Windows.Controls.ComboBox)(target)); return; case 2: this.ddl_subcategory = ((System.Windows.Controls.ComboBox)(target)); return; case 3: this.ddl_product = ((System.Windows.Controls.ComboBox)(target)); return; case 4: this.Sellinglst = ((System.Windows.Controls.ListView)(target)); return; case 5: this.grdDelar = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
static void CalculateSizes(GridView view, string sizeValue, double fullWidth) { string[] sizes = (sizeValue ?? "").Split(';'); Debug.Assert(sizes.Length == view.Columns.Count); Dictionary<int, Func<double, double>> percentages = new Dictionary<int, Func<double, double>>(); double remainingWidth = fullWidth - 30; // 30 is a good offset for the scrollbar for (int i = 0; i < view.Columns.Count; i++) { var column = view.Columns[i]; double size; bool isPercentage = !double.TryParse(sizes[i], out size); if (isPercentage) { size = double.Parse(sizes[i].TrimEnd('%', ' ')); percentages.Add(i, w => w * size / 100.0); } else { column.Width = size; remainingWidth -= size; } } if (remainingWidth < 0) return; foreach (var p in percentages) { var column = view.Columns[p.Key]; column.Width = p.Value(remainingWidth); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var config = value as ColumnConfig; if (config != null) { var gridView = new GridView(); gridView.ColumnHeaderContainerStyle = Application.Current.FindResource("HeaderContainerStyle") as Style; gridView.ColumnHeaderTemplate = Application.Current.FindResource("HeaderTemplate") as DataTemplate; if (config.Columns != null) { foreach (var column in config.Columns) { var bindingDisplayMember = new Binding(column.DataField); if (IsStripMultiLinesInList) bindingDisplayMember.Converter = stripMultiLineConverter; GridViewColumn gvc = new GridViewColumn { Header = column, DisplayMemberBinding = bindingDisplayMember }; var bindingWidth = new Binding("IsVisible"); bindingWidth.Source = column; bindingWidth.Converter = this.columnIsVisibleToWidthConverter; BindingOperations.SetBinding(gvc, GridViewColumn.WidthProperty, bindingWidth); gvc.SetValue(GridViewSort.PropertyNameProperty, bindingDisplayMember.Path.Path); gridView.Columns.Add(gvc); } } return gridView; } return Binding.DoNothing; }
void BuildDockingLayout() { dockManager.Content = null; //TreeView dockable content var trv = new TreeView(); trv.Items.Add(new TreeViewItem() { Header = "Item1" }); trv.Items.Add(new TreeViewItem() { Header = "Item2" }); trv.Items.Add(new TreeViewItem() { Header = "Item3" }); trv.Items.Add(new TreeViewItem() { Header = "Item4" }); ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem1" }); ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem2" }); ((TreeViewItem)trv.Items[1]).Items.Add(new TreeViewItem() { Header = "SubItem3" }); ((TreeViewItem)trv.Items[2]).Items.Add(new TreeViewItem() { Header = "SubItem4" }); var treeviewContent = new DockableContent() { Title = "Explorer", Content = trv }; treeviewContent.Show(dockManager, AnchorStyle.Bottom); //TextBox invo dockable content var treeviewInfoContent = new DockableContent() { Title = "Explorer Info", Content = new TextBox() { Text = "Explorer Info Text", IsReadOnly = true } }; treeviewContent.ContainerPane.Items.Add(treeviewInfoContent); //ListView dockable content var gridView = new GridView(); gridView.Columns.Add(new GridViewColumn() { Header = "Date" }); gridView.Columns.Add(new GridViewColumn() { Header = "Day Of Weeek", DisplayMemberBinding = new Binding("DayOfWeek") }); gridView.Columns.Add(new GridViewColumn() { Header = "Year", DisplayMemberBinding = new Binding("Year") }); gridView.Columns.Add(new GridViewColumn() { Header = "Month", DisplayMemberBinding = new Binding("Month") }); gridView.Columns.Add(new GridViewColumn() { Header = "Second", DisplayMemberBinding = new Binding("Second") }); var listView = new ListView() { View = gridView }; listView.Items.Add(DateTime.Now); listView.Items.Add(DateTime.Now.AddYears(-1)); listView.Items.Add(DateTime.Now.AddMonths(15)); listView.Items.Add(DateTime.Now.AddHours(354)); var listViewContent = new DockableContent() { Title = "Date & Times", Content = listView }; listViewContent.ShowAsFloatingWindow(dockManager, true); //TextBox dockable content var textboxSampleContent = new DockableContent() { Title = "Date & Times Info", Content = new TextBox() { Text = "Date & Times Info Text", IsReadOnly = true } }; listViewContent.ContainerPane.Items.Add(textboxSampleContent); //DataGrid document //var dataGrid = new DataGrid(); //var rnd = new Random(); //var data = new List<Tuple<double, double, double, double>>(); //for (int i = 0; i < 100; i++) //{ // data.Add(Tuple.Create(rnd.NextDouble(), rnd.NextDouble() * 10.0, rnd.NextDouble() * 100.0, rnd.NextDouble() * 1000.0)); //} //dataGrid.ItemsSource = data; //var dataGridDocument = new DocumentContent() { Title = "Data", IsLocked = true, Content = dataGrid }; //dataGridDocument.Show(dockManager); ////DataGrid Info Text sample //var dataGridInfoContent = new DockableContent() { Title = "Data Info", Content = new TextBox() { Text = "Data Info Text" } }; //dataGridInfoContent.ShowAsDocument(dockManager); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 16 "..\..\..\RankingWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 2: this.lbl_score = ((System.Windows.Controls.Label)(target)); return; case 3: this.lbl_moyenne = ((System.Windows.Controls.Label)(target)); return; case 4: this.lbl_particiation = ((System.Windows.Controls.Label)(target)); return; case 5: this.ListeRank = ((System.Windows.Controls.ListView)(target)); return; case 6: this.GridRank = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.gn_status = ((System.Windows.Controls.Grid)(target)); return; case 2: this.lst_ServiceStatus = ((System.Windows.Controls.ListView)(target)); return; case 3: this.g_ServiceStatus = ((System.Windows.Controls.GridView)(target)); return; case 4: this.txt_lastupdated = ((System.Windows.Controls.TextBlock)(target)); return; case 5: this.btnExit = ((System.Windows.Controls.Button)(target)); #line 64 "..\..\ServiceStatus.xaml" this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btnExit_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.txt_FromDate = ((System.Windows.Controls.DatePicker)(target)); return; case 2: this.txt_ToDate = ((System.Windows.Controls.DatePicker)(target)); return; case 3: this.Purchaselst = ((System.Windows.Controls.ListView)(target)); return; case 4: this.grdpurchase = ((System.Windows.Controls.GridView)(target)); return; case 5: this.Selllst = ((System.Windows.Controls.ListView)(target)); return; case 6: this.grdSell = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.uxList = ((System.Windows.Controls.ListView)(target)); return; case 2: this.uxGridView = ((System.Windows.Controls.GridView)(target)); return; case 3: #line 28 "..\..\..\..\Homework3\MainWindow.xaml" ((System.Windows.Controls.GridViewColumnHeader)(target)).Click += new System.Windows.RoutedEventHandler(this.GridViewColumnHeader_Click); #line default #line hidden return; case 4: #line 33 "..\..\..\..\Homework3\MainWindow.xaml" ((System.Windows.Controls.GridViewColumnHeader)(target)).Click += new System.Windows.RoutedEventHandler(this.GridViewColumnHeader_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.btnStart = ((System.Windows.Controls.Button)(target)); return; case 2: this.txtFirstDirectory = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.txtSecondDirectory = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.lstDirectoryActionDetails = ((System.Windows.Controls.ListView)(target)); return; case 5: this.grvAction = ((System.Windows.Controls.GridView)(target)); return; case 6: this.lstDirectoryDiff = ((System.Windows.Controls.ListView)(target)); return; case 7: this.grvDirectoryDiff = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
public void AllAncestorsTest() { var gridView = new GridView(); var gridViewColumn = new GridViewColumn(); gridView.Columns.Add(gridViewColumn); Assert.AreEqual(gridView, gridViewColumn.AllAncestors().First()); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.accountlist = ((Sales.Account.AccountList)(target)); return; case 2: this.spPanel = ((System.Windows.Controls.Grid)(target)); return; case 3: this.grCondition = ((System.Windows.Controls.Grid)(target)); return; case 4: this.txtSearch = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.Search = ((System.Windows.Controls.Button)(target)); return; case 6: this.lvaccount = ((System.Windows.Controls.ListView)(target)); #line 56 "..\..\..\Account\AccountList.xaml" this.lvaccount.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.lvaccount_SelectionChanged); #line default #line hidden return; case 7: this.GridView1 = ((System.Windows.Controls.GridView)(target)); return; case 8: this.account_tranObj = ((System.Windows.Controls.ListView)(target)); return; case 9: this.GridView2 = ((System.Windows.Controls.GridView)(target)); return; case 10: this.btnInsert1 = ((System.Windows.Controls.Button)(target)); return; case 11: this.btnUpdate1 = ((System.Windows.Controls.Button)(target)); return; case 12: this.btnDelet1e1 = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.button = ((System.Windows.Controls.Button)(target)); #line 16 "..\..\MainWindow.xaml" this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click); #line default #line hidden return; case 2: this.MojaLista = ((System.Windows.Controls.ListView)(target)); return; case 3: this.view1 = ((System.Windows.Controls.GridView)(target)); return; case 4: this.PieChart1 = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target)); return; case 5: this.richTextBox = ((System.Windows.Controls.RichTextBox)(target)); return; case 6: this.button1 = ((System.Windows.Controls.Button)(target)); #line 75 "..\..\MainWindow.xaml" this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click); #line default #line hidden return; case 7: this.button2 = ((System.Windows.Controls.Button)(target)); #line 76 "..\..\MainWindow.xaml" this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click); #line default #line hidden return; case 8: this.textBoxPrawdKrzyz = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.label = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.datagridview = ((System.Windows.Controls.ListView)(target)); return; case 2: this.view = ((System.Windows.Controls.GridView)(target)); return; case 3: this.id = ((System.Windows.Controls.GridViewColumn)(target)); return; case 4: this.nom = ((System.Windows.Controls.GridViewColumn)(target)); return; case 5: this.elem = ((System.Windows.Controls.GridViewColumn)(target)); return; case 6: this.caract = ((System.Windows.Controls.GridViewColumn)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.BindRoles = ((System.Windows.Controls.ListView)(target)); return; case 2: this.SoldierGridView = ((System.Windows.Controls.GridView)(target)); return; case 3: this.AddRoleBtn = ((System.Windows.Controls.Button)(target)); return; case 4: this.RemoveRoleBtn = ((System.Windows.Controls.Button)(target)); return; case 5: this.ActiveItem = ((System.Windows.Controls.ContentControl)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.gvCountry = ((System.Windows.Controls.ListView)(target)); return; case 2: this.gv = ((System.Windows.Controls.GridView)(target)); return; case 3: this.txtCountryId = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtCountryName = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.label1 = ((System.Windows.Controls.Label)(target)); return; case 6: this.label2 = ((System.Windows.Controls.Label)(target)); return; case 7: this.btnSave = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
public ListSystemParameters() { Title = "List System Parameters"; ListView lstvue = new ListView(); Content = lstvue; GridView grdvue = new GridView(); lstvue.View = grdvue; GridViewColumn col = new GridViewColumn(); col.Header = "Property Name"; col.Width = 200; col.DisplayMemberBinding = new Binding("Name"); grdvue.Columns.Add(col); col = new GridViewColumn(); col.Header = "Value"; col.Width = 200; col.DisplayMemberBinding = new Binding("Value"); grdvue.Columns.Add(col); PropertyInfo[] props = typeof(SystemParameters).GetProperties(); foreach (PropertyInfo prop in props) { if (prop.PropertyType != typeof(ResourceKey)) { SystemParam sysparam = new SystemParam(); sysparam.Name = prop.Name; sysparam.Value = prop.GetValue(null, null); lstvue.Items.Add(sysparam); } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.listView = ((System.Windows.Controls.ListView)(target)); return; case 3: this.gridView = ((System.Windows.Controls.GridView)(target)); return; case 4: this.grid = ((System.Windows.Controls.Grid)(target)); return; case 5: this.textBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.executeQueryButton = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
private void AddStyleColumn(FontStyleData fontStyle, GridView gridView) { DataTemplate dataTemplate = (DataTemplate) XamlReader.Parse(string.Format(DATA_TEMPLATE_TEMPLATE, fontStyle.FontWeight, fontStyle.FontStyle, fontStyle.FontSize, fontStyle.TextDecoration)); GridViewColumn column = new GridViewColumn() { Header = fontStyle.Name }; column.CellTemplate = dataTemplate; gridView.Columns.Add(column); }
public Panel AddNewPanel() { ListView newLV = new ListView(); ComboBox newCB = new ComboBox(); panels.Add(new Panel(newCB, newLV)); newLV.Style = Resources["PanelListView"] as Style; newLV.ItemContainerStyle = Resources["PanelListViewItem"] as Style; ; GridView columns = new GridView(); columns.Columns.Add(AddGridViewColumn( "Name", "Name")); columns.Columns.Add(AddGridViewColumn( "Type", "Extension")); columns.Columns.Add(AddGridViewColumn( "Size", "Length")); columns.Columns.Add(AddGridViewColumn( "Date of creation", "CreationTime")); newLV.View = columns; newLV.Loaded += PanelInitialized; newCB.Style = Resources["DrivesComboBox"] as Style; ColumnDefinition newColumn = new ColumnDefinition(); newColumn.Width = new GridLength(1, GridUnitType.Star); PanelsGrid.ColumnDefinitions.Add(newColumn); newLV.SetValue(Grid.RowProperty, 1); newLV.SetValue(Grid.ColumnProperty, numOfPanels); newCB.SetValue(Grid.RowProperty, 0); newCB.SetValue(Grid.ColumnProperty, numOfPanels); PanelsGrid.Children.Add(newLV); PanelsGrid.Children.Add(newCB); AddDrivesInComboBox(newCB); newCB.SelectionChanged += DiskChanged; return panels[numOfPanels++]; }
private static void OnDynamicColumnsPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { //INotifyCollectionChanged collectionChanged = e.OldValue as INotifyCollectionChanged; //if (collectionChanged != null) //{ // collectionChanged.CollectionChanged -= OnColumnsCollectionChanged; //} System.Windows.Controls.GridView gridView = (System.Windows.Controls.GridView)sender; gridView.Columns.Clear(); IEnumerable <GridViewDynamicColumn> dynamicColumns = (IEnumerable <GridViewDynamicColumn>)e.NewValue; if (dynamicColumns == null) { return; } //collectionChanged = e.NewValue as INotifyCollectionChanged; //if (collectionChanged != null) //{ // collectionChanged.CollectionChanged += OnColumnsCollectionChanged; //} foreach (GridViewDynamicColumn dynamicColumn in dynamicColumns) { GridViewColumn column = new GridViewColumn(); dynamicColumn.Bind(column); gridView.Columns.Add(column); } }
private void ViewPage(int page, int num) { DrawingsDataContext dc = DBCommon.NewDC; IQueryable<Drawing> res = (from d in dc.Drawings select d).Skip((page - 1)*num).Take(num); // Create the GridView var gv = new GridView(); gv.AllowsColumnReorder = true; // Create the GridView Columns PropertyInfo[] pi = typeof (MPDrawing).GetProperties(); foreach (PropertyInfo p in pi) { var gvc = new GridViewColumn(); gvc.DisplayMemberBinding = new Binding(p.Name); gvc.Header = p.Name; gvc.Width = Double.NaN; gv.Columns.Add(gvc); } listView1.View = gv; listView1.ItemsSource = res; }
private void Window_Loaded(object sender, RoutedEventArgs e) { GridView myGridView = new GridView(); myGridView.AllowsColumnReorder = true; //Collapse the header Style collapsedHeaderStyle = new Style(); Setter collapsedHeaderSetter = new Setter(); collapsedHeaderSetter.Property = VisibilityProperty; collapsedHeaderSetter.Value = Visibility.Collapsed; collapsedHeaderStyle.Setters.Add(collapsedHeaderSetter); myGridView.ColumnHeaderContainerStyle = collapsedHeaderStyle; for (int i = 0; i < control.XSize; i++) { GridViewColumn col = new GridViewColumn(); col.DisplayMemberBinding = new Binding("Column[" + i.ToString() + "]"); col.Width = 30; myGridView.Columns.Add(col); } listView.View = myGridView; listView.DataContext = control.AgentCollection; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Calculator = ((System.Windows.Controls.Button)(target)); return; case 2: this.Add_Owner = ((System.Windows.Controls.Button)(target)); #line 11 "..\..\Window1.xaml" this.Add_Owner.Click += new System.Windows.RoutedEventHandler(this.Add_Owner_Click); #line default #line hidden return; case 3: this.ListOwner = ((System.Windows.Controls.ListView)(target)); return; case 4: this.greadText = ((System.Windows.Controls.GridView)(target)); return; case 5: this.TextBox_Cena = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }
public MainWindow() { InitializeComponent(); // 以下を追加 this.btnDownload.Click += (sender, e) => { var client = new System.Net.WebClient(); byte[] buffer = client.DownloadData("http://k-db.com/?p=all&download=csv"); string str = Encoding.Default.GetString(buffer); string[] rows = str.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); // 1行目をラベルに表示 this.lblTitle.Content = rows[0]; // 2行目以下はカンマ区切りから文字列の配列に変換しておく List<string[]> list = new List<string[]>(); rows.ToList().ForEach(row => list.Add(row.Split(new char[] { ',' }))); // ヘッダの作成(データバインド用の設計) GridView view = new GridView(); list.First().Select((item, cnt) => new { Count = cnt, Item = item }).ToList().ForEach(header => { view.Columns.Add( new GridViewColumn() { Header = header.Item, DisplayMemberBinding = new Binding(string.Format("[{0}]", header.Count)) }); }); // これらをリストビューに設定 lvStockList.View = view; lvStockList.ItemsSource = list.Skip(1); }; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.flight_show = ((System.Windows.Controls.ListView)(target)); #line 15 "..\..\Show.xaml" this.flight_show.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ItemsView_OnSelectionChanged); #line default #line hidden return; case 2: this.grid = ((System.Windows.Controls.GridView)(target)); return; case 5: #line 49 "..\..\Show.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Show_All); #line default #line hidden return; case 6: this.Airport_show = ((System.Windows.Controls.DataGrid)(target)); return; } this._contentLoaded = true; }
private GridView GetGridView(List<dynamic> list) { GridView gridView = new GridView(); int i = 0; foreach (dynamic item in list) { GridViewColumn col = new GridViewColumn(); col.Header = item.Name; if (item.Type == "System.Boolean") { System.Windows.DataTemplate template = new System.Windows.DataTemplate(); System.Windows.FrameworkElementFactory checkBox = new System.Windows.FrameworkElementFactory(typeof(CheckBox)); checkBox.SetValue(CheckBox.VerticalAlignmentProperty, System.Windows.VerticalAlignment.Center); Binding bd = new Binding("[" + i.ToString() + "].Value"); bd.Mode = BindingMode.OneTime; checkBox.SetBinding(CheckBox.IsCheckedProperty, bd); template.VisualTree = checkBox; col.CellTemplate = template; } else { col.DisplayMemberBinding = new System.Windows.Data.Binding("[" + i.ToString() + "].Value"); } gridView.Columns.Add(col); i++; } return gridView; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.lvDataBinding = ((System.Windows.Controls.ListView)(target)); return; case 2: this.gridView = ((System.Windows.Controls.GridView)(target)); return; case 3: this.buttonLoad = ((System.Windows.Controls.Button)(target)); #line 21 "..\..\..\ExcelWindow.xaml" this.buttonLoad.Click += new System.Windows.RoutedEventHandler(this.buttonLoad_Click); #line default #line hidden return; case 4: this.progressBar1 = ((System.Windows.Controls.ProgressBar)(target)); return; case 5: this.labelInfo = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.List1 = ((System.Windows.Controls.ListView)(target)); #line 15 "..\..\ChercherStaff.xaml" this.List1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.list1Changed); #line default #line hidden return; case 2: this.View1 = ((System.Windows.Controls.GridView)(target)); return; case 3: this.elipse2 = ((System.Windows.Shapes.Ellipse)(target)); return; case 4: this.image_List1 = ((System.Windows.Media.ImageBrush)(target)); return; case 5: this.Prenom = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.Nom = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.Debloquer = ((System.Windows.Controls.Button)(target)); #line 40 "..\..\ChercherStaff.xaml" this.Debloquer.Click += new System.Windows.RoutedEventHandler(this.Debloquer_Click); #line default #line hidden return; case 8: this.Bloquer = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\ChercherStaff.xaml" this.Bloquer.Click += new System.Windows.RoutedEventHandler(this.Bloquer_Click); #line default #line hidden return; case 9: this.IdINfo = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.btnEntrada = ((System.Windows.Controls.Button)(target)); return; case 2: this.btnSaida = ((System.Windows.Controls.Button)(target)); return; case 3: this.btnRascunho = ((System.Windows.Controls.Button)(target)); return; case 4: this.btnEliminados = ((System.Windows.Controls.Button)(target)); return; case 5: this.ltView = ((System.Windows.Controls.ListView)(target)); return; case 6: this.gvMembers = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
public void OneStarSizedTest() { var view = new GridView(); var lw = new ListView(); var gvc = new GridViewColumn(); lw.View = view; var dependencyObjects = view.LogicalAncestors().ToArray(); }
/// <summary> /// Used to build the <GridView> and the <GridViewColumn> controls for a WPF ListView. /// This is used when you want to build a ListView of columns from a DataTable object. /// NOTE: You can't use this routine when you have bound the ListView to an ObjectDataProvider. /// </summary> /// <example> /// DataTable dt; /// /// dt = PDSAXML.XmlFileToDataTable(txtFileToDataset.Text); /// /// lstXML.View = PDSAWPFListView.CreateGridViewColumns(dt); /// lstXML.DataContext = dt; /// </example> /// <param name="dt">A Data Table</param> /// <returns>A GridView object</returns> public static GridView CreateGridViewColumns(DataTable dt) { // Create the GridView GridView gv = new GridView(); gv.AllowsColumnReorder = true; return CreateGridViewColumns(gv, dt); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.UserGrid = ((System.Windows.Controls.ListView)(target)); return; case 2: this.grdTest = ((System.Windows.Controls.GridView)(target)); return; case 3: this.txtUserId = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtFirstName = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.label1 = ((System.Windows.Controls.Label)(target)); return; case 6: this.label3 = ((System.Windows.Controls.Label)(target)); return; case 7: this.btnUpdate = ((System.Windows.Controls.Button)(target)); return; case 8: this.txtCity = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.label2_Copy = ((System.Windows.Controls.Label)(target)); return; case 10: this.txtCountry = ((System.Windows.Controls.TextBox)(target)); return; case 11: this.label2_Copy1 = ((System.Windows.Controls.Label)(target)); return; case 12: this.txtSTate = ((System.Windows.Controls.TextBox)(target)); return; case 13: this.label2_Copy2 = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.lvControl = ((System.Windows.Controls.ListView)(target)); #line 18 "..\..\View_Company.xaml" this.lvControl.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.LvControl_SelectionChanged); #line default #line hidden return; case 2: this.list = ((System.Windows.Controls.GridView)(target)); return; case 3: this.name = ((System.Windows.Controls.GridViewColumn)(target)); return; case 4: this.title = ((System.Windows.Controls.GridViewColumn)(target)); return; case 5: this.ID = ((System.Windows.Controls.GridViewColumn)(target)); return; case 6: this.TITLE = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.Content = ((System.Windows.Controls.TextBlock)(target)); return; case 8: #line 71 "..\..\View_Company.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 9: #line 80 "..\..\View_Company.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); #line default #line hidden return; } this._contentLoaded = true; }
private void splLog_Loaded(object sender, System.Windows.RoutedEventArgs e) { //<SnippetListViewView> myListView = new ListView(); //<SnippetGridViewColumn> //<SnippetGridViewAllowsColumnReorder> myGridView = new GridView(); myGridView.AllowsColumnReorder = true; myGridView.ColumnHeaderToolTip = "日志信息"; //</SnippetGridViewAllowsColumnReorder> //<SnippetGridViewColumnProperties> GridViewColumn gvc1 = new GridViewColumn(); gvc1.DisplayMemberBinding = new Binding("ucEventId"); gvc1.Header = "日志编号"; gvc1.Width = 30; //</SnippetGridViewColumnProperties> myGridView.Columns.Add(gvc1); GridViewColumn gvc2 = new GridViewColumn(); gvc2.DisplayMemberBinding = new Binding("sEventType"); gvc2.Header = "日志类型"; gvc2.Width = 100; myGridView.Columns.Add(gvc2); //<SnippetAddToColumns> GridViewColumn gvc3 = new GridViewColumn(); gvc3.DisplayMemberBinding = new Binding("ulEventTime"); gvc3.Header = "日期时间"; gvc3.Width = 120; myGridView.Columns.Add(gvc3); GridViewColumn gvc4 = new GridViewColumn(); gvc4.DisplayMemberBinding = new Binding("sEventDesc"); gvc4.Header = "日志内容"; gvc4.Width = 700; myGridView.Columns.Add(gvc4); //</SnippetAddToColumns> //</SnippetGridViewColumn> //ItemsSource is ObservableCollection of EmployeeInfo objects //myListView.ItemsSource = new myTscs(); //Thread thread = new Thread(); myListView.View = myGridView; myListView.Height = 550; // myListView. splLog.Children.Add(myListView); TscData td = (TscData)Application.Current.Properties[Define.TSC_DATA]; if (td == null) { MessageBox.Show("请选择一台信号机后,打开此界面!"); } else { myListView.ItemsSource = td.ListEventLog; } }
public void FixtureSetup() { _listView = new ListView(); _gridView = new GridView(); _listView.View = _gridView; _grid = new Grid(); _button = new Button(); _grid.Children.Add(_button); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.btnAuth = ((System.Windows.Controls.Button)(target)); #line 10 "..\..\MainWindow.xaml" this.btnAuth.Click += new System.Windows.RoutedEventHandler(this.Button_Click_Auth); #line default #line hidden return; case 2: this.btnRegist = ((System.Windows.Controls.Button)(target)); #line 11 "..\..\MainWindow.xaml" this.btnRegist.Click += new System.Windows.RoutedEventHandler(this.Button_Click_Regis); #line default #line hidden return; case 3: this.tblAuth = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.lvMobilePhone = ((System.Windows.Controls.ListView)(target)); return; case 5: this.Delete = ((System.Windows.Controls.MenuItem)(target)); #line 17 "..\..\MainWindow.xaml" this.Delete.Click += new System.Windows.RoutedEventHandler(this.Delete_Click); #line default #line hidden return; case 6: this.chartGridView = ((System.Windows.Controls.GridView)(target)); return; case 7: #line 42 "..\..\MainWindow.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; } this._contentLoaded = true; }
public Toolbox(IconSet icons) { this.defaultItemSize = new Size(GRIDITEM_WIDTH, GRIDITEM_HEIGHT); this.Width = 156; GridView gv = new GridView(); GridViewColumn gvc = new GridViewColumn(); this.icons = icons; gvc.Header = icons; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.listView1 = ((System.Windows.Controls.ListView)(target)); return; case 2: this.gridView1 = ((System.Windows.Controls.GridView)(target)); return; case 3: this.textBlock_ContactID = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.textBox_ContactID = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.textBlock_FirstName = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.textBox_FirstName = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.textBlock_LastName = ((System.Windows.Controls.TextBlock)(target)); return; case 8: this.textBox_LastName = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.textBlock_EmailAddress = ((System.Windows.Controls.TextBlock)(target)); return; case 10: this.textBox_EmailAddress = ((System.Windows.Controls.TextBox)(target)); return; case 11: this.button1 = ((System.Windows.Controls.Button)(target)); #line 40 "..\..\..\MainWindow.xaml" this.button1.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.buttonQuery = ((System.Windows.Controls.Button)(target)); #line 30 "..\..\BasicInfo.xaml" this.buttonQuery.Click += new System.Windows.RoutedEventHandler(this.btQuery); #line default #line hidden return; case 2: this.buttonExport = ((System.Windows.Controls.Button)(target)); #line 31 "..\..\BasicInfo.xaml" this.buttonExport.Click += new System.Windows.RoutedEventHandler(this.btExport); #line default #line hidden return; case 3: this.cbBaidu = ((System.Windows.Controls.CheckBox)(target)); return; case 4: this.cbAizhan = ((System.Windows.Controls.CheckBox)(target)); return; case 5: this.pbQuery = ((System.Windows.Controls.ProgressBar)(target)); return; case 6: this.txtQueryDomain = ((Xceed.Wpf.Toolkit.WatermarkTextBox)(target)); return; case 7: this.lbDigKey = ((System.Windows.Controls.ListView)(target)); #line 52 "..\..\BasicInfo.xaml" this.lbDigKey.AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new System.Windows.RoutedEventHandler(this.GridViewColumnHeader_Click)); #line default #line hidden return; case 8: this.gvKey = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.lblFirstName = ((System.Windows.Controls.TextBlock)(target)); return; case 2: this.txtFirstName = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.lblLastName = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.txtLastName = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.lblContactPerson = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.txtContactPerson = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.lblContactNo = ((System.Windows.Controls.TextBlock)(target)); return; case 8: this.txtContactNo = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.btnAddCustomer = ((System.Windows.Controls.Button)(target)); #line 22 "..\..\ObservableCollectionDemo.xaml" this.btnAddCustomer.Click += new System.Windows.RoutedEventHandler(this.btnAddCustomer_Click); #line default #line hidden return; case 10: this.lstCustomerDetails = ((System.Windows.Controls.ListView)(target)); return; case 11: this.grdCustomerDetails = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
public ListSortedSystemParameters() { Title = "List Sorted System Parameters"; // Create a ListView as content of the window. ListView lstvue = new ListView(); Content = lstvue; // Create a GridView as the View of the ListView. GridView grdvue = new GridView(); lstvue.View = grdvue; // Create two GridView columns. GridViewColumn col = new GridViewColumn(); col.Header = "Property Name"; col.Width = 200; col.DisplayMemberBinding = new Binding("Name"); grdvue.Columns.Add(col); col = new GridViewColumn(); col.Header = "Value"; col.Width = 200; grdvue.Columns.Add(col); // Create DataTemplate for second column. DataTemplate template = new DataTemplate(typeof(string)); FrameworkElementFactory factoryTextBlock = new FrameworkElementFactory(typeof(TextBlock)); factoryTextBlock.SetValue(TextBlock.HorizontalAlignmentProperty, HorizontalAlignment.Right); factoryTextBlock.SetBinding(TextBlock.TextProperty, new Binding("Value")); template.VisualTree = factoryTextBlock; col.CellTemplate = template; // Get all the system parameters in one handy array. PropertyInfo[] props = typeof(SystemParameters).GetProperties(); // Create a SortedList to hold the SystemParam objects. SortedList<string, SystemParam> sortlist = new SortedList<string, SystemParam>(); // Fill up the SortedList from the PropertyInfo array. foreach (PropertyInfo prop in props) if (prop.PropertyType != typeof(ResourceKey)) { SystemParam sysparam = new SystemParam(); sysparam.Name = prop.Name; sysparam.Value = prop.GetValue(null, null); sortlist.Add(prop.Name, sysparam); } // Set the ItemsSource property of the ListView. lstvue.ItemsSource = sortlist.Values; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 23 "..\..\..\View\MainWindowView.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.mnuExit_Click); #line default #line hidden return; case 2: this.grdEmployees = ((System.Windows.Controls.Grid)(target)); return; case 3: this.lstEmployees = ((System.Windows.Controls.ListView)(target)); return; case 4: this.gvEmployees = ((System.Windows.Controls.GridView)(target)); return; case 5: this.txtFirstName = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.txtLastName = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.txtBaseSalary = ((System.Windows.Controls.TextBox)(target)); return; case 8: this.txtDaysWorked = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.txtBonusPerDayWorked = ((System.Windows.Controls.TextBox)(target)); return; case 10: this.btnTotalSalary = ((System.Windows.Controls.Button)(target)); return; case 11: this.txtTotalSalary = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }
public List() { InitializeComponent(); CommandBinding search = new CommandBinding(BooruViewer.Views.Commands.Search); search.Executed += Search_Executed; search.CanExecute += Search_CanExecute; this.CommandBindings.Add(search); gridView = (GridView)FindResource("Grid"); tileView = (TileView)FindResource("Tile"); galeryView = (GaleryView)FindResource("Galery"); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.lblName = ((System.Windows.Controls.TextBlock)(target)); return; case 2: this.txtName = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.lblAddress = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.txtAddress = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.btnNames = ((System.Windows.Controls.Button)(target)); #line 39 "..\..\..\MainWindow.xaml" this.btnNames.Click += new System.Windows.RoutedEventHandler(this.btnNames_Click); #line default #line hidden return; case 6: this.DeleteByIdTextBox = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.DeleteBtn = ((System.Windows.Controls.Button)(target)); #line 51 "..\..\..\MainWindow.xaml" this.DeleteBtn.Click += new System.Windows.RoutedEventHandler(this.DeleteBtn_Click); #line default #line hidden return; case 8: this.lstNames = ((System.Windows.Controls.ListView)(target)); return; case 9: this.grdNames = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
public MainWindow_old() { //CurrentAction = new DTAction(); //CurrentCondition = new DTCondition(); //CurrentState = new DTState(); //DecisionTableViewModel = new DecisionTableViewModel(); TableView = new GridView(); InitializeComponent(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.uxUpsRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 2: this.uxUspsRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 3: this.uxFedExRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 4: this.uxTrackingTxt = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.uxGetInfo = ((System.Windows.Controls.Button)(target)); #line 22 "..\..\MainWindow.xaml" this.uxGetInfo.Click += new System.Windows.RoutedEventHandler(this.uxGetInfo_Click); #line default #line hidden return; case 6: this.uxAddPackage = ((System.Windows.Controls.Button)(target)); #line 23 "..\..\MainWindow.xaml" this.uxAddPackage.Click += new System.Windows.RoutedEventHandler(this.uxAddPackage_Click); #line default #line hidden return; case 7: this.uxEventList = ((System.Windows.Controls.ListView)(target)); return; case 8: this.uxShipmentList = ((System.Windows.Controls.ListView)(target)); return; case 9: this.uxGridView = ((System.Windows.Controls.GridView)(target)); return; } this._contentLoaded = true; }
public override void Load(NetworkLogViewerBase viewer) { if (m_viewer != null) throw new InvalidOperationException(); m_viewer = viewer; viewer.ItemVisualDataQueried += m_itemVisualDataQueriedHandler; var view = m_view = new GridView(); var nColumns = s_columnWidths.Length; var headers = new string[] { NetworkStrings.CH_Number, NetworkStrings.CH_Time, NetworkStrings.CH_Ticks, NetworkStrings.CH_C2S, NetworkStrings.CH_S2C, NetworkStrings.CH_Length, }; if (headers.Length != nColumns) throw new InvalidOperationException(); double[] widths = Configuration.GetValue("Column Widths", (double[])null); if (widths == null || widths.Length != nColumns) widths = s_columnWidths; int[] columnOrder = Configuration.GetValue("Column Order", (int[])null); if (columnOrder == null || columnOrder.Length != nColumns || columnOrder.Any(val => val >= nColumns || val < 0)) columnOrder = Enumerable.Range(0, nColumns).ToArray(); for (int i = 0; i < nColumns; i++) { int col = columnOrder[i]; var item = new GridViewColumnWithId(); item.ColumnId = col; item.Header = headers[col]; item.Width = widths[col]; var dataTemplate = new DataTemplate(); dataTemplate.DataType = typeof(ItemVisualData); var block = new FrameworkElementFactory(typeof(TextBlock)); block.SetValue(TextBlock.TextProperty, new Binding(s_columnBindings[col])); dataTemplate.VisualTree = block; item.CellTemplate = dataTemplate; view.Columns.Add(item); } }
public void Initialize() { GridView gridView = new GridView(); GridViewColumn column = new GridViewColumn(); if (IsPartRetryPage == true) { column = new GridViewColumn(); column.Header = "PART NAME"; column.Width = double.NaN; column.DisplayMemberBinding = new System.Windows.Data.Binding("PartName"); gridView.Columns.Add(column); } column = new GridViewColumn(); column.Header = "NAME"; column.Width = double.NaN; if (IsPartRetryPage == true) column.DisplayMemberBinding = new System.Windows.Data.Binding("RetryInfo.Name"); else column.DisplayMemberBinding = new System.Windows.Data.Binding("Name"); gridView.Columns.Add(column); column = new GridViewColumn(); column.Header = "LIMIT COUNT"; column.Width = double.NaN; if (IsPartRetryPage == true) column.CellTemplate = CreateTextBoxTemplate("RetryInfo.RetryLimit"); else column.CellTemplate = CreateTextBoxTemplate("RetryLimit"); gridView.Columns.Add(column); column = new GridViewColumn(); column.Header = "DESCRIPTION"; column.Width = double.NaN; if (IsPartRetryPage == true) column.CellTemplate = CreateTextBoxTemplate("RetryInfo.Description"); else column.CellTemplate = CreateTextBoxTemplate("Description"); gridView.Columns.Add(column); listView1.View = gridView; listView1.ItemsSource = RetryInfoList; Style style = new Style(); style.TargetType = typeof(ListViewItem); Setter setter = new Setter(); setter.Property = ListViewItem.HorizontalContentAlignmentProperty; setter.Value = HorizontalAlignment.Stretch; style.Setters.Add(setter); listView1.ItemContainerStyle = style; }
public void Initialize() { GridView gridView = new GridView(); GridViewColumn column = null; column = new GridViewColumn(); column.Header = " LineInfo "; column.Width = double.NaN; System.Windows.DataTemplate template = new System.Windows.DataTemplate(); System.Windows.FrameworkElementFactory textBox = new System.Windows.FrameworkElementFactory(typeof(TextBox)); Binding bd = new Binding("Line"); bd.Mode = BindingMode.TwoWay; textBox.SetValue(TextBox.IsEnabledProperty, true); textBox.SetBinding(TextBox.TextProperty, bd); template.VisualTree = textBox; column.CellTemplate = template; gridView.Columns.Add(column); column = new GridViewColumn(); column.Header = " OutLineConveyor "; column.Width = double.NaN; template = new System.Windows.DataTemplate(); System.Windows.FrameworkElementFactory comboBox = new System.Windows.FrameworkElementFactory(typeof(ComboBox)); bd = new Binding("LineConveyor"); bd.Mode = BindingMode.TwoWay; comboBox.SetValue(ComboBox.IsEnabledProperty, true); comboBox.SetValue(ComboBox.ItemsSourceProperty, Enum.GetNames(typeof(OutLineConveyor))); comboBox.SetBinding(ComboBox.TextProperty, bd); template.VisualTree = comboBox; column.CellTemplate = template; gridView.Columns.Add(column); column = new GridViewColumn(); column.Header = " LotCardPrinting "; column.Width = (double.NaN); template = new System.Windows.DataTemplate(); System.Windows.FrameworkElementFactory comboBoxPrinting = new System.Windows.FrameworkElementFactory(typeof(ComboBox)); bd = new Binding("LotCardPrint"); bd.Mode = BindingMode.TwoWay; comboBoxPrinting.SetValue(ComboBox.IsEnabledProperty, true); comboBoxPrinting.SetValue(ComboBox.ItemsSourceProperty, Enum.GetNames(typeof(LotCardPrinting))); comboBoxPrinting.SetBinding(ComboBox.TextProperty, bd); template.VisualTree = comboBoxPrinting; column.CellTemplate = template; gridView.Columns.Add(column); UIUtility.SetListViewContentAlignmentStrech(listViewStepList); listViewStepList.View = gridView; listViewStepList.ItemsSource = Equipment.EquipmentManager.Instance.MainEquip.Config.OutLineSelectInfo; }
/// public GridViewAutomationPeer(GridView owner, ListView listview) : base() { Invariant.Assert(owner != null); Invariant.Assert(listview != null); _owner = owner; _listview = listview; //Remember the items/columns count when GVAP is created, this is used for firing RowCount/ColumnCount changed event _oldItemsCount = _listview.Items.Count; _oldColumnsCount = _owner.Columns.Count; ((INotifyCollectionChanged)_owner.Columns).CollectionChanged += new NotifyCollectionChangedEventHandler(OnColumnCollectionChanged); }
private static void OnMatrixSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ObservableCollection<FieldViewModel> headers = e.NewValue as ObservableCollection<FieldViewModel>; ListView listView = d as ListView; //listView.ItemsSource = dataMatrix; _gridView = listView.View as GridView; if (_gridView == null) listView.View = _gridView = new GridView(); RefreshUI(headers); }
public DirectoryController(ListView listView, GridView gridView) { ListView = listView; GridView = gridView; // create builtin bindings ListView.MouseDoubleClick += ListView_MouseDoubleClick; ListView.SelectionChanged += ListView_SelectionChanged; ListView.PreviewMouseWheel += ListView_PreviewMouseWheel; ListView.KeyDown += ListView_KeyDown; // set data sources ListView.ItemsSource = Items; }