Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
124 views
Hi,
We have requirement, where in we need to create dynamic controls, so need to add controls like buttons,textbox, radCalenderPicker and few other controls, we are facing 2 issues currently,
1. We have a remove button, which should remove set of items, which currently I am adding as Items, so we wanted to know, can we use removeatIndex() and wanted to understand this functionality.
2. And second must bigger issue is, whenever we have a post back, the dynamic controls gets disappears, and we can only see the RadPanelBar, so can you guys let us know the better approach.
3. Can we use Repeaters inside a RadPanelBar?

Below is the code Snippet
// This the code snippet which is used to create dynamic controls

protected
override void OnInit(EventArgs e)
        {
            base.OnInit(e);
//Method gets click event name
            myControl = GetPostBackControl(this.Page);
 
            if ((myControl != null))
            {
                if ((myControl.ClientID.ToString() == btnAddDestination.ClientID.ToString()))// "AddDestinations_btnAddDestination"))
                {
                    stDestinationCnt = stDestinationCnt + 1;
                }
            }
 
            if ((myControl != null))
            {
                if ((myControl.ClientID.ToString() == btnAddDestination.ClientID.ToString()))
                {
 
 //stDestination has custom logic, which is used to add number of controls and also keeps track of previous count
                    for (int i = 0; i < stDestinationCnt; i++)
                    {
 
                        // Litrals first line of table
                        LiteralControl literalHeader = new LiteralControl(@"<table border=""0"" width=""100%""><tr>");
                        newChild.Controls.Add(literalHeader);
Label lbldest = new Label();
                        lbldest.ID = "lbldestination" + stDestinationCnt.ToString();
                        lbldest.Text = "Destination:";
                        newChild.Controls.Add(lbldest);
 
                        //Textbox for destination ID
                        LiteralControl literalDestinationIDTxt = new LiteralControl(@"</td><td width=""100px"">");
                        newChild.Controls.Add(literalDestinationIDTxt);
                        TextBox txtdestination = new TextBox();
                        txtdestination.Text = "Destination";
                        txtdestination.ID = "txtDestination" + stDestinationCnt.ToString();
                        newChild.Controls.Add(txtdestination);
  LiteralControl literalRemove = new LiteralControl(@"</td><td rowspan=""4"">");
                        Button btn = new Button();
                        btn.ID = "Remove" + stDestinationCnt.ToString();
                        btn.Text = "Remove";
                        newChild.Controls.Add(btn);
newChild.Visible = true;
 
                        //Add Controls to Panel Bar
                        RadPanDestination.Items.Add(newChild);
}

//ascx design
    <tr><td>
    <telerik:RadPanelBar runat="server" ID="RadPanDestination" Text="Test" ExpandMode="SingleExpandedItem"
        Width="100%" >
        <Items>
            <telerik:RadPanelItem Text="Destinations" Width="100%">
                <ItemTemplate>


                </ItemTemplate>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    </td></tr>
 we are having this code in user control
Yana
Telerik team
 answered on 03 Dec 2010
5 answers
154 views

Hi Guys,

I'm trying to use the RadScheduler in an MVC app, and have been through the various sample apps etc. top check it out.
Its *almost* working in that its loading up and not producing any errors.

However, there are no styles, and it seems no scripts either. I checked in the source and while in the sample apps I have several "webresources" calls being loaded into the head tag, in my app these are not appearing.

I am using the telerik script and stylesheet manager (for MVC) so I wonder if this is affecting it..?
Worst case I could manually load the styles and scripts, but that seems to pose its own problems at the moment, since they're dynamically loaded.

Any help would be very gratefully received as I'm going round in circles at the moment!

Thanks,
Ben
Peter
Telerik team
 answered on 03 Dec 2010
4 answers
264 views
Dim insertQuantity As String
Dim insertEquipment As String
Dim intNumber As Integer = 1
Dim newControl As New Control
For intNumber = 1 To 1
    insertQuantity = "txtQuantity" + CStr(intNumber)
    insertEquipment = "txtEquipment" + CStr(intNumber)
    newControl = DirectCast(Me.FindControl(insertQuantity), TextBox)
    If (Not newControl Is Nothing) Then
        Response.Write("Cant find control ")
    Else
        Response.Write("Found the control")
        newControl = DirectCast(Me.FindControl(insertQuantity), TextBox)
    End If
Next intNumber
Hello There,

i am trying to retrieve values from multiple text boxes.  i Created the textboxes(quantity1, quantity2, etc)
and i am trying to pull these values when a user clicks the button.  This is what i have so far.

Please help.  When i access newControl.Text it is giving me a null reference to an instance of an object. Thank  you.

 

Birju
Top achievements
Rank 1
 answered on 03 Dec 2010
2 answers
121 views
Hi there

I am putting together an upload page using the following as a guide....

http://demos.telerik.com/aspnet-ajax/upload/examples/async/webmail/defaultcs.aspx?product=asyncupload

At the moment just testing so used the example above as a guideline.

Everything works - file gets uploaded and the submit is disabled during upload and then re-enabled and does what i want it too after the file has been uploaded.

Only problem is after the submit button is pressed we get an error pop up saying "Error: '$telerik' is undefined"

If we close the error message everything continues to work but I cannot understand why this error gets raised as everything appears to work - file is uploaded et...

I have tried to debug but all web resources are located correctly and there are no other errors.

Any ideas?

Geoff
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
113 views
Hi,
it's been all day I have been trying to figure out why the radeditor I placed inside a usercontrol stopped working.
This is the deal: I have a RadPanel which contains some Textbow and a Radeditor. It used to work until today. Now I can only save  the editor's content using other browser than IE.
Can someone help me figure out what happened?
Thanks!
Rumen
Telerik team
 answered on 03 Dec 2010
1 answer
95 views
Hi all,

Relatively simple question to check my understand of what is/is not possible.

I have one DockZone with two Docks inside of it. Each of these docks is hosting an interactive chart.
I would like to AJAXify both of these, but have the updated controls be limited to the Dock which initiated the AJAX request.

I read that using RadAjaxManager to do this is not recommended. Indeed, when I set up a RadAjaxManager such that it attempted to update individual docks (as opposed to waiting for an AJAX request from the DockZone and then updating the DockZone) I receive the error: Telerik.Web.UI.RadDockZone can contain only controls of type Telerik.Web.UI.RadDock. I believe that this is occurring because of the 'imaginary' update panel which is being wrapped around the respective dock.

I read that the more accepted means of doing this is to use the standard UpdatePanel. I attempted to do so using the following snippit of HTML;

<telerik:RadDock ID="RadDock3" Runat="server" DockMode="Docked" Skin="Web20" Width="33.3%">
    <ContentTemplate>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <uc1:PowerUsage ID="PowerUsage1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    <ContentTemplate>
 </telerik:RadDock>

In addition, I moved the UpdatePanel outside of RadDock3 so that it wrapped the entire RadDock. Neither of these options proved fruitful, though. I continue to receive the above error message.

What am I doing wrong here? Is it not possible to update individual docks within a DockZone? 
Pero
Telerik team
 answered on 03 Dec 2010
1 answer
126 views
Hi folks,

I want to apply a conversion rate (set on the page outside the grid) to every row. For example:

<telerik:GridCalculatedColumn HeaderText="Cnv. Price" 
UniqueName="ConvertedSoldPrice"
 DataType="System.Double" 
DataFields="SoldPrice, ConversionRate" 
Expression="{0}*{1}" />

Since ConversionRate doesn't actually appear as a field in the database table (it's value comes from a textbox elsewhere on the same page), what's the best way of getting it incorporated in the calculated column?

Thanks,
Ken
Princy
Top achievements
Rank 2
 answered on 03 Dec 2010
11 answers
185 views

Hi, I have a problem with IE8: it's impossible to switch to HTML view.
The error is on ScriptResource.axd.

Following some details about the error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Tue, 26 Jan 2010 16:10:11 UTC
Message: Permission denied
Line: 5251
Char: 1
Code: 0
URI: http://172.30.148.239:81/ScriptResource.axd?d=7PXMeRUGD7WemvP40sRV83MWqfXBxjt-3xudKuVCvaa6JShH8VvYbuuHJPsJQD5Yt9q0mIE6vxYOCHUOSNSRsg2&t=633961254920000000
Telerik version: 2009 Q2
Browser version: IE 8.0.6001.18702

Could you help me?

Thanks

Rumen
Telerik team
 answered on 03 Dec 2010
1 answer
114 views
Hi All

I have two grids linked on a page, the second grid is linked to the id of the selected row in the first,
I have the first grid configured to select the first record in the grid when it has loaded and then pass the id to the second grid, However the second grid is loading before /at the same time.
My question is: is there anyway that i can delay the first grid loading until the first had completed?

Regards

Darren
Cush
Top achievements
Rank 1
 answered on 03 Dec 2010
4 answers
152 views

How do you turn off the default tooltip on the button. It is redundant to have the text="Save" and then when you hover over the button you automatically get a tooltip saying the same thing. I have tried to set the Tooltip="" and that doesn't work. If I set the tooltip text to "Save Record", this shows up when the mouse hovers over the button. Suggestions.


<telerik:RadButton ID="btnSave" runat="server" Text="Save" Width="100px">
</telerik:RadButton>
Rumen
Telerik team
 answered on 03 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?