I'm not sure I quite understand how the extension of GridTextColumnEditor goes, say I have extended the class like this:
But the field still gets updated with the value entered in the textBox, instead of "salmon". Why is this? I want to implement a custom editor which consists of two TextBoxes, which contain the cell value splitted by the first whitespace character, and it returns the the value combined from the two TextBoxes.
public class CustomEditor : GridTextColumnEditor |
| { |
| private TextBox textBox; |
| protected override void LoadControlsFromContainer() |
| { |
| this.textBox = this.ContainerControl.Controls[0] as TextBox; |
| } |
| public override bool IsInitialized |
| { |
| get |
| { |
| return this.textBox != null; |
| } |
| } |
| public override string Text |
| { |
| get |
| { |
| return "salmon"; |
| } |
| set |
| { |
| this.textBox.Text = value; |
| } |
| } |
| protected override void AddControlsToContainer() |
| { |
| this.textBox = new TextBox(); |
| this.ContainerControl.Controls.Add(this.textBox); |
| } |
| } |