private void InitializeSourceGrid() { this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("Comment", "參數", typeof(string)); this.dataGrid.Columns.Add("Value", "數值", typeof(string)); this.dataGrid.Columns[0].Width = 180; this.dataGrid.Columns[0].DataCell.Model.AddModel(new BoundImage()); this.dataGrid.Columns[0].DataCell.Editor.EnableEdit = false; this.dataGrid.Columns[1].Width = 175; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); //建立必要的 Editor 控制項 __cTextBox = this.dataGrid.Columns[1].DataCell.Editor; //保存原始 Editor 控制像 __cTextBox.NullString = null; __cComboBox = new SourceGrid.Cells.Editors.ComboBox(typeof(string), __sBooleans, true); __cComboBox.AllowNull = false; //建立資料來源 source = new Data.SimpleBoundList <Data._ParameterInfo>(64); source.AllowEdit = true; this.dataGrid.DataSource = source; }
private void InitializeSourceGrid_Trust() { __cTextAlignView = new SourceGrid.Cells.Views.Cell(); __cTextAlignView.TextAlignment = DevAge.Drawing.ContentAlignment.TopRight; this.dataGrid_Trust.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid_Trust.Columns.Add("Ticket", "序號", typeof(string)); this.dataGrid_Trust.Columns.Add("Category", "委託別", typeof(string)); this.dataGrid_Trust.Columns.Add("SymbolId", "商品代號", typeof(string)); this.dataGrid_Trust.Columns.Add("Action", "買/賣", typeof(string)); this.dataGrid_Trust.Columns.Add("Contracts", "數量", typeof(int)); this.dataGrid_Trust.Columns.Add("Price", "價格", typeof(double)); this.dataGrid_Trust.Columns.Add("Time", "時間", typeof(string)); this.dataGrid_Trust.Columns.Add("Comment", "描述", typeof(string)); this.dataGrid_Trust.Columns[0].Width = 60; this.dataGrid_Trust.Columns[1].Width = 60; this.dataGrid_Trust.Columns[2].Width = 80; this.dataGrid_Trust.Columns[3].Width = 70; this.dataGrid_Trust.Columns[4].Width = 60; this.dataGrid_Trust.Columns[4].DataCell.View = __cTextAlignView; this.dataGrid_Trust.Columns[5].Width = 60; this.dataGrid_Trust.Columns[5].DataCell.View = __cTextAlignView; this.dataGrid_Trust.Columns[6].Width = 110; this.dataGrid_Trust.Columns[7].Width = 200; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid_Trust.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); this.dataGrid_Trust.DataSource = __cTradeService.Trusts; }
private void InitializeSourceGrid() { SourceGrid.Cells.Views.IView cTextAlignView = new SourceGrid.Cells.Views.Cell(); cTextAlignView.TextAlignment = DevAge.Drawing.ContentAlignment.TopRight; this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("SymbolId", "代號", typeof(string)); this.dataGrid.Columns.Add("SymbolName", "名稱", typeof(string)); this.dataGrid.Columns.Add("Time", "時間", typeof(System.TimeSpan)); this.dataGrid.Columns.Add("Price", "成交", typeof(double)); this.dataGrid.Columns.Add("Volume", "總量", typeof(double)); this.dataGrid.Columns[0].Width = 56; this.dataGrid.Columns[1].Width = 56; this.dataGrid.Columns[2].Width = 55; this.dataGrid.Columns[3].DataCell.View = cTextAlignView; this.dataGrid.Columns[4].DataCell.View = cTextAlignView; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); source = new Data.PrimaryBoundList <string, Data._QuoteInfo>(256); source.SetFunctionForGetPrimary((quote) => { return(quote.SymbolId); }); this.dataGrid.DataSource = source; }
private void InitializeSourceGrid() { SourceGrid.Cells.Views.IView cTextAlignView = new SourceGrid.Cells.Views.Cell(); cTextAlignView.TextAlignment = DevAge.Drawing.ContentAlignment.TopRight; this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("BidSize", "委買量", typeof(double)); this.dataGrid.Columns.Add("BidPrice", "委買價", typeof(double)); this.dataGrid.Columns.Add("AskPrice", "委賣價", typeof(double)); this.dataGrid.Columns.Add("AskSize", "委賣量", typeof(double)); this.dataGrid.Columns[0].Width = 60; this.dataGrid.Columns[0].DataCell.View = cTextAlignView; this.dataGrid.Columns[1].Width = 60; this.dataGrid.Columns[1].DataCell.View = cTextAlignView; this.dataGrid.Columns[2].Width = 60; this.dataGrid.Columns[2].DataCell.View = cTextAlignView; this.dataGrid.Columns[3].Width = 60; this.dataGrid.Columns[3].DataCell.View = cTextAlignView; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); source = new Data.SimpleBoundList <Data._DOMInfo>(16); this.dataGrid.DataSource = source; }
private void _grid_Selection_CellGotFocus(SourceGrid.Selection.SelectionBase sender, SourceGrid.ChangeActivePositionEventArgs e) { try { } catch (Exception error) { ExceptionDialog.Show(this, error); } }
protected override SourceGrid.Selection.SelectionBase CreateSelectionObject() { SourceGrid.Selection.SelectionBase selObj = base.CreateSelectionObject(); selObj.EnableMultiSelection = false; selObj.FocusStyle = SourceGrid.FocusStyle.RemoveFocusCellOnLeave; selObj.FocusRowLeaving += new RowCancelEventHandler(Selection_FocusRowLeaving); return(selObj); }
private void InitializeSourceGrid_Log() { this.dataGrid_Log.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid_Log.Columns.Add("LogTime", "時間", typeof(string)); this.dataGrid_Log.Columns.Add("Level", "層級", typeof(string)); this.dataGrid_Log.Columns.Add("Message", "訊息", typeof(string)); this.dataGrid_Log.Columns[0].Width = 120; this.dataGrid_Log.Columns[1].Width = 50; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid_Log.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); __cLogService = new Services.LogService(); this.dataGrid_Log.DataSource = __cLogService.Logs; }
private void InitializeGridSession() { this.gridSession.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.gridSession.Columns.Add("StartDay", "開盤日", typeof(System.DayOfWeek)); this.gridSession.Columns.Add("StartTime", "開盤時間", typeof(System.TimeSpan)); this.gridSession.Columns.Add("EndDay", "收盤日", typeof(System.DayOfWeek)); this.gridSession.Columns.Add("EndTime", "收盤時間", typeof(System.TimeSpan)); this.gridSession.Columns[0].Width = 75; this.gridSession.Columns[1].Width = 71; this.gridSession.Columns[2].Width = 75; this.gridSession.Columns[3].Width = 71; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.gridSession.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); this.gridSession.Selection.SelectionChanged += gridSession_onSelectionChanged; }
protected void Selection_SelectionChanged(object sender, SourceGrid.RangeRegionChangedEventArgs e) { int selectedRow = -1; if (sender is SourceGrid.Selection.SelectionBase) { SourceGrid.Selection.SelectionBase sel = (sender as SourceGrid.Selection.SelectionBase); selectedRow = (sender as SourceGrid.Selection.SelectionBase).ActivePosition.Row; } if (selectedRow < 0) { return; } RefreshPropertyGrid(selectedRow); }
private void InitializeSourceGrid_Trade() { this.dataGrid_Trade.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid_Trade.Columns.Add("Ticket", "序號", typeof(string)); this.dataGrid_Trade.Columns.Add("Category", "委託別", typeof(string)); this.dataGrid_Trade.Columns.Add("SymbolId", "商品代號", typeof(string)); this.dataGrid_Trade.Columns.Add("Action", "買/賣", typeof(string)); this.dataGrid_Trade.Columns.Add("Contracts", "數量", typeof(int)); this.dataGrid_Trade.Columns.Add("Price", "價格", typeof(double)); this.dataGrid_Trade.Columns.Add("Profit", "損益", typeof(double)); this.dataGrid_Trade.Columns.Add("Fee", "手續費", typeof(double)); this.dataGrid_Trade.Columns.Add("Tax", "交易稅", typeof(double)); this.dataGrid_Trade.Columns.Add("Time", "時間", typeof(string)); this.dataGrid_Trade.Columns.Add("Comment", "描述", typeof(string)); this.dataGrid_Trade.Columns[0].Width = 60; this.dataGrid_Trade.Columns[1].Width = 60; this.dataGrid_Trade.Columns[2].Width = 80; this.dataGrid_Trade.Columns[3].Width = 70; this.dataGrid_Trade.Columns[4].Width = 60; this.dataGrid_Trade.Columns[4].DataCell.View = __cTextAlignView; this.dataGrid_Trade.Columns[5].Width = 60; this.dataGrid_Trade.Columns[5].DataCell.View = __cTextAlignView; this.dataGrid_Trade.Columns[6].Width = 80; this.dataGrid_Trade.Columns[6].DataCell.View = __cTextAlignView; this.dataGrid_Trade.Columns[7].Width = 70; this.dataGrid_Trade.Columns[7].DataCell.View = __cTextAlignView; this.dataGrid_Trade.Columns[8].Width = 70; this.dataGrid_Trade.Columns[8].DataCell.View = __cTextAlignView; this.dataGrid_Trade.Columns[9].Width = 110; this.dataGrid_Trade.Columns[10].Width = 200; //設定總計欄位合併(沒有使用的欄位直接合併, 有使用的欄位不需合併) this.dataGrid_Trade.Summation(4, 1, 1, 1, 1, 1, 2); //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid_Trade.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); this.dataGrid_Trade.DataSource = __cTradeService.Opens; }
private void InitializeGridCaution() { SourceGrid.Cells.Views.IView cTextAlignView = new SourceGrid.Cells.Views.Cell(); cTextAlignView.TextAlignment = DevAge.Drawing.ContentAlignment.TopRight; this.gridCaution.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.gridCaution.Columns.Add("Description", "描述", typeof(string)); this.gridCaution.Columns.Add("InitialMoney", "初始保證金", typeof(double)); this.gridCaution.Columns.Add("KeepMoney", "維持保證金", typeof(double)); this.gridCaution.Columns.Add("CloseMoney", "結算保證金", typeof(double)); this.gridCaution.Columns[0].Width = 70; this.gridCaution.Columns[1].Width = 75; this.gridCaution.Columns[1].DataCell.View = cTextAlignView; this.gridCaution.Columns[2].Width = 75; this.gridCaution.Columns[2].DataCell.View = cTextAlignView; this.gridCaution.Columns[3].Width = 75; this.gridCaution.Columns[3].DataCell.View = cTextAlignView; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.gridCaution.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); }
private void InitializeSourceGrid() { this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("ModuleName", "交易元件", typeof(string)); this.dataGrid.Columns.Add("FileVersion", "檔案版本", typeof(string)); this.dataGrid.Columns.Add("ProductVersion", "元件版本", typeof(string)); this.dataGrid.Columns.Add("Description", "說明", typeof(string)); this.dataGrid.Columns.Add("Company", "開發廠商", typeof(string)); this.dataGrid.Columns[0].Width = 150; this.dataGrid.Columns[1].Width = 70; this.dataGrid.Columns[2].Width = 70; this.dataGrid.Columns[3].Width = 200; this.dataGrid.Columns[4].Width = 200; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); this.dataGrid.Selection.SelectionChanged += dataGrid_onSelectionChanged; source = new Data.SimpleBoundList <Informations.OrderServiceInformation>(64); this.dataGrid.DataSource = source; }
private void InitializeSourceGrid() { this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("ProductId", "商品", typeof(string)); this.dataGrid.Columns.Add("Description", "說明", typeof(string)); this.dataGrid.Columns.Add("ExchangeName", "交易所", typeof(string)); this.dataGrid.Columns[0].Width = 100; this.dataGrid.Columns[1].Width = 155; this.dataGrid.Columns[2].Width = 80; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); //建立資料來源 Data.SimpleBoundList < Data._ProductInfo > cList = new Data.SimpleBoundList<Data._ProductInfo>(4096); cList.AllowSort = true; cList.SetComparers(__cComparison); __cSources = new System.Collections.Generic.List<Data.SimpleBoundList<Data._ProductInfo>>(32); __cSources.Add(cList); this.dataGrid.DataSource = cList; __cCurrentPages = this.pageItem_All; }
private void InitializeSourceGrid() { SourceGrid.Cells.Views.IView cTextAlignView = new SourceGrid.Cells.Views.Cell(); cTextAlignView.TextAlignment = DevAge.Drawing.ContentAlignment.TopRight; this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("Enabled", "啟用", typeof(bool)); this.dataGrid.Columns.Add("Name", "報價元件", typeof(string)); this.dataGrid.Columns.Add("FileVersion", "檔案版本", typeof(string)); this.dataGrid.Columns.Add("ProductVersion", "元件版本", typeof(string)); this.dataGrid.Columns.Add("Company", "開發廠商", typeof(string)); this.dataGrid.Columns.Add("DataSource", "資料來源名稱", typeof(string)); this.dataGrid.Columns.Add("LogonId", "登入帳號", typeof(string)); this.dataGrid.Columns.Add("PacketCountPerSeconds", "傳輸速率", typeof(string)); this.dataGrid.Columns.Add("PacketCount", "封包個數", typeof(string)); this.dataGrid.Columns[0].Width = 40; this.dataGrid.Columns[0].DataCell.Controller.RemoveController(SourceGrid.Cells.Controllers.CheckBox.Default); //因為沒有編輯功能(取消對 Checkbox 的 Click 功能) this.dataGrid.Columns[1].Width = 150; this.dataGrid.Columns[2].Width = 70; this.dataGrid.Columns[3].Width = 70; this.dataGrid.Columns[4].Width = 200; this.dataGrid.Columns[5].Width = 150; this.dataGrid.Columns[6].Width = 100; this.dataGrid.Columns[7].Width = 90; this.dataGrid.Columns[7].DataCell.View = cTextAlignView; this.dataGrid.Columns[8].Width = 90; this.dataGrid.Columns[8].DataCell.View = cTextAlignView; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); this.dataGrid.Selection.SelectionChanged += dataGrid_onSelectionChanged; source = new Data.SimpleBoundList <Zeghs.Data._QuoteServiceInfo>(64); this.dataGrid.DataSource = source; }
private void InitializeSourceGrid() { this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("DataStream", "Data #", typeof(string)); this.dataGrid.Columns.Add("SymbolId", "商品代號", typeof(string)); this.dataGrid.Columns.Add("Range", "區間", typeof(string)); this.dataGrid.Columns.Add("LastDate", "終止日", typeof(string)); this.dataGrid.Columns.Add("Period", "週期", typeof(string)); this.dataGrid.Columns.Add("SubChart", "副圖", typeof(string)); this.dataGrid.Columns[0].Width = 60; this.dataGrid.Columns[1].Width = 100; this.dataGrid.Columns[2].Width = 90; this.dataGrid.Columns[3].Width = 90; this.dataGrid.Columns[4].Width = 90; this.dataGrid.Columns[5].Width = 80; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); //建立資料來源 source = new Data.SimpleBoundList <Data._DataStreamInfo>(32); this.dataGrid.DataSource = source; }
private void InitializeSourceGrid() { this.dataGrid.Rows.RowHeight = 21; //處理第一列中文字體會被遮住的問題 this.dataGrid.Columns.Add("ProductId", "商品代號", typeof(string)); this.dataGrid.Columns.Add("CommodityId", "商品來源", typeof(string)); this.dataGrid.Columns.Add("ProductName", "商品名稱", typeof(string)); this.dataGrid.Columns.Add("DataSource", "資料來源", typeof(string)); this.dataGrid.Columns.Add("Description", "商品描述", typeof(string)); this.dataGrid.Columns[0].Width = 100; this.dataGrid.Columns[1].Width = 100; this.dataGrid.Columns[2].Width = 70; this.dataGrid.Columns[3].Width = 90; this.dataGrid.Columns[4].Width = 190; //修改選擇條的框線寬度與顏色 SourceGrid.Selection.SelectionBase cSelectionBase = this.dataGrid.Selection as SourceGrid.Selection.SelectionBase; cSelectionBase.Border = new DevAge.Drawing.RectangleBorder(new DevAge.Drawing.BorderLine(cSelectionBase.BackColor, 1)); source = new Data.SimpleBoundList <Data._ProductInfo>(__cAllData); source.AllowSort = true; source.SetComparers(__cComparison); this.dataGrid.DataSource = source; }