Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
261 views
Dear Sir,
Please Review the Attached Example, you will see that the RadDatePicker is not aligned to right corectly when using right to left mode.

<

table dir="rtl">
    <

tr> 

        <td style="height: 24px" nowrap="nowrap">  
            <asp:Label ID="Label5" runat="server" Text="Label"></asp:Label> 
        </td> 
        <td nowrap="nowrap">  
            <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> 
        </td> 
    </tr> 
    <tr> 
        <td style="height: 24px" nowrap="nowrap">  
            <asp:Label ID="Label6" runat="server" Text="Label"></asp:Label> 
        </td> 
        <td nowrap="nowrap">  
            <telerik:RadDatePicker ID="RadDatePicker" runat="server" Calendar-Enabled="true" ShowPopupOnFocus="true"></telerik:RadDatePicker> 
        </td> 
    </tr>
</table>
 
Mohamed Salah Al-Din
Top achievements
Rank 1
 answered on 29 Dec 2009
2 answers
1.1K+ views
Hi,

I have a simple checkbox in my RadToolbar in an item template.  The checkbox square appears aligned vertically correctly, but the associated Checkbox text appears to be lower.

Is there some stylesheet seeting i need to apply to this?

Its the 2008 Q3 SP1 version, applicable to both FF3.5 and IE8.  Other browsers and versions untested.


Paul.
Prasad
Top achievements
Rank 1
 answered on 29 Dec 2009
2 answers
67 views
<telerik:GridTemplateColumn HeaderStyle-VerticalAlign="Middle" UniqueName="TypeOfLead" 
                                            HeaderText="Action" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="40">  
                                            <ItemTemplate> 
                                                <asp:LinkButton ID="imgbActivityEdit" runat="server" ImageUrl="../Images/icons/icon_edit.gif" 
                                                    ToolTip="Edit" OnCommand="gvActivity_RowEditing" CommandArgument='<%# Eval("[Activity_Id]") %>'>  
                                                    <img src="../Images/icons/icon_edit.gif" alt="Edit"/></asp:LinkButton> 
                                                <asp:LinkButton ID="imgbActivityDelete" runat="server" ImageUrl="../Images/icons/icon_delete.gif" 
                                                    ToolTip="Delete" OnCommand="ActivityDelete_Click" CommandArgument='<%# Eval("[Activity_Id]") %>'>  
                                                    <img src="../Images/icons/icon_delete.gif" alt="Delete"/></asp:LinkButton> 
                                                <asp:Label ID="lblActivityId" runat="server" Text='<%# Eval("[Activity_Id]") %>' 
                                                    Visible="False"></asp:Label> 
                                                <asp:Label ID="lblActivityType" runat="server" Text='<%# Eval("[Activity_Type]") %>' 
                                                    Visible="False"></asp:Label> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
protected void gvActivity_RowEditing(object sender, CommandEventArgs e)  
    {  
 
                txtDate.Text = ((GridTableCell)gvLeadsHistory.Items[0].Controls[0]).ToString();  
          
 
 
    } 
hi please refer the attached, there i have template columns edit, and delete.

im using Commandevent args alone, since im done with delete and other using the same i should use it for edit too.
in above code im getting Telerik.Web.UI.GridTableCell as out put in the text box. i need the row contents please help.
Saran kumar
Top achievements
Rank 1
 answered on 29 Dec 2009
1 answer
112 views
Hello,
         I m using RadToolBar.. I want to do a client side validation in OnClientButtonClicked() function.

 

function OnClientToolBarButtonClicked(sender, eventArgs)

 

{

 

var button = eventArgs.get_item();

 

 

 

if(button.get_text() == "Delete")

 

{

 

if(confirm("Are you sure you want to delete?"))

 

{

 

return true;

 

}

 

else

 

 

return false;

 

}

}

When the user presses ok then go ahead and delete otherwise return as we do in Javascript.

Thanks,
Bharani

Shinu
Top achievements
Rank 2
 answered on 29 Dec 2009
16 answers
937 views
Good evening,

I'm trying to upgrade an exsiting project from an older version of Rad Controls to Q3 2008 (2008.3.1105.20 to be precise).  I've carefully read all the backwards compatability and upgrade pages, however I still can't get my RadAjaxManager to make a server call using javascrip.   My default aspx code is shown below.   My first request fails witht the following message: Microsoft JScript runtime error: Object doesn't support this property or method

I've included the script manager at the very top
I've surrounded my javascript with the codeblock tag
made sure my javascript is in the form (not outside of it)

The first request that occurs is near the bottom in the ResetTimer() function.  Once that works I can move on to changing the rest of the code.  It just passes the string  "keepalive" as the argument.

