Note that there are some explanatory texts on larger screens.

plurals
  1. POButton Click Event Not Firing
    primarykey
    data
    text
    <p>Need some help. </p> <p>Description: I have a WorkFlow Type UserControl that is launched from a DataGrid Add New command. Step 1 of the UserControl allows the user to enter some search criteria, clicks the Next Button it will display a dynamically created UserControl (step 2) that displays the data rows that was retrieved into datagrid. The user then selects the row they want to model the new entry from and clicks srNextButton to go to the final Data Entry screen. </p> <p>Problem: The srNextButton on the dynamically created user control (step 2) does not fire the buttons event handler code nor does it cause any type of postback. What did I do wrong?</p> <p>UserControl Step2:</p> <pre><code> &lt;div style="width: 1000px; height: 400px; overflow: scroll;"&gt; &lt;telerik:RadGrid ID="grd1" runat="server" CellSpacing="0" GridLines="None"&gt; &lt;headercontextmenu cssclass="GridContextMenu GridContextMenu_Default"&gt; &lt;/headercontextmenu&gt; &lt;mastertableview tablelayout="Auto" width="95%"&gt; &lt;CommandItemSettings ExportToPdfText="Export to PDF"&gt;&lt;/CommandItemSettings&gt; &lt;RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"&gt; &lt;HeaderStyle Width="20px"&gt;&lt;/HeaderStyle&gt; &lt;/RowIndicatorColumn&gt; &lt;ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"&gt; &lt;HeaderStyle Width="20px"&gt;&lt;/HeaderStyle&gt; &lt;/ExpandCollapseColumn&gt; &lt;EditFormSettings&gt; &lt;EditColumn FilterControlAltText="Filter EditCommandColumn column"&gt; &lt;/EditColumn&gt; &lt;/EditFormSettings&gt; &lt;/mastertableview&gt; &lt;clientsettings&gt; &lt;Selecting AllowRowSelect="True" /&gt; &lt;/clientsettings&gt; &lt;filtermenu enableimagesprites="False"&gt; &lt;/filtermenu&gt; &lt;/telerik:RadGrid&gt; &lt;asp:Button runat="server" ID="srNextButton" OnClick="nextButton_Click" Text="Next" CssClass="nextButton" AutoPostBack="true" /&gt; &lt;asp:Button runat="server" ID="btnCancel" OnClientClick="CancelEdit()" Text="Cancel" CssClass="nextButton" /&gt; &lt;/div&gt; </code></pre> <p>Code Step2:</p> <pre><code> protected void nextButton_Click(object sender, EventArgs e) { GridIndexCollection _int = this.grdPolicyCoverage.SelectedIndexes; GoToNextItem(this); } </code></pre> <p>I also tried adding:</p> <pre><code> protected override void OnInit(EventArgs e) { base.OnInit(e); this.PreRender += SearchResults_PreRender; if (!IsPostBack) { this.srNextButton.Click += new EventHandler(nextButton_Click); } } </code></pre> <p>I have a BaseUserControl.cs that houses the loading of the control</p> <pre><code> protected void GoToNextItem(Control control) { //RadPanelBar _radPanelBar = (RadPanelBar)page.Page.FindControl("RadPanelBar1"); //NewAdjustment _newAdjustment = (NewAdjustment)this.Page.FindControl() RadPanelBar _radPanelBar = (RadPanelBar) control.Parent.Parent.Parent.Parent.Parent.FindControl("RadPanelBar1"); int selectedIndex = _radPanelBar.SelectedItem.Index; if (selectedIndex == 1) { RadPanelItem _pnlSearchResults = (RadPanelItem)_radPanelBar.FindItemByValue("SearchResults"); _pnlSearchResults.Controls.Add(LoadControl("~/Controls/AdjustmentWorkFlow/SearchResults.ascx")); } _radPanelBar.Items[selectedIndex + 1].Selected = true; _radPanelBar.Items[selectedIndex + 1].Expanded = true; _radPanelBar.Items[selectedIndex + 1].Enabled = true; _radPanelBar.Items[selectedIndex].Expanded = false; } </code></pre> <p>The Parent UserControl starts out with every control below it being in a RadAjaxPanel if that makes a difference. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload