Commit 01be57fe authored by tr's avatar tr

1、表开发工具:增加类型录入自动提示

parent 51d7ec15
......@@ -124,6 +124,7 @@ namespace Tools.UI
this.dgvData.DataSource = this._ds.Tables[infoTable];
this.dgvData.KeyUp += DgvData_KeyUp;
this.dgvData.CellValueChanged += DgvData_CellValueChanged;
this.dgvData.EditingControlShowing += DgvData_EditingControlShowing;
//工具栏-事件
this.tsmiExportModel.Click += TsmiExportModel_Click;
this.tsmiExportSql.Click += TsmiExportSql_Click;
......@@ -175,6 +176,28 @@ namespace Tools.UI
{
}
private void DgvData_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
var fieldName = this.dgvData.Columns[this.dgvData.CurrentCell.ColumnIndex].DataPropertyName;
if (fieldName.Equals("ColumnType"))
{
TextBox tb = e.Control as TextBox;
if (tb != null)
{
tb.AutoCompleteMode = AutoCompleteMode.Suggest;
tb.AutoCompleteSource = AutoCompleteSource.CustomSource;
var AutoItems = new AutoCompleteStringCollection()
{
"INT", "BIT", "IMAGE", "DATETIME",
"DECIMAL(18,2)",
"VARCHAR(50)", "VARCHAR(MAX)",
"NVARCHAR(50)", "NVARCHAR(MAX)",
"UNIQUEIDENTIFIER"
};
tb.AutoCompleteCustomSource = AutoItems;
}
}
}
#endregion
#region 工具栏-事件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment