Help,
Im trying to create RadTabs and RadGrids dynamically based on database entries. I also want the RadGrid to postback on double click of the row. I've tried creating javascript methods for each grid to handle the Double Click Event but the issue I run into is that the $find function cannot find my programitaccally created grids to get their UniqueID. Is what Im trying to accomplish possible? Some of my code is below.
Thanks for any help in advance.
Im trying to create RadTabs and RadGrids dynamically based on database entries. I also want the RadGrid to postback on double click of the row. I've tried creating javascript methods for each grid to handle the Double Click Event but the issue I run into is that the $find function cannot find my programitaccally created grids to get their UniqueID. Is what Im trying to accomplish possible? Some of my code is below.
Panel GridPanel =
new
Panel();
EntityDataSource NewEDS = CreateDataSource(Tab);
GridPanel.Controls.Add(NewEDS);
RadGrid NewRG =
new
RadGrid();
NewRG.ID =
"rg"
+ Tab.WebTabId.ToString();
NewRG.AutoGenerateColumns =
true
;
NewRG.DataSourceID = NewEDS.ID;
NewRG.MasterTableView.TableLayout = GridTableLayout.Fixed;
NewRG.ClientSettings.Scrolling.AllowScroll =
true
;
NewRG.ClientSettings.Scrolling.UseStaticHeaders =
true
;
NewRG.ClientSettings.Selecting.AllowRowSelect =
true
;
GridPanel.Controls.Add(NewRG);
string
jsText =
"function "
+ NewRG.ID +
"_DblClick(sender, eventArgs) {$find('"
+ RadAjaxManager.ClientID +
"').ajaxRequestWithTarget('"
+ NewRG.UniqueID +
"','Select');}"
;
Page.ClientScript.RegisterClientScriptBlock(
this
.GetType(),NewRG.ID +
"_DblClick"
, jsText,
true
);
NewRG.ClientSettings.ClientEvents.OnRowDblClick = NewRG.ID +
"_DblClick"
;
Thanks for any help in advance.