Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
173 views
Hi, I'm having troubles with $get.
I have a <asp:HiddenField> on my page and I want to read its value using Javascript.
the HiddenField's ID is 'reloadUrl'. I  tried the following methods:
var control = $get("reloadUrl");
var control = $get("<%= reloadUrl.ClientID %>");
var control = $get("<%= this.reloadUrl.ClientID %>");
But all of them return the following message: "$get(...) is null"

My page is a content page and the HiddenField is nested in two or three controls.
What can I do?

PS: I have a RadAjaxManagerProxy on my content page and a RadAjaxManager & ScriptManager on my master page.
May be I have to use another function provided my RadAjaxManager..?
SamJ
Top achievements
Rank 1
 answered on 03 Sep 2009
4 answers
144 views
in the article http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesusercontrolformtemplate.html it is well explained how to set properties of controls inside a user control, when a user control is being used as an insert/update form in a radgrid.

How do I set a public property of that same user control?


Veli
Telerik team
 answered on 03 Sep 2009
2 answers
160 views
I have two listboxes (source and destination listbox)

I added server side code to have the checkbox checked in the destination listbox depending on a database value. Here is the code to do that. But when I transfer one of the items back to the source listbox, all the checkboxes get unchecked in the destination listbox. Can you tell me why this is happening?

        protected void RadListBoxDestination_Inserted(object sender, RadListBoxEventArgs e)
        {
            string selectedQlfr = QlfrDropDown.SelectedValue;
            BtodGenericGrid GridSchema = BtodGenericGrid.CreateInstance(selectedQlfr, "Default", "-1");
            for (int i = 0; i < e.Items.Count; i++)
            {
                string colName = e.Items[i].Text.ToString().ToUpper();
                for (int x = 0; x <= GridSchema.ColumnNamesWithAliasSplit.Length - 1; x++)
                {
                    if (colName == GridSchema.ColumnNamesWithAliasSplit[x].ToUpper())
                    {
                        if (GridSchema.ColumnVisibleSplit[x].ToString() == "1")
                        {
                            e.Items[i].Checked = true;
                        }
                        break;
                    }
                }
             //   e.Items[i].Checked = true;
            }

        }
Simon
Telerik team
 answered on 03 Sep 2009
3 answers
137 views

Hi everyone,

 

I am using RadDatePicker control customized to a month/year picker with solution found here:

http://www.telerik.com/community/code-library/submission/b311D-mdkhb.aspx

 

My date picker control resides on the Ajax update panel.

After postback Calendar popup defaults back to simple calendar with days. 
What can be done to ensure that this Month/Year picker persists after an ajax postback?
 

Here is my sample web page:  


<%@ Page Language="C#" AutoEventWireup="true" Culture="en-US" CodeFile="Default.aspx.cs" 
    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>Untitled Page</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager>  
    <div>  
 
        <script type="text/javascript">  
            //override the onload event handler to change the picker after the page is loaded  
            window.onload = function()  
            {  
                window.setTimeout(function() { setCalendarTable(); }, 200)  
            }  
 
            function setCalendarTable()  
            {  
 
                var picker = $find("<%= RadDatePicker1.ClientID %>");  
                var calendar = picker.get_calendar();  
                var fastNavigation = calendar._getFastNavigation();  
 
                $clearHandlers(picker.get_popupButton());  
                $addHandler(picker.get_popupButton(), "click", function()  
                {  
                    var textbox = picker.get_textBox();  
                    //adjust where to show the popup table   
                    var x, y;  
                    var adjustElement = textbox;  
                    if (textbox.style.display == "none")  
                        adjustElement = picker.get_popupImage();  
 
                    var pos = picker.getElementPosition(adjustElement);  
                    x = pos.x;  
                    y = pos.y + adjustElement.offsetHeight;  
 
                    var e = {  
                        clientX: x,  
                        clientY: y  
                    };  
                    //synchronize the input date if set with the picker one  
                    var date = picker.get_selectedDate();  
                    if (date)  
                    {  
                        calendar.get_focusedDate()[0] = date.getFullYear();  
                        calendar.get_focusedDate()[1] = date.getMonth() + 1;  
                    }  
 
                    $get(calendar._titleID).onclick(e);  
                });  
 
                fastNavigation.OnOK =  
                    function()  
                    {  
                        var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);  
                        picker.get_dateInput().set_selectedDate(date);  
                        fastNavigation.Popup.Hide();  
                    }  
 
 
                fastNavigation.OnToday =  
                    function()  
                    {  
                        var date = new Date();  
                        picker.get_dateInput().set_selectedDate(date);  
                        fastNavigation.Popup.Hide();  
                    }  
            }     
        </script>  
          
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
       <ContentTemplate>  
          <telerik:RadDatePicker ID="RadDatePicker1" runat="server">  
               <DateInput DateFormat="MMMM yyyy">  
               </DateInput>  
               <Calendar>  
                   <FastNavigationSettings TodayButtonCaption="current date" />  
               </Calendar>  
           </telerik:RadDatePicker>    
       </ContentTemplate>  
          <Triggers>  
             <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />  
          </Triggers>  
       </asp:UpdatePanel>  
      
    <asp:Button ID="Button1" runat="server" Text="PostBack" OnClick="Button1_Click" />      
      
    </div>  
    </form>  
