Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
127 views
I followed the samples of show/hide column using client event, however I get js runtime error on the line "var a=this.get_columns()[b].Display=a" that says "get_column()[...] is null or not an object", i am pretty sure that I passed the right index. Any ideas?

Thanks a lot!

Shannon
Shannnon
Top achievements
Rank 1
 answered on 17 Feb 2011
2 answers
114 views
I have a web form which saves a record to the database via server-side code, but then upon postback, I want to show the RadWindow i created.  I dont want the radwindow to show initially when the page loads.  Its only when the user clicks the Save button on the form, which runs server-side code, but then I need to invoke the RadWindow to show.  How do I do this? 
Dan
Top achievements
Rank 1
 answered on 17 Feb 2011
2 answers
99 views
I've modified an existing (working) ASP webpage by adding auto spellcheck per the example code.  There are two text boxes, one of which is seldom used, so I'd rather spell check them seperately (rather than use ControlsToCheck and getting both at the same time). 

Specifically, I've added two RadSpell controls:

<telerik:RadSpell id="RadSpellRepairOnly" runat="server" controltocheck="RepairTextBox" buttontype="None" IsClientID="true" />
<telerik:RadSpell id="RadSpellInstructionsOnly" runat="server" controltocheck="InstructionsTextBox" buttontype="None" IsClientID="true" />

...two scripts:

function spellCheckRepair() {
GetRadSpell(
'<%= RadSpellRepairOnly.ClientID %>').startSpellCheck();
}

 function spellCheckInstructions() {
GetRadSpell(
'<%= RadSpellInstructionsOnly.ClientID %>').startSpellCheck();
}

 


...and modified the two textboxes accordingly:

<asp:TextBox ID="RepairTextBox" runat="server" Rows="12" Width="100%" TextMode="MultiLine" BorderColor="White" onblur="javascript: spellCheckRepair();"></asp:TextBox>

 <asp:TextBox ID="InstructionsTextBox" runat="server" Rows="6" Width="100%" TextMode="MultiLine" BorderColor="White" onblur="javascript: spellCheckInstructions();"></asp:TextBox>

 


This works, but if I jump between the text boxes more than once I get an 'out of stack space' exception and execution is halted.  Is this not a supported configuration?

 

 

 

Henry
Top achievements
Rank 1
 answered on 17 Feb 2011
3 answers
106 views
When the cursor hovers over the scheduler, how can I control how many rows are highlighted? 

In my scheduler each appt is fixed at 30 minutes in code, and the MinutesPerRow property is set to 30.  Prior to inserting an appt when I hover over the scheduler two rows highlight instead of just the single row where the appt will go.

Thanks
Mark
Peter
Telerik team
 answered on 17 Feb 2011
3 answers
137 views
Hi Telerik Team,

I just want to know whether is it possible to show the time horizontally on RadScheduler.

I have gone through the demo of "Car-On-Rent". In that the list of cars are shown horizontally & time is hown vertically on scheduler.

So is it possible to interchange them i.e. cars to be shown vertically & timings horizontally.?

Please revert as soon as possible.

Thanks in advance
Amit Thakkar
Peter
Telerik team
 answered on 17 Feb 2011
1 answer
65 views
Hello,

I am trying to do a number of things with a RadComboBox and RadAsyncUpload inside a RadWindow:

