Hi
I create a RadGrid and a RadButton by code.
The RadButton is deactivating my RadGrid:
this.editButton = new RadButton();
this.editButton.Visible = false;
this.editButton.AutoPostBack = true;
this.editButton.Click += EditButtonOnClick;
private void EditButtonOnClick(object sender, EventArgs eventArgs) {
this.DataGrid.Enabled = false;
this.DataGrid.ClientSettings.EnablePostBackOnRowClick = false;
this.DataGrid.ClientSettings.Resizing.AllowColumnResize = false;
this.DataGrid.ClientSettings.Selecting.AllowRowSelect = false;
this.DataGrid.ClientSettings.AllowKeyboardNavigation = false;
}
This is working great.
But now, I have also to deactivate the RadGrid at doubleclick on a row. For this, I have created a javascript for OnRowDblClick for the RadGrid:
var script = @"
function RowDblClick(sender, eventArgs) {
$find(""" + editButton.ClientID + @""").click();
}";
var javaScript = new HtmlGenericControl("script");
javaScript.Attributes["type"] = "text/javascript";
javaScript.InnerHtml = script;
Controls.Add(javaScript);
this.DataGrid.ClientSettings.ClientEvents.OnRowDblClick = "RowDblClick";
The RowDblClick will be executed on DoubleClick - I have checked this with a alert(). But the Click-Eventhandler of the EditButton on the Serverside will not be executed. Can someone help me please how I can do this? - Thanks.
Thomas
I create a RadGrid and a RadButton by code.
The RadButton is deactivating my RadGrid:
this.editButton = new RadButton();
this.editButton.Visible = false;
this.editButton.AutoPostBack = true;
this.editButton.Click += EditButtonOnClick;
private void EditButtonOnClick(object sender, EventArgs eventArgs) {
this.DataGrid.Enabled = false;
this.DataGrid.ClientSettings.EnablePostBackOnRowClick = false;
this.DataGrid.ClientSettings.Resizing.AllowColumnResize = false;
this.DataGrid.ClientSettings.Selecting.AllowRowSelect = false;
this.DataGrid.ClientSettings.AllowKeyboardNavigation = false;
}
This is working great.
But now, I have also to deactivate the RadGrid at doubleclick on a row. For this, I have created a javascript for OnRowDblClick for the RadGrid:
var script = @"
function RowDblClick(sender, eventArgs) {
$find(""" + editButton.ClientID + @""").click();
}";
var javaScript = new HtmlGenericControl("script");
javaScript.Attributes["type"] = "text/javascript";
javaScript.InnerHtml = script;
Controls.Add(javaScript);
this.DataGrid.ClientSettings.ClientEvents.OnRowDblClick = "RowDblClick";
The RowDblClick will be executed on DoubleClick - I have checked this with a alert(). But the Click-Eventhandler of the EditButton on the Serverside will not be executed. Can someone help me please how I can do this? - Thanks.
Thomas