public void FillControlWithData(long nRowIndex, int nColIndex, IGridEmbeddedControl control) { GridDataRow row = this.mData[(int)nRowIndex]; switch (nColIndex) { case 2: { EmbeddedTextBox textBox = control as EmbeddedTextBox; textBox.Text = row.Text; } break; case 3: { EmbeddedComboBox comboBox = control as EmbeddedComboBox; for (int i = 0; i < (int)this.NumRows(); i++) { comboBox.AddDataAsString(string.Format("Dropdown: {0}", i)); } comboBox.Text = row.DropDownText; } break; case 4: { EmbeddedComboBox comboBox = control as EmbeddedComboBox; for (int i = 0; i < (int)this.NumRows(); i++) { comboBox.AddDataAsString(string.Format("DropDownList: {0}", i)); } comboBox.SelectedItem = row.DropDownListText; } break; case 5: { EmbeddedSpinBox spinBox = control as EmbeddedSpinBox; spinBox.Value = row.SpinValue; } break; default: break; } }
public bool SetCellDataFromControl(long nRowIndex, int nColIndex, IGridEmbeddedControl control) { switch (nColIndex) { case 2: { EmbeddedTextBox textBox = control as EmbeddedTextBox; this.mData[(int)nRowIndex].Text = textBox.Text; } return(true); case 3: { EmbeddedComboBox comboBox = control as EmbeddedComboBox; this.mData[(int)nRowIndex].DropDownText = comboBox.Text; } return(true); case 4: { EmbeddedComboBox comboBox = control as EmbeddedComboBox; this.mData[(int)nRowIndex].DropDownListText = comboBox.SelectedItem.ToString(); } return(true); case 5: { EmbeddedSpinBox spinBox = control as EmbeddedSpinBox; this.mData[(int)nRowIndex].SpinValue = (int)spinBox.Value; } return(true); default: break; } return(false); }
public bool SetCellDataFromControl(long nRowIndex, int nColIndex, IGridEmbeddedControl control) { // when a cell has changed, you're supposed to change your data here return(true); }
public void FillControlWithData(long nRowIndex, int nColIndex, IGridEmbeddedControl control) { // for cell edition control.SetCurSelectionAsString(GetCellDataAsString(nRowIndex, nColIndex)); }