Hi,
I need to create a questionnaire in my website. I was using standalone multipage explained here:
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/multipage/standalone-multipage/defaultcs.aspx
I have a set of radio button questions and I use page views to divide them into pages.On the last page I show a result graph based on the answers chosen. I need the questions to be required without defaulting a radio button value. Howevere, I am not able to do the validation on a page basis.
Below is the code that I am using. Please advise:
<script type="text/javascript"> var minIndex = 0, maxIndex = 5, globalSelectedIndex, multiPage, NextPage, PreviousPage; function pageLoad() { multiPage = $find("<%= rmRiskTolerance.ClientID %>"); PreviousPage = $find("<%= PreviousPage.ClientID %>"); NextPage = $find("<%= NextPage.ClientID %>"); //Initialization of the global selected index of the RadMultiPage control globalSelectedIndex = multiPage.get_selectedIndex(); } function PrevClicked(sender, args) { globalSelectedIndex--; multiPage.set_selectedIndex(globalSelectedIndex); if (globalSelectedIndex == minIndex) { sender.set_enabled(false); } if (!NextPage.get_enabled()) { NextPage.set_enabled(true); } } function NextClicked(sender, args) { Page_ClientValidate("QuestionnaireValidationGroup"); if (Page_IsValid) { globalSelectedIndex++; multiPage.set_selectedIndex(globalSelectedIndex); if (globalSelectedIndex == maxIndex) { sender.set_enabled(false); } if (!PreviousPage.get_enabled()) { PreviousPage.set_enabled(true); } return true; } else { return false; } } </script> <div class="page_header"> <h1>Risk Tolerance Questionnaire</h1> </div> <div> <telerik:RadMultiPage ID="rmRiskTolerance" runat="server" SelectedIndex="0"> <telerik:RadPageView ID="pvStep1" runat="server"> <h2>Step 1 : Complete the Questionnaire</h2> <p> <h4>1. When do you expect to begin distributions from the Plan? </h4> <asp:RequiredFieldValidator ID="rbBeginDistributionRequired" runat="server" ControlToValidate="rbBeginDistribution" ErrorMessage="* Required" SetFocusOnError="true" ValidationGroup="QuestionnaireValidationGroup"></asp:RequiredFieldValidator> <asp:RadioButtonList ID="rbBeginDistribution" runat="server"> <asp:ListItem Text="Within 5 years" Value="2"></asp:ListItem> <asp:ListItem Text="In 5–10 years" Value="4"></asp:ListItem> <asp:ListItem Text="In 5–10 years" Value="8"></asp:ListItem> <asp:ListItem Text="In more than 15 years" Value="12"></asp:ListItem> </asp:RadioButtonList> </p> <p> <h4>2. Once you begin taking distributions from the Plan, how long do you expect the distributions to last? </h4> <asp:RequiredFieldValidator ID="rbDistributionTimeRequired" runat="server" ControlToValidate="rbDistributionTime" ErrorMessage="* Required" SetFocusOnError="true" ValidationGroup="QuestionnaireValidationGroup"></asp:RequiredFieldValidator> <asp:RadioButtonList ID="rbDistributionTime" runat="server"> <asp:ListItem Text="I plan to take a lump sum distribution" Value="1"></asp:ListItem> <asp:ListItem Text="1 to 5 years" Value="2"></asp:ListItem> <asp:ListItem Text="5 to 10 years" Value="3"></asp:ListItem> <asp:ListItem Text="10 years or more" Value="4"></asp:ListItem> </asp:RadioButtonList> </p> </telerik:RadPageView> <telerik:RadPageView ID="pvStep2" runat="server"> <h2>Step 1 : Continued</h2> <p> <h4>3. Investing involves a trade-off between risk and return. Which statement best describes your investment goals? </h4> <asp:RequiredFieldValidator ID="rbInvestmentGoalsRequired" runat="server" ControlToValidate="rbInvestmentGoals" ErrorMessage="* Required" SetFocusOnError="true" ValidationGroup="QuestionnaireValidationGroup"></asp:RequiredFieldValidator> <asp:RadioButtonList ID="rbInvestmentGoals" runat="server"> <asp:ListItem Text="Protect the value of my account. In order to minimize the chance for loss, I am willing to accept the lower long-term returns provided by conservative investments." Value="1"></asp:ListItem> <asp:ListItem Text="Keep risk to a minimum while trying to achieve slightly higher returns than the returns provided by investments that are more conservative." Value="3"></asp:ListItem> <asp:ListItem Text="Balance moderate levels of risk with moderate levels of returns." Value="6"></asp:ListItem> <asp:ListItem Text="Maximize long-term investment returns. I am willing to accept large and sometimes dramatic fluctuations in the value of my investments." Value="10"></asp:ListItem> </asp:RadioButtonList> </p> <p> <h4>4. Select the portfolio you would be most comfortable investing in: </h4> <asp:RequiredFieldValidator ID="rbPortfolioRequired" runat="server" ControlToValidate="rbPortfolio" ErrorMessage="* Required" SetFocusOnError="true" ValidationGroup="QuestionnaireValidationGroup"></asp:RequiredFieldValidator> <asp:RadioButtonList ID="rbPortfolio" runat="server"> <asp:ListItem Text="Portfolio 1—Annual investment return of 5% or loss of 4%." Value="2"></asp:ListItem> <asp:ListItem Text="Portfolio 1—Annual investment return of 10% or loss of 8%." Value="3"></asp:ListItem> <asp:ListItem Text="Portfolio 1—Annual investment return of 20% or loss of 16%." Value="5"></asp:ListItem> <asp:ListItem Text="Portfolio 1—Annual investment return of 30% or loss of 25%." Value="6"></asp:ListItem> </asp:RadioButtonList> </p> </telerik:RadPageView> <telerik:RadPageView ID="pvStep3" runat="server"> <h2>Step 1 : Continued</h2> <p> <h4>5. If the value of your portfolio decreased by more than 20% in one year, how would you react? </h4> <asp:RequiredFieldValidator ID="rbPortfolioDecreaseRequired" runat="server" ControlToValidate="rbPortfolioDecrease" ErrorMessage="* Required" SetFocusOnError="true" ValidationGroup="QuestionnaireValidationGroup"></asp:RequiredFieldValidator> <asp:RadioButtonList ID="rbPortfolioDecrease" runat="server"> <asp:ListItem Text="I would not change my portfolio." Value="11"></asp:ListItem> <asp:ListItem Text="I would wait at least one year before changing to options that are more conservative." Value="8"></asp:ListItem> <asp:ListItem Text="I would wait at least three months before changing to options that are more conservative." Value="3"></asp:ListItem> <asp:ListItem Text="I would immediately change to options that are more conservative." Value="1"></asp:ListItem> </asp:RadioButtonList> </p> <p> <h4>6. If the stock market increased by 15% in one year while the value of your portfolio (invested primarily in bonds and cash) increased by 4% in the same year, how would you react? </h4> <asp:RequiredFieldValidator ID="rbStockMarketIncreaseRequired" runat="server" ControlToValidate="rbStockMarketIncrease" ErrorMessage="* Required" SetFocusOnError="true" ValidationGroup="QuestionnaireValidationGroup"></asp:RequiredFieldValidator> <asp:RadioButtonList ID="rbStockMarketIncrease" runat="server"> <asp:ListItem Text="I would replace the bond and cash positions of my portfolio with stocks." Value="10"></asp:ListItem> <asp:ListItem Text="I would add more stocks to my portfolio but not enough to make them a majority position." Value="3"></asp:ListItem> <asp:ListItem Text="I would not change my portfolio." Value="1"></asp:ListItem> </asp:RadioButtonList> </p> </telerik:RadPageView> <telerik:RadPageView ID="pvResult" runat="server"> <h2>Step 2 : Score your Questionnaire</h2> <p> Your score is <b> <asp:Literal ID="litScore" runat="server"></asp:Literal></b> and the corresponding M Portfolio Allocation Model is <b> <asp:Literal ID="litAllocationModel" runat="server"></asp:Literal></b>. </p> </telerik:RadPageView> </telerik:RadMultiPage> <div class="buttonContainer"> <telerik:RadButton ID="PreviousPage" Text="Previous" ToolTip="Click to see previous page" runat="server" Enabled="false" AutoPostBack="false" OnClientClicked="PrevClicked"> </telerik:RadButton> <telerik:RadButton ID="NextPage" Text="Next" ToolTip="Click to see next page" runat="server" CausesValidation="true" AutoPostBack="true" OnClientClicked="NextClicked" OnClick="NextPage_Click"> </telerik:RadButton> </div> </div>code behind:
protected void NextPage_Click(object sender, EventArgs e)
{
if (rmRiskTolerance.SelectedPageView.ID == "pvResult")
{
List<int> scoreList = new List<int>();
GetRadioButtonListValues(rmRiskTolerance, scoreList);
GetQuestionnaireResult(scoreList);
}
}
Hi
I am trying to perform the following but am stuck at one point and need some help to move forward - There is a template grid column with a link button that is associated with a custom command. Now on the client click of the link button we want to open up a radwindow to collect user comments & confirm the action.
So on the radwindow close the custom command on that grid row should be fired. How can I get the linkbutton that has triggered the radwindow open in the RadWindow Close event and do a post back on that link button for that row to fire the custom command.
Any info would be much appreciated.
Thanks.
<telerik:RadGrid ID="TasksGrid" runat="server" > <MasterTableView> <Columns> <telerik:GridBoundColumn DataField="TaskID" HeaderStyle-Width="95" ItemStyle-Width="95" HeaderText="Task ID" SortExpression="TaskID" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn> <GridRadComboFilter:GridRadComboFilter DataField="FlagID" HeaderText="Flag" SortExpression="FlagID" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50" /> <telerik:GridBoundColumn DataField="AssignedTo" HeaderText="Assigned To" SortExpression="AssignedTo" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Site" HeaderText="Site" SortExpression="Site" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Product" HeaderText="Product" SortExpression="Product" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn > <telerik:GridBoundColumn DataField="SupportType" HeaderText="Support Type" SortExpression="SupportType" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true"></telerik:GridBoundColumn > <telerik:GridBoundColumn DataField="Issue" HeaderText="Reported Issue" SortExpression="Issue" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn > <telerik:GridBoundColumn DataField="LastUpdatedText" HeaderText="Last Updated Text" SortExpression="LastUpdatedText" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn > <telerik:GridDateTimeColumn FilterControlWidth="110px" DataField="LastUpdatedDate" SortExpression="LastUpdatedDate" HeaderText="Last Updated Date" PickerType="DatePicker" DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridDateTimeColumn> <telerik:GridDateTimeColumn FilterControlWidth="110px" DataField="RequestedCompletionDate" SortExpression="RequestedCompletionDate" HeaderText="Req Completion Date" PickerType="DatePicker" DataFormatString="{0:d}" DataType="System.DateTime"></telerik:GridDateTimeColumn> <telerik:GridBoundColumn DataField="Status" HeaderText="Status" SortExpression="Status" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn > </Columns> </MasterTableView></telerik:RadGrid>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="Id" GroupLoadMode="Client" HierarchyLoadMode="Client"> <NestedViewTemplate> <asp:Panel runat="server" ID="configControlContainer" CssClass="viewWrap" Visible="true"> </asp:Panel> </NestedViewTemplate> <Columns>...
[HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.] System.Web.UI.ControlCollection.Add(Control child) +11274544 Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +619 [HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.] Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +724 Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control) +1182
I Added the grid in the Sharepoint web part , I did not add any code behind , I just added to the aspx the following :
<telerik:RadGrid ID="RadGrid1" runat="server" ></telerik:RadGrid>The exception is:
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.
Any suggestions ?

We recently upgraded to .Net 4.5 and I am now receiving a 404 File or Directory Not Found error when I try to upload a pdf. I have made all the changes to the web.config that were suggested in the documentation.
Any help would be appreciated

I have an issue with radgrids on public pages on my site (pages I want search engines to spider) are showing the back/next image button instead of the new "Mobile" buttons.
See attached images. One is from a datagrid with SEOPaging turn on (Old Buttons) and one with SEOPaging turned off (New Buttons).