I've tried to declare the AjaxManager in every possible way but I still can't get it to work.  I'm sure it's something simple but I am out of ideas.  Anyone see the problem?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
<%@ Register Assembly="Telerik.Web.UI" 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
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> 
</head> 
<body style="margin: 0px" background="Images/<%=Application("Logo")%>" onload="javascript:Login();" onunload="javascript:CloseOut();" > 
    <form id="form1" runat="server">  


   <Telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
    
   <!-- Rad Menu  -------------> 
        <div style="position:absolute; z-index:90000;"
         
        <Telerik:RadMenu ID="RadMenu1" runat="server" Width="99%" AppendDataBoundItems="True" CollapseDelay="1500" Skin="Gray"  CollapseAnimation-Type="None" OnClientItemClicked="clickHandler"   > 
            <Items> 
                <Telerik:RadMenuItem  Text="Tools"  runat="server" > 
                    <Items> 
                         
                        <Telerik:RadMenuItem Text="Log in"   NavigateUrl="javascript:Login();" runat="server" > 
                        </Telerik:RadMenuItem> 
                             
                        <Telerik:RadMenuItem  Visible="False"  Text="Log out" NavigateUrl="javascript:Logout();" runat="server"
                        </Telerik:RadMenuItem> 
                              
                        <Telerik:RadMenuItem Visible="False"  Text="Change Password" runat="server" NavigateUrl="javascript:ShowPass();"
                        </Telerik:RadMenuItem> 
                     
                    </Items> 
                </Telerik:RadMenuItem> 
            </Items> 
            <CollapseAnimation Type="None" Duration="200" /> 
        </Telerik:RadMenu> 
   </div> 
    
   <script type="text/javascript">    
    function clickHandler(sender, eventArg)    
        {        
            if (eventArg.Item.Items.length == 0 ) 
            {        
            i = eventArg.Item.Menu.Close(); 
            } 
        }        
    </script>   
 
 
   <!-- Rad Menu  -------------> 
         
         
        <Telerik:RadAjaxManager id="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" > 
            <AjaxSettings> 
                <Telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                    <UpdatedControls> 
                        <Telerik:AjaxUpdatedControl ControlID="RadMenu1" /> 
                    </UpdatedControls> 
                </Telerik:AjaxSetting> 
            </AjaxSettings> 
        </Telerik:RadAjaxManager> 
    
    
        <Telerik:RadAjaxLoadingPanel id="AjaxLoadingPanel1" Runat="server" height="75px" width="75px"
            <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/RadControls/Ajax/Skins/Default/Loading.gif" /> 
        </Telerik:RadAjaxLoadingPanel> 
 
        <Telerik:RadWindowManager ID="RadWindowManager1" runat="server" Left="" Title="" Top="" Skin="Inox"
        <Windows> 
           <Telerik:RadWindow ID="Default" runat="server" ReloadOnShow="True"   Behavior="Minimize, Close, Move" Left="" Top="" style="display:none;" Behaviors="Minimize, Close, Move" InitialBehavior="None" NavigateUrl=""  /> 
           <Telerik:RadWindow ID="RackBuild" runat="server" NavigateUrl="Rack/RackBuild.aspx"  ReloadOnShow="True"   Behavior="Minimize, Close, Move" Left="" Top="" style="display:none;" Behaviors="Minimize, Close, Move" InitialBehavior="None"  /> 
           <Telerik:RadWindow ID="RackInquiry" runat="server" NavigateUrl="Rack/RackInquiry.aspx"  ReloadOnShow="True"   Behavior="Minimize, Close, Move" Left="" Top="" style="display:none;" Behaviors="Minimize, Close, Move" InitialBehavior="None"  /> 
        </Windows> 
        </Telerik:RadWindowManager> 
 
 
 
