Browsercoumn

Dec 5 2014 6:56 AM

Hi,when I write this code for browsercoumn get error

public class CustomRadTextBoxEditor : RadTextBoxEditor

{

public CustomRadTextBoxEditor()

{

RadButtonElement button = new RadButtonElement();

button.Click += new EventHandler(button_Click);

button.Padding = new Padding(2, 0, 2, -2);

button.Margin = new Padding(0, 0, 0, 0);

button.Text = "...";

StackLayoutElement stackPanel = new StackLayoutElement();

stackPanel.Orientation = Orientation.Horizontal;

stackPanel.Margin = new Padding(1, 0, 1, 0);

stackPanel.Children.Add(button);

RadTextBoxEditorElement tbElement = this.EditorElement as RadTextBoxEditorElement;

RadTextBoxItem tbItem = tbElement.TextBoxItem;

tbElement.Children.Remove(tbItem);

DockLayoutPanel dockPanel = new DockLayoutPanel();

dockPanel.Children.Add(stackPanel);

dockPanel.Children.Add(tbItem);

DockLayoutPanel.SetDock(tbItem, Telerik.WinControls.Layouts.Dock.Left);

DockLayoutPanel.SetDock(stackPanel, Telerik.WinControls.Layouts.Dock.Right);

tbElement.Children.Add(dockPanel);

}

private void button_Click(object sender, EventArgs e)

{

RadMessageBox.Show("Open your custom dialog");

}

}

void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)

{

if (radGridView1.CurrentColumn.Name == "Column1")

{

e.EditorType = typeof(CustomRadTextBoxEditor);

}

}