Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
434 views
Hi,

I am trying to reference a radTextBox through javascript to capitalize its value on blur and keypress event.
However, $find(client-Side-Object-Name) returns null in IE whereas it works fine in firefox (3.5.5).

The version of our telerik is 2008.3.1314.35

<telerik:RadScriptBlock ID="radScriptBlock" runat="server"
    <script type="text/javascript"
 
        AddPageLoadHandler(function() 
        { 
            AutoCapitaliseFirstChar('<%= FirstNameTextBox.ClientID %>'); 
        }); 
         
    </script> 
    </telerik:RadScriptBlock> 
function AddPageLoadHandler(fn) 
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fn); 
// not created dynamically 
<telerik:RadTextBox runat="server" ID="FirstNameTextBox" /> 
// These client-side functions auto-capitalises text in RadTextBox as user enters it 
// The conversion is done after a short timeout to avoid interfering with normal onfocus behaviour 
function AutoCapitaliseFirstChar(radTextBoxClientId) { 
 
    var radTextBoxClientObject = $find(radTextBoxClientId); 
    // here radTextBoxClientObject is null for IE but not for firefox 
    // so it works fine with firefox not with IE 8 
 
    // This converts the text when field loses focus 
    $(radTextBoxClientObject.get_element()).blur(function() { 
        setTimeout(function() { 
            var val = radTextBoxClientObject.get_value(); 
            radTextBoxClientObject.set_value(val.substring(0, 1).toUpperCase() + val.substring(1)) 
        }, 200); 
    }); 
 
    // Except in Safari, convert the text as it is typed 
    // (in Safari this is incompatible with the field autocomplete behaviour) 
    if (!$.browser.safari) { 
        $(radTextBoxClientObject._textBoxElement).keypress(function() { 
            setTimeout(function() { 
                var val = $(radTextBoxClientObject._textBoxElement).val(); 
                radTextBoxClientObject.set_value(val.substring(0, 1).toUpperCase() + val.substring(1)) 
            }, 200); 
        }); 
    } 
Any ideas would be appreciated,

regards,

Toby


Ganesh
Top achievements
Rank 1
 answered on 15 Oct 2013
1 answer
186 views
Hi

I'm trying to use the following in particular the JavaScript option: http://www.telerik.com/help/aspnet/window/openwindowfrommenu.html

The pop up isn't opening, I know I'm hitting the function but I get the following error - unable to get property 'Text of undefined or null reference' on the line

eventArgs.Item.Text

Any Ideas.

Andy

 

Kate
Telerik team
 answered on 14 Oct 2013
3 answers
238 views
For consideration in a future release the RadDataPager should allow registration to an OnPageSizeChanged event. I am handling the databinding and paging in code behind going through a WCF tier; however, I had to remove the change PageSize functionality from the end user because this event doesn't exist.

The Functionality should be like this to mirror the PageIndexChanged event:

ASPX:

                <telerik:RadDataPager ID="RadDataPager1" runat="server" OnPageIndexChanged="RadDataPager1_PageIndexChanged"
                    OnTotalRowCountRequest="RadDataPager1_TotalRowCountRequest"
    OnPageSizeChanged="RadDataPager1_PageSizeChanged" Skin="Windows7">
                   ...
                </telerik:RadDataPager>

Code Behind:

    protected void RadDataPager1_PageSizeChanged(object sender, RadDataPagerPageSizeChangeEventArgs e)
    {
        int NewPageSize = e.NewPageSize;
...
    }

Cheers,
Andrew.


   
Michael
Top achievements
Rank 1
 answered on 14 Oct 2013
3 answers
121 views
Hi,

I have a RadTabStrip linked with a RadMultiPage.

ASPX:
<telerik:RadTabStrip ID="tsConfig" runat="server" MultiPageID="mpConfig" SelectedIndex="0"
        Width="100%" Skin="Office2010Silver" OnClientTabSelecting="OnTabSelecting_CheckPageView">
        <Tabs>
            <telerik:RadTab Text="Tab 1" PageViewID="rpvGeneral" Width="150px">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 2" PageViewID="rpvPhoto">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 3" PageViewID="rpvListePatients">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 4" PageViewID="rpvListesPrescriptions">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 5" PageViewID="rpvPrescripteur">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="mpConfig" runat="server" SelectedIndex="0" Width="100%"
        BackColor="White" Height="500px" BorderColor="Silver" Style="overflow: hidden;">
        <telerik:RadPageView runat="server" ID="rpvGeneral">
            <cgsi:ConfigGeneral runat="server" ID="ucConfigGeneral" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvPhoto" Visible="false">
            <cgsi:ConfigPhoto runat="server" ID="ucConfigPhoto" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvListePatients" Visible="false">
            <cgsi:ConfigListePatients runat="server" ID="ucConfigListePatients" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvListesPrescriptions" Visible="false">
            <cgsi:ConfigListesPrescriptions runat="server" ID="ucConfigListesPrescriptions" />
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvPrescripteur" Visible="false">
            <cgsi:ConfigPrescripteur runat="server" ID="ucConfigPrescripteur" />
        </telerik:RadPageView>
    </telerik:RadMultiPage>

VB:
Private Sub tsConfig_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles tsConfig.TabClick
        e.Tab.PageView.Visible = True
    End Sub

My problem is that in the ascx named "ucConfigPrescripteur" I have a RadComboBox that I set the width to 160px. But for some reason, on the page, the combobox is set to 260px until I do a postback it will set it to 160px.

This is only happenning with RadMultiPage.

Thanks.
Kate
Telerik team
 answered on 14 Oct 2013
1 answer
131 views
Hello,

Is there a way to have events, such as RadDatePicker.ClientEvents.OnDateSelected or RadListBox.OnClientSelectedIndexChanged, handle functions with arguments, apart from "sender" and "eventArgs"?
The following code doesn't do it completely right:

RadListBox rlb = new RadListBox();
rlb.OnClientSelectedIndexChanged = "ToSomething('Aaa', 'Bbb', 'Ccc')";
function DoSomething(a, b, c)
{
   //code
}

Thanks in advance.
Laurens
Top achievements
Rank 1
 answered on 14 Oct 2013
13 answers
225 views
Hello,

How would i be able to switch from using regular text boxes which uses
boundColumn = new GridBoundColumn();

When creating a radgrid dynamically to using Radautocomplete text boxes?

Brad
Top achievements
Rank 1
 answered on 14 Oct 2013
3 answers
117 views
Hi Friends,
I'm new to telerik code
Can you please tell me how to modify tool tip  instead of "Go to root " i want to change it to "Go to Top" ? Can you please suggest me.

 Thanks,

Peter Filipov
Telerik team
 answered on 14 Oct 2013
1 answer
96 views

Below is my code, all of it.  When I click the button, the RadAlert only appears for an instant. Why?

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm10.aspx.vb" Inherits="Easiest_Way.WebForm10" %>
  
<!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" />
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
        <div>
            <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" OnClientClicked="ClientClicked" />
        </div>
    </form>
</body>
<script type="text/javascript">
    function ClientClicked(sender, e) {
        radalert("Hi!");
        return false;
    }
</script>
</html>

 

Marin Bratanov
Telerik team
 answered on 14 Oct 2013
1 answer
195 views
Is it possible to put an entire radgrid within modalpopupextender? If so, does anyone have a simple example on how to do this?
Konstantin Dikov
Telerik team
 answered on 14 Oct 2013
1 answer
81 views
We have a RadScheduler using a web service binding with ResourcePopulationMode="ServerSide".  The GetResources method is as per the documentation:
[WebMethod]
public static IEnumerable<ResourceData> GetResources(MySchedulerInfo schedulerInfo)
{
    return Controller.GetResources(schedulerInfo);
}
If we call RadScheduler1.Rebind() in the code behind then GetResources is called but the resources are added to the RadScheduler rather than replacing them, with the result that duplicate resources appear.

Is this the expected behaviour?  Are we supposed to be rebinding the scheduler differently?
Plamen
Telerik team
 answered on 14 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?