<telerik:RadCodeBlock ID="cb1" runat="server"
 
 
    <script type="text/javascript" > 
 
    var UserActive = false
    var usertimer = 0
    var timer = -1; 
    var currentTime = new Date() 
    var Minutes = currentTime.getMinutes() - 1 
    var Sess = ''
      
     
    document.body.onkeydown = function() {ResetTimer();}; 
    document.body.onclick = function() {ResetTimer();}; 
    document.onmousemove = function() {ResetTimer();}; 
 
 
    function OpenNewWindow(url, details) 
    { 
     var oManager = GetRadWindowManager();  
     var oNew = oManager.Open(url, details);  
    } 
     
     
    function SetWindow(ID, URL) 
    { 
    var oManager = GetRadWindowManager();  
    var oWnd = oManager.GetWindowByName(ID);  
    oWnd.SetUrl(URL); 
    oWnd.Show(); 
    } 
     
     
    function OpenWindow(ID) 
    {  
        //Getting RadWindow manager 
        var oManager = GetRadWindowManager();  
     
        try 
        { 
           //Success. Getting existing window DialogWindow using GetWindowByName 
            var oWnd = oManager.GetWindowByName(ID);  
            oWnd.Show(); 
           
        } 
        catch(err) 
        { 
            alert('This page is not found.\nI still have to build this screen.\nTry again later.'); 
        } 
 
    }  
     
     
    function ShowPass() 
    { 
     
    showModalDialog('password.aspx','Passed String','dialogHeight:195px;dialogWidth:550px;toolbar:no;directories=no;status=no;menubar=no;scroll:no;resizable=no;modal=yes') 
     
    } 
 
 
    function Login() 
    { 
     
         
        if ('<%=application("NPP")%>' != '') 
        { 
           alert('<%=application("NPP")%>'); 
        } 
     
        var x = '' 
        x = showModalDialog('Login.aspx','Passed String','dialogHeight:450px;dialogWidth:395px;toolbar:no;directories=no;status=no;menubar=no;scroll:no;resizable=no;modal=yes'); 
        if (x == undefined) 
        { 
        //alert('Log in Failed'); 
        } 
        else 
        { 
             window["<%= RadAjaxManager1.ClientID %>"].AjaxRequest('Login'); 
             UserActive = false
             usertimer = 0
             timer1 = window.setTimeout(CheckActive,1000); 
              
             if (x.split("|")[1]) { ForcePass(); } 
              
        }  
    } 
 
 
    function Logout() 
    { 
        var oManager = GetRadWindowManager(); 
        oManager.CloseAll(); 
        window["<%= RadAjaxManager1.ClientID %>"].AjaxRequest('Logout'); 
        Login() 
    } 
 
 
    function CloseOut() 
    { 
        if (Sess != '') 
        { 
        window.open('logout.aspx?S='+Sess,'mywin','width=450,height=150,toolbar=0,resizable=0'); 
        } 
    } 
 
 
 
    function ResetTimer()  
    { 
        UserActive = true
        currentTime = new Date() 
        if (Minutes != currentTime.getMinutes()) 
        { 
            Minutes = currentTime.getMinutes() 
            

  //PROBLEM IS HERE

//No matter how I declare this the method is not found
// I've used both capital and lower case "a" in the method
//tried document.getelementbyID
// tried $find

    var ajaxManager = <%= RadAjaxManager1.ClientID %>
            ajaxManager.AjaxRequest('KeepAlive'); 
             
           
           
        } 
    } 
     
     
 
 
    function CheckActive()  
    { 
        if (UserActive)   
        { 
            UserActive = false
            usertimer = 0 
            timer1 = window.setTimeout(CheckActive,1000); 
            return true; 
        } 
 
        usertimer++; 
         
        if (usertimer  > <%=(session.Timeout * 60) - 45 %>
        { 
        Logout() 
        return true; 
        } 
         
    timer1 = window.setTimeout(CheckActive,1000); 
    } 
 
 
</script> 
</telerik:RadCodeBlock> 
 
 
    </form> 
  </body> 
</html> 
 
 


Thanks in advance,
-Sharif
Miche B
Top achievements
Rank 1
 answered on 29 Dec 2009
0 answers
85 views
I know this has been asked in various ways before but I'm not finding a concise set of rules to follow.  I have a page with some user controls.  Each control is simply a wrapper around server controls, specialized to populate with specific data.  They are UC's rather than new SC's, in case I need to add other components to each.  The ordering of the data binding is important, as data for a RadGrid (for example) is generated using data selected in a RadComboBox plus a date from a RadDatePicker.  The problem is that the ObjectDataSource on the RadGrid is databinding before the other controls.  I believe the problem is that I've assigned the ODS to the grid in markup, but I'm not sure exactly where I'd implement the databinding operation manually.

I have a RadAjaxManager on the web form, and in code-behind I'm doing a FindControl to get the controls from each UC and then manually adding these to AjaxManagerSettings.  This is what triggers the Ajax postbacks for each control.  I don't know if that helps to determine the best way to approach this.

Thank you very much for any advice - or links to RTM...

[ Follow-up ] I've implemented DataBind event handlers for the page containing the UCs and in each UC. Then I manually fire DataBind() when needed.  This seems to be working.  If anyone is interested I can document this better but the idea is to avoid letting DataBind get automatically fired or handled for page, usercontrol, and components, and instead to ensure you manage the process.  If anyone has a better way to do this, as the Ferengi say, I'm all ears.  :)
TonyG
Top achievements
Rank 1
 asked on 28 Dec 2009
