您好,写了个简单的例子,点击一下按钮,把TextBox的HighLightText属性修改。
- this._gcMultiRow.Template = Template.CreateGridTemplate(new List<Cell>()
- {
- new TextBoxCell(),
- });
- this.Controls.Add(this._gcMultiRow);
- var button = new Button();
- button.Location = new Point(300, 300);
- this.Controls.Add(button);
- button.Click += (s, e) =>
- {
- var textBoxCell = this._gcMultiRow.Template.Row.Cells[0] as TextBoxCell;
- textBoxCell.HighlightText = true;
- this._gcMultiRow.Template = this._gcMultiRow.Template;
- };
复制代码
|