<telerik:RadWindowManager ID="RadWindowManager1" Behaviors="Close" runat="server"
    Modal="true" Width="900px">
    <Windows>
        <telerik:RadWindow ID="RadWindowApprove" runat="server">
            <ContentTemplate>
                <h3>
                    Approve Supplier Agreement</h3>
                <table>
                    <colgroup>
                        <col class="first-column" />
                    </colgroup>
                      <tr>
                        <td>
                            Document:
                        </td>
                        <td>
                            <telerik:RadComboBox ID="RadComboBoxDocument" runat="server" EmptyMessage="Choose an existing SPA" AllowCustomText="true">
                            </telerik:RadComboBox>  
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>or upload a new one</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><telerik:RadAsyncUpload ID="RadAsyncUploadDocument" runat="server" ControlObjectsVisibility="None"
                                MultipleFileSelection="Disabled" MaxFileInputsCount="1" AllowedFileExtensions="pdf" OnClientFileUploaded="FileUploaded">
                            </telerik:RadAsyncUpload></td>
                    </tr>
                </table>
                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                    <script type="text/javascript">
                //<![CDATA[
  
                        // File selected so remove any uploaded files
                        function FileSelected(sender, args) {
  
                            var fileUpload = $find('<%=  RadAsyncUploadDocument.ClientID %>');
                            var inputs = fileUpload.getUploadedFiles();
  
                            for (i = inputs.length - 1; i >= 0; i--) {
                                fileUpload.deleteFileInputAt(i);
                            }
                        }
  
                        // File uploaded so unselect any selected file
                        function FileUploaded(sender, args) {
  
                            var combo = $find('<%=  RadComboBoxDocument.ClientID %>');
                            alert(combo.get_selectedItem().get_text());
  
                            combo.clearSelection();
                        }
  
                    //]]>
                </script>
                </telerik:RadScriptBlock>
                  
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

The problem is that in my FileSelected function, no files are returned for getUploadedFiles() and in my FileUploaded function getSelectedItem() is null.

Can anyone tell me why this is?  Am I doing anything wrong?

Thanks,
Jo
Genady Sergeev
Telerik team
 answered on 17 Feb 2011
6 answers
493 views
Hi,
 I've installed version 5.8.0.0 and have found that the image editor increases the size of the image when cropping an original image. Is there a way to change the image quality setting on cropping so that it doesn't increase in size? Theoretically, the cropped image should be MUCh smaller than the original image.

Thanks,
Jason.
Jason Brownhill
Top achievements
Rank 1
 answered on 17 Feb 2011
3 answers
409 views
I've look through all the examples on the forum and can't get my grid height and width to size dynamically.

Here is my code.