1 answer
114 views
Within RadEditor if I type words like "test" or "world" the spell checker understands the words and does not show as errors. But If I miss type as "tets" or "wordl" the suggested words list does not have the words test or world in it. But If I type worldd or testt, the suggested words have world or test in it.


for example:

type the below into a radEditor and run SpellChecker....

world worldd wordl test tets testt

Is this a bug or can I tweak the code to do it right?
Rumen Jekov
Top achievements
Rank 1
 answered on 28 Dec 2009
2 answers
104 views
I have the following elements on a page: RadComboBox, RadGrid, and an Edit/Insert form. The RadComboBox is used to filter the RadGrid and items selected from the RadGrid populate the edit form. One of the items on the form is the filter value from the RadComboBox.

Scenario #1
Filter the RadGrid
Select an Item from the RadGrid
Edit the item so the Current filter no longer applies.

The result I want:
Reset the RadComboBox to the updated filter value from the form.
Select newly edit item in the RadGrid (Note: This NOT a problem until you add paging to the RadGrid)

Scenario #2
Using the insert form to add a new item

The result I want:
Set the RadComboBox to the newly inserted items filter value.
Select the newly created item in the RadGrid (Note: Again this is NOT a problem until you add paging to the RadGrid)

I guess my basic problem is how to find an item in a paged RadGrid when you don't know what page the item is on. Essentially I want to take an id find out what page it is on, set the correct page index, and select the correct row.

I hope that made sense.

Thanks,

Scott
Scott
Top achievements
Rank 1
 answered on 28 Dec 2009
2 answers
461 views
I have RadListBox1 and RadListBox2.  They are parked in a RadPageView attached to a RadTab.  Either listbox can transfer (move) items from one to the other with the transfer button, 2x-click, or drag-n-drop.  Everything is cool.  I have a "Save" button, the purpose of which is to update RadListBox2's database table.  On button_click I am grabbing the items in RadListBox2 as a collection, parsing the collection, and transforming into a comma-delimited string all on the client in order to pass through RadAjaxManager1_AjaxRequest:

function btnClick() {  
    var list = $find("<%= radListBox2.ClientID %>");  
    var lstNames = list.get_items();  
    var arg;  
 
    if( lstNames.get_count() == 0 ) {  
 
        if (confirm("blah, blah, blah.\n\nProceed?")) {  
            arg = 0;  
        } else { return 0; }  
 
    } else {  
        arg = lstNames.get_count() + ",";  
        lstNames.forEach( function( item ) { arg = arg + item.get_text() + ","; });  
        arg = arg.substr( 0, arg.length - 1 );  
    }  
 
    var ajaxMgr = $find("<%= RadAjaxManager1.ClientID %>");  
    ajaxMgr.ajaxRequest( arg );  

I have confirmed through JavaScript alerts that all is well here.  BUT - ajaxMgr.ajaxRequest( arg ) doesn't fire its associated method in the code-behind.  RadScriptManager is set:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"

I have Ajax turned on in Page_Load:

RadAjaxManager.GetCurrent( Me ).EnableAJAX = True 

I have AutoPostBackOnTransfer turned off on both listboxes because nothing works when switched on:

radListBox1.AutoPostBackOnTransfer = False 
radListBox2.AutoPostBackOnTransfer = False 

And the code-behind method looks fine to me:

Protected Sub RadAjaxManager1_AjaxRequest( sender As Object, e As AjaxRequestEventArgs ) Handles RadAjaxManager1.AjaxRequest  
    Dim str_Array As String() = Split( e.Argument, "," )  
    Dim numRecords = Integer.Parse( str_Array( 0 ))  
    Dim lst_Tables As IList( Of String ) = New List( Of String )  
    Dim p_data As String = String.Empty   
 
    If numRecords > 0 And numRecords < 10 Then  
        p_data = e.Argument.Substring( 2 )  
    ElseIf numRecords > 9 And numRecords < 100 Then  
        p_data = e.Argument.Substring( 3 )  
    Else  
        p_data = e.Argument.Substring( 4 )  
    End If  
 
    ' sanity check  
    RadAjaxManager1.Alert( "numRecords = " & numRecords )  
    RadAjaxManager1.Alert( "p_data = " & p_data)  
 
    * * *  
End Sub 

But my sanity checks are never invoked.

Got any clues, guys?

Cheers!
Mark
Mark Galbreath
Top achievements
Rank 2
 answered on 28 Dec 2009
4 answers
315 views
Hello,
        Wish you all merry christmas and a happy new year.  I want to change the color of the text in a RadTextBox control dynamically OnMouseOut. I want to do it on Client-Side. I checked the Input styles properties. and I didnt see any method to set the style of input. I saw get_style() but not set_style, not sure how to do it..


Thanks,
Bharani
Dimo
Telerik team
 answered on 28 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?