Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
128 views
Hi,

I have an Editor with the Template Manager in the tools.
What I need to do is that when a user select a template from the manager - a Textbox is populated with the name of that file.

Basically I am creating a template Save and Manage Area, so I need the name of the selected template.

All help appreciated.

Cheers,

Jon
Jon
Top achievements
Rank 1
 answered on 09 Feb 2013
3 answers
82 views
We recently came across a huge spike in memory loss that is not getting cleaned up by IE8. This wasn't an issue in release 1 of 2012 any ideas what has changed since then? The leak seems to occur when any rad control is placed within an iframe. I'm seeing numbers in the megabytes of unreleased memory after just a few minutes of use.

Has anyone else seen this? Any workarounds for our IE8 users, short of dropping either Telerik or Iframes?
Rory
Top achievements
Rank 1
 answered on 09 Feb 2013
1 answer
195 views
Is it possible to disable individual checkboxes with a radcombobox  with checkboxes = true?

I have a client that wants to show all possible options but disable certain ones if pre-existing conditions are not met. 

Brete
Top achievements
Rank 1
 answered on 08 Feb 2013
0 answers
119 views
I recently had a need to build a dynamic "form" for a simple database driven search engine.  I tried several different approaches and was satisfied with none until I tried using the RadListBox (probably could have used RadListView as well).  After spending quite some time trying to figure out how to manipulate the individual controls inside the RadListItems, I stumbled upon the solution and thought I would share.  Hope this helps some one out there!
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchUtil.aspx.cs" Inherits="CustomCo.SearchUtil" %>
 
<!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:RadScriptManager>
    <telerik:RadListBox ID="rlbSearchParams" runat="server" Width="80%" ClientIDMode="Predictable">
        <ItemTemplate>
            <span>
                <asp:Image ID="imgBlank0" runat="server" ImageUrl="~/Images/Templates/blank0.png" Width="75px" Height="1px" Visible="false" />
                <telerik:RadComboBox ID="ddlAndOr" runat="server" Width="75px">
                    <Items>
                        <telerik:RadComboBoxItem Text="AND" Value="0" />
                        <telerik:RadComboBoxItem Text="OR" Value="1" />
                    </Items>
                </telerik:RadComboBox>
                <telerik:RadComboBox ID="ddlParamName" runat="server" Width="200px">
                    <Items>
                        <telerik:RadComboBoxItem Text="Author Name" Value="AuthorName" />
                        <telerik:RadComboBoxItem Text="Title" Value="Title" />
                        <telerik:RadComboBoxItem Text="Account Team" Value="AccountTeam" />
                    </Items>
                </telerik:RadComboBox>
                <telerik:RadTextBox ID="txtParamValue" runat="server" Width="200px" />
                <asp:Button ID="btnAdd" runat="server" Text="+" CommandName="Add" OnClick="btnAdd_Click" />
                <asp:Button ID="btnRemove" runat="server" Text="-" CommandName="Remove" OnClick="btnRemove_Click" />
            </span>
        </ItemTemplate>
    </telerik:RadListBox>
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace CustomCo
{
    public partial class AdvancedSearch : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (rlbSearchParams.Items.Count < 1)
                CreateForm();
        }
        private void CreateForm()
        {
            RadListBoxItem firstItem = new RadListBoxItem();
            rlbSearchParams.Items.Add(firstItem);
            RadComboBox myAndOR = rlbSearchParams.Items[0].FindControl("ddlAndOr") as RadComboBox;
            myAndOR.Visible = false;
            Image Spacer = rlbSearchParams.Items[0].FindControl("imgBlank0") as Image;
            Spacer.Visible = true;
            Button myRemoveButton = rlbSearchParams.Items[0].FindControl("btnRemove") as Button;
            myRemoveButton.Visible = false;
            myRemoveButton.CommandArgument = "0";
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            RadListBoxItem secondItem = new RadListBoxItem();
            rlbSearchParams.Items.Add(secondItem);
            Button myRemoveButton = rlbSearchParams.Items[0].FindControl("btnRemove") as Button;
            myRemoveButton.CommandArgument = (rlbSearchParams.Items.Count - 1).ToString();
            Button myPreviousAddButton = rlbSearchParams.Items[(rlbSearchParams.Items.Count - 2)].FindControl("btnAdd") as Button;
            myPreviousAddButton.Visible = false;
        }
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            Button mySender = (Button)sender;
            RadListBoxItem myItem = (RadListBoxItem)mySender.Parent;
            if (myItem != null)
            {
                switch(myItem.Index)
                {
                    case 0:
                        CreateForm();
                        break;
                    case 1:
                        Button myPreviousAddButton = rlbSearchParams.Items[0].FindControl("btnAdd") as Button;
                        myPreviousAddButton.Visible = true;
                        break;
                    default:
                        if (rlbSearchParams.Items.Count - 1 == myItem.Index)
                        {
                            Button defaultPreviousAddButton = rlbSearchParams.Items[myItem.Index - 1].FindControl("btnAdd") as Button;
                            defaultPreviousAddButton.Visible = true;
                        }
                        if (rlbSearchParams.Items.Count > 1)
                        {
                            Button defaultPreviousRemoveButton = rlbSearchParams.Items[myItem.Index - 1].FindControl("btnRemove") as Button;
                            defaultPreviousRemoveButton.Visible = true;
                        }
                        break;
                }
                rlbSearchParams.Items.Remove(rlbSearchParams.Items[myItem.Index]);
            }
        }
    }
}
Neil
Top achievements
Rank 1
 asked on 08 Feb 2013
