hi all,
i am new.. pls suggest how can i trap toolbar click event..
and how can i know which toll was selected.
i createed a event...
protected void WebHtmlEditor1_ToolbarClick(object sender, Infragistics.WebUI.WebHtmlEditor.ToolbarEventArgs e){ pls if button == "save" do some process...}
with best regards..kartikeya
Hi Kartikeya,
The ToolbarClick event is raised only for ToolbarButton which has enabled RaisePostback property. By default only Save button has that property enabled. However, application can enable that property for any button. Below example shows how to process that event.
protected void WebHtmlEditor1_ToolbarClick(object sender, ToolbarEventArgs e){ ToolbarButton but = e.Item as ToolbarButton; ToolbarButtonType type = but.Type; string key = but.Key; string act = but.Act;}
Thanks Sir..
May i change location of button and change Button size?
Toolbar buttons are items in Toolbar.Items collection. That collection as any other similar collection in dot-net supports removing, adding, moving items. You can do that at visual design and at run time as well.Toolbar items have properties Width and Height, so, you may increase Width and make button larger. Below example changes Width of item Bold and moves Italic in front of Save.
protected void Page_Load(object sender, System.EventArgs e){ if(this.IsPostBack) return; BaseChildControl bold = this.WebHtmlEditor1.FindByKeyOrAction("Bold"); bold.Width = Unit.Pixel(100); ToolbarButton italic = this.WebHtmlEditor1.FindByKeyOrAction("Italic") as ToolbarButton; this.WebHtmlEditor1.Toolbar.Items.Remove(italic); BaseChildControl save = this.WebHtmlEditor1.FindByKeyOrAction("Save"); int index = this.WebHtmlEditor1.Toolbar.Items.IndexOf(save); this.WebHtmlEditor1.Toolbar.Items.Insert(index, italic);}
Thanks sir... :-)