Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
114 views
Hi,

I am using the RadScheduler control in one of my aspx web pages.  All is working well with it,

However, we have been given a new requirement for a new release to Localize our applications contents to German, Spanish, Japanese and diferent flavours of English.

Therefore, what would I need to do to take account of localizing property text such as the following properties in the Scheduler control:

DataStartField

 

="Start"

 

 

DataEndField="End"

 

Localization-ConfirmDeleteText

 

="Are you sure you wish to delete this schedule item?"

 

 

 

 

 


We will most likely need to use the browsers locale settings to determine the locale to display the appropriate text strings.

Will I be able to use aspx techniques such as the meta keyword to populate the above or do I need to do something else?

Thanks,

Ross 

 

Princy
Top achievements
Rank 2
 answered on 27 Feb 2009
1 answer
181 views
hello and good day.
Problem: Radconfirm windows stops working after AjaxManager rebinds the mastertableview
I'm having a strange issue in regards to using the GridButtonColumn confirmtext and radwindow when trying to use the ajaxManager. I have deduced that is has to do with the method in wich I am loading the control into my base aspx page, but am at a loss as to how to work around it or deal with it. ie..if i just drop the control into a default.aspx page, it works as expected and the confirm window continues to popup on each click.  however if I am trying to work from within loaded viewstate, it seems to be destroyed.

Ctrls Code: (trimmed for brevity )
<telerik:RadWindowManager ReloadOnShow="true" ID="RadWindowManager1" runat="server">  
</telerik:RadWindowManager> 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="False">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                <telerik:AjaxUpdatedControl ControlID="TermCancel_App" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="DSTerm" GridLines="None">  
    <MasterTableView AutoGenerateColumns="False"   
     FilterExpression="[ApprovedBy] Is Null AND [ApprovedOn] IS Null AND RemoveFromView =0" 
    DataKeyNames="TermID,Emp_id,Lname" DataSourceID="DSTerminations">  
        <Columns> 
            <telerik:GridButtonColumn ConfirmDialogType="radWindow" ConfirmText="Continue with termination?" 
         CommandName="Complete" Text="Terminate" /> 
        <telerik:GridButtonColumn ConfirmText="Are you sure you want to cancel?" Text="Cancel"    
        CommandName="Cancel" ConfirmDialogType="RadWindow" UniqueName="column" /> 
        </Columns> 
        </MasterTableView> </RadGrid>
          


Base Page Source
<asp:panel id="Panel1" runat="server"></panel>

Base Page Code
    Private Property LatestLoadedControlName() As String  
        Get  
            Return CStr(ViewState("LatestLoadedControlName"))  
        End Get  
        Set(ByVal value As String)  
            ViewState("LatestLoadedControlName") = value  
        End Set  
    End Property  
 
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load  
        If Not (LatestLoadedControlName Is Nothing) Then  
            LoadUserControl(LatestLoadedControlName)  
        Else  
            LoadUserControl(ctrls(Request.QueryString("Page")))  
        End If  
    End Sub  
 
 
 
 
    Public Sub LoadUserControl(ByVal controlName As String)  
        If Not (LatestLoadedControlName Is Nothing) Then  
            Dim previousControl As Control = Panel1.FindControl(LatestLoadedControlName.Split("."c)(0))  
            If Not (previousControl Is Nothing) Then  
                Me.Panel1.Controls.Remove(previousControl)  
            End If  
        End If  
        Dim userControlID As String = controlName.Split("."c)(0)  
        Dim targetControl As Control = Panel1.FindControl(userControlID)  
        If targetControl Is Nothing Then  
            Dim userControl As UserControl = CType(Me.LoadControl(controlName), UserControl)  
            'slashes and tildes are forbidden  
            userControl.ID = userControlID.Replace("/", "").Replace("~", "")  
            Me.Panel1.Controls.Add(userControl)  
            LatestLoadedControlName = controlName 
        End If  
    End Sub  
 
 
    Function ctrls(ByVal ItemName As String) As String  
        Dim x As String = "" 
        Select Case ItemName  
            Case "Terminations"  
                x = "TerminationRequests.ascx" 
            Case Else  
                x = "DefaultCtrl.ascx" 
        End Select  
        Return x  
    End Function 


mac
Top achievements
Rank 1
 answered on 26 Feb 2009
3 answers
297 views
Hi,
 