11 answers
158 views
Hey guys,

We have been evaluating the RadEditor for a little while now and over all are very happy with it - we have got one issue that I wanted to raise with you though. At the moment when we use the RadEditor's image manager to upload images to a document library as a site collection administrator, it will put the image in the folder and approve it for us, which is all well and good but when you do it as a content author (who doesn't have the approve permission) they get an access denied error when they add the images here. From what I can tell looking at the logs and seeing whats actually happening in the site this is because the editor is trying to approve the image as well, which the user can do (and because the RadEditor impersonates the user it fails - the world makes sense once more right?)

My question is - can we disable this "auto approve" function at all? We already have a custom workflow solution in place for approving the images anyway so thats not a big deal for us, the error that the authors are going to be getting though is a bit of a show stopper.

Any help is much appreciated!

Cheers,

Brian Farnhill
SharePoint Server MVP
Rumen
Telerik team
 answered on 08 Feb 2013
7 answers
98 views
  Is there anyone to either show the EditModes (Html and Design) on focus (like I have the toolbar currently set) or is there an option to include a control/button in the toolbar for switching modes?
Rumen
Telerik team
 answered on 08 Feb 2013
1 answer
142 views
Hi,

I have a radgrid control (Point 1), inside a radajaxpanel (Point 2), inside a radajaxloading panel. The control is dynamically added to a raddock.

(I will be referring to the Points in the line above)

I found the issue when I added a radtoolbar and used this to handle editting the data inside the radgrid.

The grid is set to EditMode inPlace and AutoGenerateColumns. The data is coming from an ObjectDataSource. (I need to be able to edit columns, so have some columns set to readonly and then go through the rows and add the editIndexes).

When I first added the toolbar at Point 2, things seemed to sort of work. (By that, I mean that edit, update, cancel all worked, but other controls on the page were being affected). The main page area was being handled by ajax. I needed to just modify the module alone... so moved the toolbar to Point 1. This is where the problem began.

At Point 1 the grid will go into edit mode as expected. However, pressing update or cancel, I then get an error...

Error Message:
Invalid postback or callback argument. Event validation is enabled using


If I set the EnableEventValidation then the page works, however, this is a security risk and local policy disallows it.

I have been working with a more experienced telerik programmer to try and resolve the issue, with no success.

We have set AutoGenerateEditColumn to true and tried using the grids own edit, update, cancel. We get the same error.

Removing the toolbar altogether makes no difference.

This suggests that the radgrid has a problem when it is nested as described above.

Items to note:
Page load is hit on the usercontrol hosting the radgrid.
the RadGrid ColumnCreated event is also hit.
The toolbar onclick event was NOT hit.


Any ideas, even things to try would be very much appreciated.

Thanks.
David.
David
Top achievements
Rank 1
 answered on 08 Feb 2013