<asp:Panel ID="Panel1" runat="server" Height="100%" Width="100%"
             <telerik:RadGrid ID="grdProducts" runat="server" Skin="DMID" EnableEmbeddedSkins="False"
           AutoGenerateColumns="False" GridLines="None" GroupingEnabled="False" OnLoad="grdProducts_Load"
           OnPreRender="grdProducts_PreRender"  PageSize="5" AllowPaging="True" 
       AllowSorting="True" Width="99%">
           <HeaderContextMenu EnableEmbeddedSkins="False" CssClass="GridContextMenu GridContextMenu_DMID">
           </HeaderContextMenu>
           <MasterTableView NoMasterRecordsText="No Products available." TableLayout="Fixed" DataKeyNames="ProductID" >
                              <CommandItemSettings ExportToPdfText="Export to Pdf" />
                              <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
               </RowIndicatorColumn>
               <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
               </ExpandCollapseColumn>
               <Columns>
                   <telerik:GridBoundColumn FilterControlAltText="Filter ID column" HeaderText="ID"
                       ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID" DataField="ProductID" HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="60px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter Lot column" HeaderText="Lot #"
                       ReadOnly="True" SortExpression="Lot" UniqueName="Lot" DataField="Lot" HeaderStyle-HorizontalAlign="Center"   HeaderStyle-Width="60px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter Description column" HeaderText="Investigational Agent<br/>Description"
                       ReadOnly="True" SortExpression="Description" UniqueName="Description" DataField="Description" HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="100px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter UnitDosage column" HeaderText="Unit Dosage"
                       ReadOnly="True" SortExpression="UnitDosage" UniqueName="UnitDosage" DataField="UnitDosage" HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="75px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter ShipUnit column" HeaderText="Shipping<br/>Unit"
                       ReadOnly="True" SortExpression="ShipUnit" UniqueName="ShipUnit" DataField="ShipUnit" HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="75px" >
                                          </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter Expire column" HeaderText="Expiration Date<br/>(mm/dd/yyyy)"
                       ReadOnly="True" SortExpression="Expire" UniqueName="Expire" DataType="System.DateTime"
                       DataField="Expire" DataFormatString="{0:d}"  HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="80px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter UnitsAvailable column" HeaderText="Units<br/>Available"
                       SortExpression="UnitsAvailable" UniqueName="UnitsAvailable" DataType="System.Int32"
                       DataField="UnitsAvailable"  HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="50px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn DataType="System.Int32" FilterControlAltText="Filter uRequested column"
                       HeaderText="Units<br/>Requested" SortExpression="URequested" UniqueName="uRequested"
                       DataField="URequested" HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="50px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn DataType="System.Int32" FilterControlAltText="Filter UApproved column"
                       HeaderText="Units<br/>Approved" UniqueName="UApproved" DataField="UApproved"
                       SortExpression="UApproved"  HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="50px" >
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn FilterControlAltText="Filter UShipped column" HeaderText="Units<br/>Shipped"
                       ReadOnly="True" SortExpression="UShipped" UniqueName="UShipped" DataType="System.Int32"
                       DataField="UShipped"  HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="50px" >
                   </telerik:GridBoundColumn>
               </Columns>
               <EditFormSettings>
                   <EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" EditImageUrl="Edit.gif"
                       CancelImageUrl="Cancel.gif" FilterControlAltText="Filter EditCommandColumn column">
                   </EditColumn>
               </EditFormSettings>
           </MasterTableView>
           <ClientSettings Scrolling-AllowScroll="true" EnableRowHoverStyle="true" Selecting-AllowRowSelect="true">
               <Resizing AllowColumnResize="true" />
               <Scrolling AllowScroll="true" UseStaticHeaders="true"  />
           </ClientSettings>
           <FilterMenu EnableImageSprites="False" EnableEmbeddedSkins="False">
           </FilterMenu>
       </telerik:RadGrid>
   </asp:Panel>
Pavlina
Telerik team
 answered on 17 Feb 2011
1 answer
94 views
The code below shows two RadComboBox instances. The first is configured and bound within PageLoad. The second is bound within an AJAX request.

Javascript and styles work fine on both comboboxes before clicking on the button. After clicking on btnShow the second combo box has the expected data, but, styling and client side response is disabled.

What am I doing wrong?

ASPX file
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default2" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            </Scripts>
        </telerik:RadScriptManager>
      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
          <telerik:AjaxSetting AjaxControlID="btnShow">
            <UpdatedControls>
              <telerik:AjaxUpdatedControl ControlID="ajaxPanel1" LoadingPanelID="radLoadingPanel" />
            </UpdatedControls>
          </telerik:AjaxSetting>
        </AjaxSettings>
      </telerik:RadAjaxManager>
  
      Populated in Page Load
      <hr />
      <telerik:RadComboBox ID="cbPageLoad" runat="server" Width="300"></telerik:RadComboBox>
  
      <p> </p>
      <p> </p>
        <asp:Button runat="server" ID="btnShow" Text="Populate From Ajax Call" 
          OnClick="btnShow_Click" />
      <hr />
  
      <div>
        <telerik:RadAjaxLoadingPanel ID="radLoadingPanel" runat="server" />
        <telerik:RadAjaxPanel ID="ajaxPanel1" runat="server" >
            <telerik:RadComboBox ID="cbAjax" runat="server" Width="300px"></telerik:RadComboBox>
        </telerik:RadAjaxPanel>
      </div>
    </form>
</body>
</html>


ASPX.CS File
public class Foo
{
    public string Text {get; set;}
    public string Value {get; set;}
  
    public Foo(string text, string value)
    {
        Text = text;
        Value = value;
    }
  