I have a rad combo box code given below.

 <telerik:RadComboBox
                    ID="RadComboBox_Agency" runat="server"
                    Height="190px" Width="200px"
                    MarkFirstMatch="true" EnableLoadOnDemand="true" HighlightTemplatedItems="true"
                    DataTextField="CompanyName" DropDownWidth="375" ItemRequestTimeout="500"
                    OnItemsRequested="RadComboBox_Agency_ItemsRequested"
                    Skin="Vista">
                    <HeaderTemplate>
                        <table style="width: 375px" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="width: 125px;">
                                    Name
                                </td>
                                <td style="width: 125px;">
                                    Phone
                                </td>
                                <td style="width: 125px;">
                                    Zip
                                </td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table style="width: 375px" class="comboTable" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="width: 125px;" class="comboItemCell">
                                    <div class="comboItem">
                                        <%# DataBinder.Eval(Container.DataItem, "CompanyName")%>
                                    </div>
                                </td>
                                <td style="width: 125px;" class="comboItemCell">
                                    <div class="comboItem">
                                        <%# DataBinder.Eval(Container.DataItem, "Phone")%>
                                    </div>
                                </td>
                                <td style="width: 125px;" class="comboItemCell">
                                    <div class="comboItem">
                                        <%# DataBinder.Eval(Container.DataItem, "PostalCode")%>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:RadComboBox>



How do i have to get selected value in code behind.
Like 
RadComboBox_Agency.selectedvalue

Thanks.
Eva
kmccusker
Top achievements
Rank 1
 answered on 26 Feb 2009
1 answer
573 views

Is it possible to obtain the control object of a child control within a dynamically loaded usercontrol?

Structure:
Website has single master page containing a Telerik ScriptManager and AjaxManager as described in other postings.
User controls contain an AjaxProxyManager and one or more Telerik controls as well as standard controls. There is nothing specific/unique to the Telerik controls, this problem occurs regardless of the control type.

During page_init, required usercontrols are loaded onto the selected page within a placeholder.
Everything works properly- but I need to identify which control within the user controls caused the postback.

I am using a recursive method to search the controls collection within each control (see sample code below).
Following is within the Page_Init()

        If Page.IsPostBack Then  
            'get the name of the control that caused the postback  
            Dim ctlName As String = Request.Form("__EVENTTARGET")  
            'find the control   
            Dim thisCtrl As Control = FindControlRecursively(ctlName, Page)  
        End If  
 

 


I have tried mutliple recursive methods to find the control based upon the ID:
Public Shared Function FindControlRecursively(ByVal ControlID As String, ByVal ParentControl As Control) As Control  
        Dim c As Control  
 
        For Each c In ParentControl.Controls  
            Debug.WriteLine(c.ClientID.ToString)  
 
            If IsNothing(c.ID) = False AndAlso c.ID = ControlID Then  
                Return c  
            Else  
                If c.HasControls Then  
                    ' loop through this control collection as well, until we find what we are looking for.  
                    Dim foundcontrol As Control = FindControlRecursively(ControlID, c)  
                    If IsNothing(foundcontrol) Then  
                        Continue For  
                    Else  
                        Return foundcontrol  
                    End If  
                End If  
            End If  
        Next  
 
        ' if we didn't find the control by now, we aren't going to.  
        Return Nothing  
 
    End Function 
- or -
    Public Shared Function FindChildControl(ByVal start As Control, ByVal id As String) As Control  
        If start IsNot Nothing Then  
            Dim foundControl As Control  
            foundControl = start.FindControl(id)  
 
            If foundControl IsNot Nothing Then  
                Return foundControl  
            End If  
 
            For Each c As Control In start.Controls  
                foundControl = FindChildControl(c, id)  
                If foundControl IsNot Nothing Then  
                    Return foundControl  
                End If  
            Next  
        End If  
        Return Nothing  
    End Function  
 
but none of them have worked -

An example of a control name from a user control that has been dynamically added (in this instance the control is a LinkButton) is: 

"ctl00$ContentPlaceHolder1$ctl00$lnkMail" where "lnkMail" is the ID of the control and the containing parent controls are those that preceed it. Regardless of the methods used ( .FindControl ) or iterating and comparing .ID, .UniqueID, or .ClientID - none of those values come close to matching and .FindControl never finds it regardless of what I pass (the full name or a subset thereof), even if I identify the correct parent control and invoke .FoundControl on that object. When I iterate through the parent object the .ID values are NULL and the .UniqueID values are ctl00, ctl01, etc.

Using a single webform, .FindControl and either of the recursive functions work as expected. The problem appears to be related to dynamically loading the usercontrols and then trying to locate a child control within the placeholder.


topry
Top achievements
Rank 1
 answered on 26 Feb 2009