5 answers
591 views
Hello,

I have a RadAsyncUpload control on a webpage which opens in a radwindow and inserts the files into a database table.  It works great and displays a checkmark unless you select a file larger than 5MB in which case you get an exclamation mark with no errors (javascript or otherwise).
The MaxFileSize is set to 0 (which should be unlimited) yet it does not work in developement or production.

Also,
Is there a way to have the control clear the temp file from the RadUploadTemp folder when the remove link is clicked or after i have put the files in the database?

---- UPLOADFORM.ASPX ----
<%@ Page Language="VB" Theme="Main" AutoEventWireup="false" CodeFile="UploadForm.aspx.vb" Inherits="UploadForm" %>
<%@ 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>Upload Contract</title>
  </head>
  <body>
    <form id="form1" runat="server">
      <div>
        <telerik:RadScriptManager ID="Script1" runat="server" />
        <telerik:RadFormDecorator ID="tfd1" runat="server" />
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Forest" />
        Select file(s) to upload for Customer # <asp:Label ID="lblCustomerNumber" runat="server" Text="" />
        <telerik:RadAsyncUpload ID="RadUpload1" runat="server" Skin="Forest" 
          ControlObjectsVisibility="RemoveButtons" MaxFileSize="0" 
          InputSize="40" MaxFileInputsCount="3" Width="475px" />
        <br />
        <table align="center">
          <tr>
            <td>
              <asp:Button ID="btnUpload" runat="server" Text="Upload Files" />
            </td>
          </tr>
        </table>
      </div>
    </form>
  </body>
</html>

---- UPLOADFORM.ASPX.VB ----
Imports Telerik.Web.UI
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports System.Data.SqlTypes


Partial Class UploadForm
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblCustomerNumber.Text = Session("CustomerID")
    End Sub


    Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        Dim CN As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("EnergyConnectionString").ToString)
        CN.Open()


        For Each File As UploadedFile In RadUpload1.UploadedFiles
            Dim bytes(File.ContentLength - 1) As Byte
            File.InputStream.Read(bytes, 0, File.ContentLength)
            Dim cmd As New SqlCommand("INSERT INTO ContractFiles (CustomerID, FileName, FileExt, MIMEType, FileSize, DateAdded, FileData) VALUES (@CID, @FN, @FE, @MT, @FS, @DA, @FD)", CN)
            cmd.Parameters.AddWithValue("@CID", "2976")
            cmd.Parameters.AddWithValue("@FN", File.GetNameWithoutExtension())
            cmd.Parameters.AddWithValue("@FE", File.GetExtension().ToString.Replace(".", ""))
            cmd.Parameters.AddWithValue("@MT", File.ContentType())
            cmd.Parameters.AddWithValue("@FS", File.ContentLength.ToString())
            cmd.Parameters.AddWithValue("@DA", Now.ToString())
            cmd.Parameters.AddWithValue("@FD", bytes)
            cmd.ExecuteNonQuery()
            'sdsFiles.DataBind()
            'gvFiles.DataBind()
        Next
        CN.Close()
    End Sub
End Class

Any assistance is greatly appreciated,

Thanks
Hristo Valyavicharski
Telerik team
 answered on 08 Feb 2013
5 answers
211 views
Hey Guys,

I have a RadTextBox inside  a RadGrid's ItemTemplate for a given column.  This is bound to a datasource (if !Page.IsPostback).
I have an independant button event which fires and tries to reference the text of the radtextbox from the first row of the grid.
It finds it, but it is always the unedited value that was originally bound, and any edit to the field is lost.
It seems like it's being rebound, but I have that bind inside if (!Page.IsPostback) ??

I'm clearing missing something here. - I am not using edit mode - just a template field. 
Any help appreciated.
Angel Petrov
Telerik team
 answered on 08 Feb 2013
1 answer
98 views
Hi,

I can't find an event that will fire after an event ItemCommand is finished. The event handler ItemCommand (radFileExplorerEventArgs.Command == "UploadFile") is fired before a file is actually uploaded to a specified directory. After this file is saved to a server, I want to call another method to read that file.

Thank you,
Khoa
Vessy
Telerik team
 answered on 08 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?