    public static Foo[] GetData()
    {
        return new Foo[] { 
            new Foo("Bar 1", "V1"), 
            new Foo("Bar 2", "V2"), 
            new Foo("Bar 3", "V3"), 
            new Foo("Bar 4", "V4")};
          
    }
}
  
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindCB(cbPageLoad);
        }
    }
  
  
    protected void BindCB(RadComboBox cb)
    {
        cb.DataTextField = "Text";
        cb.DataValueField = "Value";
        cb.DataSource = Foo.GetData();
        cb.DataBind();
    }
  
    protected void btnShow_Click(object sender, EventArgs e)
    {
        BindCB(cbAjax);
    }
  
}

Helen
Telerik team
 answered on 17 Feb 2011
3 answers
302 views
Hello,

So far I've found the threads here invaluable in the month that I have been using Telerik controls. Unfortunately I find myself in a situation where I cannot find an answer in an existing thread although I've tried to piece some solutions together.

I am using asp.net RegularExpressionValidators and RequiredFieldValidators when needed and they are set to display dynamically. My first task was to shade the invalid rad boxes when they are invalid. I accomplished this by using <ClientEvents>  then setting the enabled style and calling updateCssClass. This is working great. The problem I am having now is that when the submit button is clicked, the client validation is firing but I can no longer set the background color. I'm using the onClientClick then looping through the validators and the rad input controls but I must be doing something wrong. When I step through the javascript I can see the EnabledStyle get set and the updateCssClass get called just like what is working when the individual textboxes work.

I'm only including one textbox in the aspx example for brevity.
Here is the code:

Javascript
function ValidateOnSubmit()
{
    var allRadControls = $telerik.radControls;
    var isValid = true;
    for (var i = 0; i < Page_Validators.length; i++)
    {
        var val = Page_Validators[i];
        ValidatorValidate(val, "all");
        if (!val.isvalid)
        {
            isValid = false;
            for (var y = 0; y < allRadControls.length; y++)
            {
                if (val.controltovalidate == allRadControls[y]._clientID)
                {
                    allRadControls[y].get_styles().EnabledStyle[0] += "background-color: LightPink;";
                    allRadControls[y].updateCssClass();
                }
            }
        }
        else
        {
            isValid = true;
        }
    }
}

ASPX
<telerik:RadTextBox ID="radtbEmailAddress" runat="server" MaxLength="256" ValidationGroup="all" EmptyMessage="Enter Email Address" Width="225px">
<ClientEvents OnValueChanged="ValidatePage" /></telerik:RadTextBox><asp:RegularExpressionValidator 
           id="revEmail"
           runat="server"
           ErrorMessage="Please, enter valid e-mail address."
           ValidationExpression= "^((?:(?:(?:[a-zA-Z0-9][\!\#\$\%\&\'\*\/\=\?\^\`\{\|\}\~\.\-\+_]?)*)[a-zA-Z0-9])+)\@((?:(?:(?:[a-zA-Z0-9][\!\#\$\%\&\'\*\/\=\?\^\`\{\|\}\~\.\-\+_]?){0,62})[a-zA-Z0-9])+)\.([a-zA-Z0-9]{2,6})$"
           ControlToValidate="radtbEmailAddress" ForeColor="Red" Display="Dynamic" ValidationGroup="all" >
</asp:RegularExpressionValidator><asp:RequiredFieldValidator ID="rfvEmailAddress" runat="server" ForeColor="Red" ControlToValidate="radtbEmailAddress" Display="Dynamic" ValidationGroup="all" ErrorMessage="Please enter an email address"></asp:RequiredFieldValidator>
<br />
  
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="ValidateOnSubmit();" OnClick="btnSubmit_Click" CssClass="brown" CausesValidation="true" ValidationGroup="all" />

Any help is greatly appreciated!

Edit: I've also tried to use WebForm_OnSubmit() but that doesn't work either. When using Developer Tools in IE to look at the markup, the css is being overwritten by the time I see it.
Martin
Telerik team
 answered on 17 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?