2 answers
1.0K+ views
I have <add key="Telerik.FormDecorator.EnableEmbeddedSkins" value="false"/> in my webconfig
and have copied the FormDecorator.Telerik.css (and it's images) to my solution as Button.Telerik.css and have registered this file in my page.

I am able to change the font color when clicking the button (which makes me think I am overriding the embedded form decorator successfully) but am not able to make it bold even if I do the following:

/* START OF CLICKED BUTTON STYLES */

/* Im not sure what the below style is for, but it doesn't seem to affect anything when I comment it out.

I will leave it here in case someone works out what it does.*/

a.radfd_Telerik.radfd_Clicked

{

 

background-image: url(Button/ButtonSprites.gif);

 

 

background-position: 0 -42px;

 

 

background-repeat: no-repeat;

 

}

 

/* Clicking the button */

a.radfd_Telerik.radfd_Clicked

span, a.radfd_Telerik.radfd_Clicked:hover span

 

{

 

background-image: url(Button/ButtonSprites.gif);

 

 

color: Black;

 

 

font: bold;

 

 

font-family: 'Segoe UI' , 'Arial' , 'Helvetica' , 'sans-serif';

 

 

font-size: 8pt;

 

 

font-weight: bolder;

 

 

 

 

 

}

 

a.radfd_Telerik.radfd_Clicked

.radfdInnerSpan

 

{

 

background-position: 0 -63px;

 

 

background-repeat: repeat-x;

 

}

a.radfd_Telerik.radfd_Clicked

.radfdOuterSpan

 

{

 

background-position: right -42px;

 

 

background-repeat: no-repeat;

 

}

/* END OF CLICKED BUTTON STYLES */


Does anyone know how to make the font bold when clicking the button?

thanks,
Kellie
Kellie
Top achievements
Rank 1
 answered on 26 Feb 2009
3 answers
195 views
Hi,
if we set Set the AllowPaging property to True and PageSize to 10, and we executed sql (e.g.select * from table), grid has all records from database or it has only 10 records?
And if we click next page (next 10 records) grid loads records from "cache" or it loads next 10 records only from database?

Daniel
Telerik team
 answered on 26 Feb 2009
1 answer
142 views
Hi,

I m using RadGrid and Calling usercontrol for Edit and Insert , my scenario is that when i have to display different icons on the each row of grid according to data So for this purpose i have taken one Item Template field in which i have called <asp:image /> and finding that control on Item Created so it bind the image with proper icon which i wanted but when i click on Edi button so it throws exception.
Please Kindly help me out how can i resolve this here's my code.

protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)  
    {  
        GridEditableItem eeditedItem = e.Item as GridEditableItem;  
        UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);  
 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
        {  
            if (!e.Item.OwnerTableView.IsItemInserted)  
            {  
 
                ImageButton InsertButton = (userControl.FindControl("btnInsert") as ImageButton);  
                InsertButton.Visible = false;  
 
                if (ViewState["Complete"] == null)  
                {  
                    string[] comp = new string[] { };  
                    Session["CompleteID"] = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"]);  
                    toDoList.ID = Convert.ToInt32(Session["CompleteID"]);  
                    comp = toDoList.SelectIsCompleted();  
                    string a = comp[0];  
                    string b = comp[1];  
                    if (a == "True" || b == "true")  
                    {  
                        TextBox Remarks = (userControl.FindControl("txtRemarks") as TextBox);  
                        Remarks.Enabled = false;  
                        TextBox task = (userControl.FindControl("txtTask") as TextBox);  
                        task.Enabled = false;  
                        RadDatePicker AssignDate = (userControl.FindControl("cmbAssignDate") as RadDatePicker);  
                        AssignDate.Enabled = false;  
                        DropDownList User = (userControl.FindControl("cmbUser") as DropDownList);  
                        User.Enabled = false;  
                        DropDownList task_cat = (userControl.FindControl("cmbCategory") as DropDownList);  
                        task_cat.Enabled = false;  
                        RadDatePicker TargetDate = (userControl.FindControl("cmbTargetDate") as RadDatePicker);  
                        TargetDate.Enabled = false;  
                        ImageButton updateButton = (userControl.FindControl("btnUpdate") as ImageButton);  
                        updateButton.Visible = false;  
                        ImageButton Complete = (userControl.FindControl("ImageButton4") as ImageButton);  
                        Complete.Visible = false;  
                    }  
                    ViewState["Complete"] = "Filled";  
                }  
                else  
                {  
                    Session["CompleteID"] = null;  
                    ViewState["Complete"] = null;  
                }  
 
 
            }  
            else  
            {  
                ImageButton updateButton = (userControl.FindControl("btnUpdate") as ImageButton);  
                updateButton.Visible = false;  
                ImageButton Complete = (userControl.FindControl("ImageButton4") as ImageButton);  
                Complete.Visible = false;  
                ImageButton btnDelete = (userControl.FindControl("ImageButton1") as ImageButton);  
                btnDelete.Visible = false;  
            }  
 
 
        }  
        else   
          
        {  
            if (e.Item is GridDataItem)  
            {  
 
                string Status;  
                Status = objResult.resultDS.Tables[0].Rows[e.Item.ItemIndex]["Status"].ToString();  
 
               if (Status == "Completed")  
               {  
                    Image flag = (Image)e.Item.FindControl("flag");  
                    flag.ImageUrl = "Images/green.gif";  
                    flag.ToolTip = "Complete";  
               }  
               else if (Status == "Pending")  
               {  
                   Image flag = (Image)e.Item.FindControl("flag");  
                   flag.ImageUrl = "Images/red.gif";  
                   flag.ToolTip = "Pending";  
 
               }  
               else  
               {  
                    Image flag = (Image)e.Item.FindControl("flag");  
                    flag.ImageUrl = "Images/blue.gif";  
                    flag.ToolTip = "Assigned";  
                }  
 
           }  
       }  
 
 
    } 
