/// <summary> /// Called when the edit text changes. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void TbxTextChanged(object sender, EventArgs e) { // Reflect the change in the toolbar textbox GridTextBoxXEditControl tbx = sender as GridTextBoxXEditControl; if (tbx != null) { TbxCellText.Text = tbx.Text; } }
/// <summary> /// This routine is called when a cell edit is about to end. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void SuperGridControl1EndEdit(object sender, GridEditEventArgs e) { // Unhook the TextChanged listener. GridTextBoxXEditControl tbx = e.EditControl as GridTextBoxXEditControl; if (tbx != null) { tbx.TextChanged -= TbxTextChanged; } }
/// <summary> /// This routine is called when an edit is about to begin. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void SuperGridControl1BeginEdit(object sender, GridEditEventArgs e) { // Hook the TextChanged event so that we can reflect the // pre-cell contents in the toolbar textbox. GridTextBoxXEditControl tbx = e.EditControl as GridTextBoxXEditControl; if (tbx != null) { tbx.TextChanged += TbxTextChanged; } }
private void Frm_Module_List_Load(object sender, EventArgs e) { superGridControl1.PrimaryGrid.AutoGenerateColumns = false; superGridControl2.PrimaryGrid.AutoGenerateColumns = false; //01查看 02增加 03修改 04删除 btnAdd.Visible = queuerDAO.CheckPower(this.GetType().ToString(), "02", SelfVars.LoginUser); GridTextBoxXEditControl clmDelete = superGridControl1.PrimaryGrid.Columns["clmEdit"].EditControl as GridTextBoxXEditControl; clmDelete.Visible = queuerDAO.CheckPower(this.GetType().ToString(), "04", SelfVars.LoginUser); btnInsertRes.Visible = queuerDAO.CheckPower(this.GetType().ToString(), "02", SelfVars.LoginUser); GridTextBoxXEditControl clmDeleteRes = superGridControl2.PrimaryGrid.Columns["clmEdit"].EditControl as GridTextBoxXEditControl; clmDeleteRes.Visible = queuerDAO.CheckPower(this.GetType().ToString(), "04", SelfVars.LoginUser); btnSearch_Click(null, null); }