Can I align the button the the left and place some text on the button i.e. a +/- charcter
You have to hook the EditorButtonClick event of the UltraTextEditor control.
Found this post searching here for the exact same situation. How do you handle the event for the button click?
I also tried adding the event in code in the init layout event right after your code above.
edButton.Click += new EditorButtonEventHandler(edButton_Click);then added: void edButton_Click(object sender, EditorButtonEventArgs e) { MessageBox.Show("HERE I AM");}and that didn't work either.Any Ideas?Thanks
Hi,
It is not possible to set the text on the button or align it to the left when you set the Style property of the column to EditButton. The easy work around for it is
- create a UltraTextEditor
- Add editor buttons to its ButtonsLeft collection.
- You may add any text to the editor buttons.
- Assign the ultraTextEditor to the EditorComponent of the column.
To do so you may use the following code
[code]
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
UltraTextEditor editor = new UltraTextEditor();
EditorButton edButton = new EditorButton();
edButton.Text = "+";
editor.ButtonsLeft.Add(edButton);
e.Layout.Bands[0].Columns[0].EditorComponent = editor;
}
[/code]
Thanks
Vaibhav