Please reply me asap its urgent, i will be very thankful

Regards,

Maham
Georgi Krustev
Telerik team
 answered on 26 Feb 2009
1 answer
103 views
Hello,

I'm trying to implement Grid with tabs support. Tabs represent different views of the data: uniques set of columns for each tab.
I have added RadTabStrip and added client side java script to show\hide appropriate columns on the RadGrid.

I have the following issues:

1) Hiding\Showing columns does not affect colgroup of the table. This results to incorrect columns width.
2) Hiding\Showing columns takes several seconds, but it is expected that the grid should show data immediately

Please assist.

Thank you,
Andrey
Sebastian
Telerik team
 answered on 26 Feb 2009
2 answers
153 views
Error:
Sys.WebForms.PageRequestsManagerServerErrorException: Cannot find column ColumnName

I have two partial classes:

public partial class Person { public stirng FirstName {get;set;} } //this is generated by SubSonic 2.1
public partial class Person { public stirng LastName {get;set;} } //this is hand written

1.
When i bind Person collection to telerik grid and click to sort on LastName, i get the above error. but it works fine with FirstName column.
My project was using .NET 2.0 (VS2005) and it seemed to be working fine. Since I upgraded to .NET 3.5 all sorts issues all came up. This is just one of the issues.

2.
I also noticed paging isn't working correctly.

3.
GridDropDownColumn also stopped working with Edit command. seems the drop down can not be bind because missing column name from the class.

Is this a known bug with Telerik controls?
do i need to upgrade telerik? I am using telerik.web.ui.dll 2008.1.415.20
with vs2008, .net 3.5, asp.net application project

thanks!
Sebastian
Telerik team
 answered on 26 Feb 2009
5 answers
233 views

We have only Save and Cancel buttons in our toolbar and it works properly when its position is set at the top. But we would like to move these buttons to the bottom of the editor.

When I set DockingZone="Bottom" in the Tools File with the following editor configuration, deleting some text from the editor reduces the Iframe height to a larget extent (more than what it shoud). Because of this scrollbars get added. When delete button is pressed few more times, editor size shrinks to a non-usable size and eventually errors out when an attempt is made to set a negative height to the iframe element.

<telerik:radeditor
    ID="RadEditor1"
    runat="server"     
    EditModes="Design,Html"
    AutoResizeHeight="true"
    EnableViewState="true"        
    BorderWidth="0"
    Skin="Telerik"
    ToolsFile="../RadControls/Editor/ToolsFile.xml"
    style="padding:1px;"
    EnableResize="false">       
    <ContextMenus>
        <telerik:EditorContextMenu  Enabled="false" />
        <telerik:EditorContextMenu TagName="IMG"  Enabled="false" />
        <telerik:EditorContextMenu TagName="TABLE"  Enabled="false" />
    </ContextMenus>   
</telerik:radeditor>

ToolsFile.XML

<root>
 <tools name="MainToolbar" DockingZone="Bottom">
 <tool name="Save" />
 <tool name="Cancel" />
 </tools>
</root>

Like I mentioned before, when DockingZone is set to "top" everything works properly.

Please help!

Thanks, Lakshman

Lakshman
Top achievements
Rank 1
 answered on 26 Feb 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?