</body>  
</html> 

 protected void Button1_Click(object sender, EventArgs e)  
   {  
      this.RadDatePicker1.SelectedDate = DateTime.Now;   
    } 

I am using 2008.1.515.20 version of RadDatePicker control.

Please help me to fix/solve this.

Thanks in advance,

 

Igor.

 

Pavlina
Telerik team
 answered on 03 Sep 2009
6 answers
252 views
Hi,
every now and again, i receive the red X instead of the actual chart image.
This does not happen everytime, and i cant seem to predict when and why it does this.

Is there any reason for this and if so, how do i stop this please ?

Many Thanks
Mark
Vladimir Milev
Telerik team
 answered on 03 Sep 2009
2 answers
112 views
I am having an issue where the dropdown for the datagrid is badly formatted and the numbers are not displayed correctly. I am using the default configuration and have not changed any styles. Can anyone please help?

The dropdown list for the page size is showing both vertical and horizontal scroll bars.
Danny
Top achievements
Rank 1
 answered on 03 Sep 2009
4 answers
158 views
¿What's the best approach to use Skins and CSS simultanously in a RadControl, and specifically in RadGrid?  I would like to use the features provided from Skins but I need to customize some specific aspects, for example: ItemStyle, AlternatingItemStyle, FooterStyle, HeaderStyle, and so on, with no losing Skins capabilities.

Thanks in advance
Dimo
Telerik team
 answered on 03 Sep 2009
1 answer
108 views
Hello,

I'm opening a radwindow via the radmanager show and inside the window I have some .net controls. The window opens via an image button trigger.

The first time the window opens, everything is good, it opens smooth like a true ajaxified control.

When I close the window, returning to my main screen and then reopen the window by clicking on the image button again, it flickers the second time. All of the content inside the radwindow flickers, unlike a true ajaxified control.

I'm wondering why this issue exists on the second time around.... ?? Why would the window not flicker the first time, but flicker the second time (when closed and reopened)?

Any assistance is mucho appreciated with a BIG thank you. Thanks!
Veli
Telerik team
 answered on 03 Sep 2009
2 answers
140 views
Hi,
I'm trying to get started with the controls but am having some problems.
I installed them on one machine and kept receiving the "Can not cast" errors."  So, I installed SP1.  That did not help
So, just in case my environment was messed up,  i created a completely clean dev environment as follows:
1.  Started with a completely clean VM of XP with SP3
2. Installed VS 2008
3. Installed vs sp1
4. installed RadControls_for_ASP.NET_AJAX_2009_2_701_trial.msi

Then, just to see if I was still having the problem I created a RadCrontrols VB.Net Web Application project.
From there I did the following:
1. Drop a RadTreeView onto Default.aspx
2. Error - Unable To Cast...
3. Close Default.aspx and reopen it - it is fine
4. Use "Build RadTreeView" to add a few nodes.
5. Error - RadTreeView - RadTreeView1There was an error rendering the control.
Unable to cast object of type 'Telerik.Web.UI.RadTreeView' to type 'Telerik.Web.UI.ControlItemContainer'.
6. Close and reopen Default.aspx - it is fine
7. Add a Grid
8. Run it.
9. Delete the grid
10. Close and open default.aspx - Error in both RadTreeView sections - Error Creating Control - RadTreeView2'Nodes' could not be initialized. Details: [A]Telerik.Web.UI.RadTreeView cannot be cast to [B]Telerik.Web.UI.RadTreeView. Type A originates from 'Telerik.Web.UI, Version=2009.2.701.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' in the context 'LoadNeither' at location 'C:\Documents and Settings\xpUser1\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies\j4t8j5az01\telerik.web.ui.dll'. Type B originates from 'Telerik.Web.UI, Version=2009.2.701.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' in the context 'LoadNeither' at location 'C:\Documents and Settings\xpUser1\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies\4xzcagnf01\Telerik.Web.UI.dll'.
11. Close and open again - same errors
12. Close and open VS - everything is fine

Based on the articles I found, this should not be happening with SP1.

Does anyone know how to permanently eliminate (or at least work around in a reasonable fashion) this type of issue? 

Thanks

Pavlina
Telerik team
 answered on 03 Sep 2009
2 answers
126 views

I have a GridTemplateColumn like this:

<telerik:GridTemplateColumn UniqueName="PrsSex" GroupByExpression="PrsSex Group By PrsSex">  
    <HeaderTemplate> 
      <asp:Label runat="server">PrsSex</asp:Label> 
    </HeaderTemplate> 
    <ItemTemplate> 
      <asp:Label   
Text='<% #Eval("PrsSex").ToString()== "0" ? "Female" : "Male" %>' runat="server" />                                            </ItemTemplate>                                          
</telerik:GridTemplateColumn> 
 

I want to change its name in groupPanel from "PrsSex" to "Sex". In GridGroupsChangingEventHandler I am trying to change its HeaderText like below, but it does not work!

private void grdPrs_GroupsChanging(object source, GridGroupsChangingEventArgs e)  
    {  
        //Expression is added (by drag/grop on group panel)  
        if (e.Action == GridGroupsChangingAction.Group)  
        {  
            if (e.Expression.GroupByFields[0].FieldName == "PrsSex")  
            {  
                e.Expression.GroupByFields[0].HeaderText = "Sex";  
            }  
     }  
}  
 
Thanks.
azin ramezani
Top achievements
Rank 1
 answered on 03 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?