Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
358 views
I'm following the telerik demo Grid Heirachy with Templates. On the sub grids I want to give the user "Add new Record" ability. I have that partially working except that on each new row three of my columns need to be "related comboboxes", as demostrated in this telerik example. In my implementation, my three related combo boxes are a list of clients, sub list of projects and sub list of project requirements.

The problem I run into is that the webpage can't find the comboboxes in my javascript code when the page first loads, it throws an error.

"The name 'RadComboBox_Project' does not exist in the current context"

Line 395:            function LoadProjects(sender, eventArgs) {
Line 396:                 var projectsCombo = $find("<%= RadComboBox_Project.ClientID %>");
Line 397:                var requirementsCombo = $find("<%= RadComboBox_Requirement.ClientID %>");

I think the reason this might be happening is because the RadGrid2 is located inside of a <telerik:RadPageView> control or within other nested controls. The aspx page when in Design mode doesn't show the RadGrid2 on the designer surface at all, it's somehow hidden. Probably because RadGrid2 is a subgrid of RadGrid1 and also that RadGrid2 is nested inside of a RadPageView, that being nested inside of a RadMultiPage and that being nested inside of an asp:Panel. (I'm using the exact code example from Grid Heirachy with Templates)

Another issue with the nested RadGrid2 is that it doesn't show up at all in the Properties window listbox in Visual Studio. None of the nested RadGrids on each RadPageView are visible. There are RadGrids on each of the Tabs of the RadTabStrip. All of these RadGrids are not visible.

In the c# code behind class, you also can't reference them. Code like this doesn't compile::

int x = RadGrid2.MasterTableView.Columns.Count;

RadComboBox_Project.DataTextField = "Name";
// this is a combobox within RadGrid2

Both of those two controls show the red squiggly lines, if you hover over them the VS tooltip tells me the same error: 
"The name 'RadGrid2' does not exist in the current context".
"The name 'RadComboBox_Project' does not exist in the current context".

It seems like there is one central error causing all of these nested controls to be hidden from the compiler. Any idea how to make them available for use so I can reference them in javascript and in c# code behind?

Thank you.

Dimitar Terziev
Telerik team
 answered on 12 Dec 2011
5 answers
409 views
Dear Telerik Support Team,

I am programmatically building a RagGrid and I want to insert a thumbnail whose filename is stored in the database (column "VignetteFilename"). (exemple of filename : "picture1.jpg")

Environment : Telerik AJAX RadControls, .Net Framework 3.5, VB.Net

The files are stored on the web server, in the directory : /Models/ImagesModels/

Here is the code I've used for creating the relating GridImageColumn (in VB.Net, using MS SQL Database) :

    Dim imageColumn As New GridImageColumn
               imageColumn.HeaderText = "Thumbnail 1"
                imageColumn.UniqueName = "VignetteFilename"
                imageColumn.DataImageUrlFields = {"VignetteFilename"}
                imageColumn.DataImageUrlFormatString = "~/Models/ImagesModels/{0}"
                imageColumn.AlternateText = "Photo Style 1"
                imageColumn.ImageAlign = "Middle"
                imageColumn.ImageHeight = "110px"
                imageColumn.ImageWidth = "90px"
                rgRadGrid.MasterTableView.Columns.Add(imageColumn)

In the relating Aspx.vb page, I have tried all the kinds of "Protected Sub RadGridSample_ItemDataBound ..." codes I've found on your Support web site, but nothing works.

Could you please help me ?

Many thanks in advance (and congratulations for your terrific product !!!)

Jacques.
Jacques
Top achievements
Rank 1
 answered on 12 Dec 2011
3 answers
137 views
hi, i'm beginner in telerik programming.
i used the editor in my project, when i upload a picture, for example this picture in 300*300 size, but it shown in very little size in my page!
i didnot any filtering on my project, but it dosent work! what should i do for this problem??

Thanks...
Dobromir
Telerik team
 answered on 12 Dec 2011
7 answers
150 views
Hi,

I am trying to implement a following scenario. I am porting an already existing menu solution to radMenu. The menu consists of a a couple of static elements (for example "Forums", "Clients", "Client Cards", "Reports", "Claims") and each of them consists of 2-3 nested static elements (usually registry of records and "add a new record"). The difficult part is the list of dynamically bound 10 recently opened records that is being loaded from a Stored Procedure via the SqlDataSource.

The original menu was done pretty crudely. A panel with a HoverMenuExtender and the 10 recent list was implemented with RadioButtonList that was hooked to the SqlDataSource. Below is some code for reference:   

<asp:HoverMenuExtender ID="HME" runat="server" PopupControlID="panelClientCardsDropDown" TargetControlID="lnkClientCardsDropDown"></asp:HoverMenuExtender>
 
    <asp:Panel ID="panelClientCardsDropDown" runat="server">
        <asp:Label ID="lblRecentCards" runat="server" Text="10 recent client cards :"/>
        <asp:SqlDataSource ID="SQLDS_RecentCards" runat="server" ConnectionString="<%$ ConnectionStrings:SQLusrConn %>" SelectCommand="spSelectRecent" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter DefaultValue='<%$ AppSettings:03 %>' Name="txtParametr03" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:RadioButtonList ID="radRecentCards" runat="server" DataSourceID="SQLDS_RecentCards" DataTextField="Value" DataValueField="ID">
        </asp:RadioButtonList>
    <asp:HyperLink ID="lnkNewCard" NavigateUrl="~/private/tcard.aspx?ID=new" Target="_blank" runat="server" Text="New Client Card"/>
    </asp:Panel>

I would like to know how to achieve this using the radMenu. I've read the documentation but it does not seem to provide a solution.
Kate
Telerik team
 answered on 12 Dec 2011
1 answer
59 views
Hi!  We've recently run into an issue with the radeditor which seems to correspond to around the time we upgraded our Telerik asp.net/ajax controls from 2011 Q2 to 2011 Q3. 

On our page we have a radeditor which utilizes the code below provided by Telerik to show the word 'Comments' in the radeditor until the user clicks in the radeditor, upon which the word 'Comments' disappears.

var defaultContent = "Comments";
 
            function OnEditorLoad(editor, args) {
                editor.set_html(defaultContent);
                var EditorElement = document.all ? editor.get_document().body : editor.get_document();
 
                $telerik.addExternalHandler(EditorElement, "click", function (e) {
                    if (editor.get_html(true).trim() == defaultContent) {
                        editor.set_html("");
                    }
                });
 
                $telerik.addExternalHandler(EditorElement, "blur", function (e) {
                    if (editor.get_html(true).trim() == "") {
                        editor.set_html(defaultContent);
                    }
                });
            }
 
---------------------------------------------------------------------------------------------------
 
<telerik:RadEditor ID="reComments" runat="server" Skin="Windows7" Width="94.7%" Height="150px"
 ToolsFile="~/Content/Tools_NoToolbar.xml" ToolTip="Enter Comments"
 ContentAreaCssFile="~/Content/cssRadEditorWhiteContent.css" OnClientLoad="OnEditorLoad"  ToolbarMode="Default"
 EditModes="Design" StripFormattingOptions="MSWordRemoveAll" ContentAreaMode="Div">
    <CssFiles>
        <telerik:EditorCssFile Value="~/Content/cssRadEditorWhiteContent.css" />
    </CssFiles>
</telerik:RadEditor>

This previously worked fine with no issues.  However since upgrading the controls, no matter what other field (e.g., textbox, radiobuttons, etc) a user clicks on once a page loads, the cursor always ends up inside the radeditor and requires the user to have to click again in order to set the focus back on the original field clicked.  This has become very frustrating for our users.

A secondary, much less important issue noticed is the word 'Comments' no longer reappears if a user clicks outside the radeditor without entering any text, etc,;  whereas previously if a user clicked in the radeditor, the word 'Comments' would disappear, and if the user left the radeditor blank then when they clicked elsewhere on the page the word 'Comments' would re-appear.

These issues are experienced on multiple different pages where we've utilized this functionality, suggesting whatever has caused the issue isn't the result of something on the individual pages themselves.  It also happens regardless of which browser is used to access our site (i.e., Firefox, Chrome, IE).

Any ideas or thoughts?

Thanks!
Dobromir
Telerik team
 answered on 12 Dec 2011
2 answers
160 views

I uses RadButton in asp.net ChangePassword Control.
Here is my code

  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="Panel1">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
    <ClientEvents OnRequestStart="RequestStartHandler" OnResponseEnd="ResponseEndHandler" />
  </telerik:RadAjaxManager>
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" />
  
<asp:Panel ID="Panel1" runat="server">
  <asp:ChangePassword ID="ChangePassword1" runat="server" Width="231px" OnChangedPassword="ChangePassword1_ChangedPassword" ContinueDestinationPageUrl="~/ChangePassword.aspx" ChangePasswordFailureText="Password incorrect.">
                              <ChangePasswordTemplate>
                                <div id="div1" runat="server" style="height:16px;">
                                   <asp:Label ID="CurrentPasswordLabel" runat="server" AssociatedControlID="CurrentPassword">Current Password:</asp:Label>
                                </div>
                                <div id="div2" runat="server" style="height:27px;">
                                   <asp:TextBox ID="CurrentPassword" runat="server" Font-Size="12px" Width="192px" MaxLength="125" TextMode="Password" onKeyDown="return disable_sp(event);" onKeyPress="return disable_sp(event);"></asp:TextBox>
                                   <asp:RequiredFieldValidator ID="rfvCurrentPwd" runat="server" 
                                        ControlToValidate="CurrentPassword" ErrorMessage="<img src='App_Themes/Images/note.png'/>" 
                                        ToolTip="This field is required." ValidationGroup="ChangePassword">
                                   </asp:RequiredFieldValidator>
                                </div>
                                <div id="div3" runat="server" style="height:16px;">
                                   <asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">New Password:</asp:Label>
                                </div>
                                <div id="div4" runat="server" style="height:16px; color: #cc0f16;">
                                   A minimum length of <%= Membership.MinRequiredPasswordLength %> characters.
                                   <asp:RegularExpressionValidator ID="valPwd" runat="server" 
                                        ControlToValidate="NewPassword"
                                        ErrorMessage="<img src='App_Themes/Images/note.png' alt='' />" 
                                        ValidationExpression=".{4}.*"
                                        ValidationGroup="ChangePassword">
                                   </asp:RegularExpressionValidator>
                                </div>
                                <div id="div5" runat="server" style="height:27px;">
                                   <asp:TextBox ID="NewPassword" runat="server" Font-Size="12px" Width="192px" MaxLength="125" TextMode="Password" onKeyDown="return disable_sp(event);" onKeyPress="return disable_sp(event);"></asp:TextBox>
                                   <asp:RequiredFieldValidator ID="rfvNewPwd" runat="server" 
                                        ControlToValidate="NewPassword" ErrorMessage="<img src='App_Themes/Images/note.png'/>" 
                                        ToolTip="This field is required." ValidationGroup="ChangePassword">
                                   </asp:RequiredFieldValidator>                                                
                                </div>
                                <div id="div6" runat="server" style="height:16px;">
                                   <asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">Confirm New Password:</asp:Label>
                                </div>
                                <div id="div7" runat="server" style="height:24px; padding-bottom:2px;">
                                   <asp:TextBox ID="ConfirmNewPassword" runat="server" Font-Size="12px" Width="192px" MaxLength="125" TextMode="Password" onKeyDown="return disable_sp(event);" onKeyPress="return disable_sp(event);"></asp:TextBox>
                                   <asp:RequiredFieldValidator ID="rfvConfirmNewPwd" runat="server" 
                                        ControlToValidate="ConfirmNewPassword" 
                                        ErrorMessage="<img src='App_Themes/Images/note.png'/>" 
                                        ToolTip="This field is required." ValidationGroup="ChangePassword">
                                   </asp:RequiredFieldValidator>
                                </div>
                                <div id="div8" runat="server" style="color:#ff0000;">
                                   <asp:CompareValidator ID="NewPasswordCompare" runat="server" Display="Dynamic"
                                        ControlToCompare="NewPassword" ControlToValidate="ConfirmNewPassword" 
                                        ErrorMessage="New password and confirm new password mismatch."
                                        ValidationGroup="ChangePassword">
                                   </asp:CompareValidator>
                                </div>
                                <div id="div9" runat="server" style="height:27px; padding-top:4px;">
                                   <telerik:RadButton ID="btnChangePassword" runat="server" ButtonType="LinkButton" Text="Submit" CommandName="ChangePassword" ValidationGroup="ChangePassword"></telerik:RadButton>
                                   <telerik:RadButton ID="btnCancel" runat="server" ButtonType="LinkButton" Text="Cancel" CommandName="Cancel" CausesValidation="False"></telerik:RadButton>
                                </div>
                                <div id="div10" runat="server" style="color:#ff0000;">
                                   <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                </div>
                              </ChangePasswordTemplate>
                              <SuccessTemplate>
                                <table cellpadding="0" cellspacing="0" style="width:100%; height:175px;">
                                  <tr><td valign="top" align="left"><telerik:RadButton ID="btnContinue" runat="server" ButtonType="LinkButton" Text="Continue" CommandName="Continue"></telerik:RadButton></td></tr>
                                </table>
                              </SuccessTemplate>
                            </asp:ChangePassword>
</asp:Panel>

I got Error: 'undefined' is null or not an object' in IE after the page Postback.
This problem come from RadAjaxManager and RadButton.
I set UseSubmitBehavior="false" but the error still occur.
How to solve this problem, please help.

p.s. I use RadControls for ASP.NET AJAX 2010 Q3

Please help.
Thank you

Slav
Telerik team
 answered on 12 Dec 2011
9 answers
1.4K+ views
I'm using a RadNumericTextBox like shown below:

 
            <telerik:RadNumericTextBox  
                ID="rntbLineNumber"  
                MinValue="1" 
                MaxValue="32767" 
                Type="Number" 
                runat="server"
                <NumberFormat DecimalDigits="0" GroupSeparator="" /> 
            </telerik:RadNumericTextBox>


The goal is to insure that the value entered is always between 1 and 32767. However, it allows me to enter an empty string which causes this line to fail on posting.

 int myValue = int.Parse(rntbLineNumber.Text); 

I'm guessing that I'm supposed to get the value from another property other than "Text" off of the RadNumericTextBox. However, I still feel that the control should be enforcing my input constraints, where a specify a valid range, client-side. In other words, an empty string should populate the field with the minimum value. Is there anyway to do this? Or do I simply have to allow empty strings to be posted?
Marin
Telerik team
 answered on 12 Dec 2011
6 answers
237 views

Hello,

I've been trying the Rad Componets for ASP.net and a small issue came up.

I was trying to create a Self-referencing hierarchy grid programmatically on the Page_Init Event.

While I have been successful in creating the grid in the designer view, when I set up it's structure in the Page_Init the hierarchy doesn't seem to be working (ie I get all the records and columns to show normally but they don't have any children).

Is it possible to give me a few pointers on what I need to create the Self-referencing structure on the grid?

PS:My code looks like:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SelfHierarchyRadGrid._Default" %>  
 
<%@ Register assembly="Telerik.Web.UI, Version=2008.3.1105.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>  
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
 
<html xmlns="http://www.w3.org/1999/xhtml" >  
<head runat="server">  
    <title></title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <telerik:RadScriptManager runat="server">  
    </telerik:RadScriptManager>  
    <div>  
      
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None">  
        </telerik:RadGrid>  
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
            ConnectionString="<%$ ConnectionStrings:TestDBConnectionString %>"   
            SelectCommand="SELECT [aa], [parentaa], [Text] FROM [HierarchyTest]">  
        </asp:SqlDataSource>  
      
    </div>  
    </form>  
</body>  
</html>  
 
protected void Page_Init(object sender, EventArgs e)  
{  
  if (!IsPostBack)  
  {  
    InitGrid();  
  }  
}  
private void DefineStructure()  
{  
   RadGrid1.DataSourceID = "SqlDataSource1";  
 
   RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;  
   RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;  
   RadGrid1.MasterTableView.AllowSorting = true;  
   string[] dkn={"aa""parentaa"};  
   RadGrid1.MasterTableView.DataKeyNames = new string[] { "aa""parentaa" };  
   RadGrid1.MasterTableView.SelfHierarchySettings.ParentKeyName = "parentaa";  
   RadGrid1.MasterTableView.SelfHierarchySettings.KeyName = "aa";  
   RadGrid1.ClientSettings.AllowExpandCollapse = true;  
 
   RadGrid1.AutoGenerateColumns = false;  
   RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;  
 
   //Create Columns  
   GridBoundColumn boundcolumn = new GridBoundColumn();  
   boundcolumn.datafield="aa";  
   RadGrid1.MasterTableView.Add(boundcolumn);  
   boundcolumn.UniqueName = "aa";  
   boundcolumn.Visible = true;  
   boundcolumn.HeaderText = "aa";  
 
   //... Rest of the columns ...  

Pavel
Top achievements
Rank 1
 answered on 12 Dec 2011
1 answer
151 views

Hi,

The RadEditor (version 5.6.4.0, RadEditor2.dll and Treeview (version 5.1.3.0, RadTreeview.Net2.dll) are currently  being used by our team, we are thinking about the possibility to upgrade to latest ajax enabled radcontrol (Telerik.web.UI.dll version 2011.3.1115.35). We are using vs 2010, framework 3.5.   What are the steps for upgrading the vs 2010 website ?  Anything we need to watch out f( we like to make sure all the existing content will be compatable with the new controls).

Any input will be appreciate, thanks.

Rumen
Telerik team
 answered on 12 Dec 2011
8 answers
350 views
Details are here:
http://www.codeplex.com/AjaxControlToolkit/WorkItem/View.aspx?WorkItemId=15204
http://forums.asp.net/t/1174669.aspx
http://dotnetdebug.net/2008/05/25/
http://www.codeplex.com/AjaxControlToolkit/WorkItem/View.aspx?WorkItemId=14857

I encountered this problem recently by using the telerik script manager with "ScriptCombine" set to true and deploying from a 32-bit machine to a 64-bit machine.

Are you aware of the above issue? I'm assuming your code works the same as the stack trace points to the same area of code:

Assembly "..." does not contain a script with hash code "...".

Telerik.Web.UI

STACK TRACE:

   at Telerik.Web.UI.ScriptEntry.Deserialize(String serializedScriptEntries)

   at Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile()

   at Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context)

Stroika
Top achievements
Rank 1
 answered on 12 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?