Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
176 views
Hi,

I would appreciate if you can tell me if there is a property for minimum file size similar to MaxFileSize. My requirement is to prevent the user from uploading an empty (0KB) file. Most of our users use Internet Explorer and whenever they try to attach a file (empty/0KB), progress bar doesn't move at all and gets stuck in a limbo. It seems to be working fine in Firefox though.

In order to go around this problem, we have decided not to allow the user to upload empty files (0KB). Is there such a property for RadAsyncUpload that prevents the user from doing so?

My html looks something like this:

<telerik:RadAsyncUpload ID="uplCVAsync" runat="server" MaxFileInputsCount="1" MultipleFileSelection="Disabled"
EnableInlineProgress="true" AllowedFileExtensions='<%#AllowedExtensions%>' MaxFileSize="<%#MaxFileSize%>" OnClientProgressUpdating="checkUploadedFilesSize"
OnClientFileUploading="fileUploadStart" OnClientFileUploaded="fileUploadEnd"
OnClientFileUploadFailed="fileUploadEnd" OnClientValidationFailed="fileUploadValidationFailed">                                            </telerik:RadAsyncUpload>

If this property is not available, please advice other alternatives?

Irfan,
Genady Sergeev
Telerik team
 answered on 27 Jun 2011
3 answers
423 views
Hy
I do have the following scenario: I am having a Radgrid inside a visual Webpart which is using AJAX. The Radgrid with the Loadingpanel exists within the UserAdministrationUserControl, the RadAjaxmanager is added to the UserAdministrationWebpart.cs by following code:

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    ajaxmgr = new RadAjaxManager();
    ajaxmgr.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(AjaxManager_AjaxRequest);
 
    Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
    Page.Form.Controls.AddAt(0, ajaxmgr);
 
}
 
protected override void CreateChildControls()
{
    Control control = Page.LoadControl(_ascxPath);
    Controls.Add(control);
    RadGrid panel = control.FindControl("RadGrid1") as RadGrid;
    RadAjaxLoadingPanel loadingPanel = control.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel;
    ajaxmgr.AjaxSettings.AddAjaxSetting(panel, panel, loadingPanel);
}

So far it works quite well. However I have the scenario, the Edit-Button of the Radgrid opens a ModalDialogPopup for editing the selected User. When editing is finished and the ModalDialog is closed, the Radgrid should be reloaded/refreshed. This is possible by a javascript function, which is called after closing the modaldialog by a callback. And here is my problem.

The Callback-function should do just the following:
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");


But of course that isn´t possible as the RadAjaxmanager doesn´t exist in the UserControl, where the Javascript and the other controls are.

I´ve tried giving the RadAjaxmanager an Id and finding it by:

$find('<%# this.Page.Forms.FindControl("MyRadAjaxManager").ClientID %>').ajaxRequest("Rebind");

But that doesn´t work, the Control cannot be found (in the console it returns the function as "$find('').ajaxRequest("Rebind") ).

While Debugging, I´ve found out, that the AjaxManager always gets the same ClientID, so the following is starting a refresh (i didn´t set the controls ID in that case):

$find("ctl00_ctl44").ajaxRequest("Rebind");

However, I do not want to hardcode the Controls ClientID. Besides, altough it is updating the Radgrid in that case, the LoadingPanel does not show up by using that Javascript (it works without a harm in all other cases eg. paging). And therefore it is not very userfriendly.

Any Help and suggestions will be very appreciated

Regards
Emir Prcic
Top achievements
Rank 1
 answered on 27 Jun 2011
2 answers
537 views
Hello
I have a simple radgrid (not in edit mode)  that i want to set some of his cells color, according to the value of the firs column of each row.
What i mean is to loop each row in the grid ,check the value of the first column of this gridraw and then set the colors of the rest of the cell in this gridraw according to this value.
How should i do it ?
Thanks,
Gerry
Gerry Polami
Top achievements
Rank 1
 answered on 27 Jun 2011
1 answer
74 views
Hi,

I want all my date formatting in my telerik controls formatted in British date format, I use different Rad contrls like RadGrid or RadCalendar, I want all of them display times in British format, is there any universal property setting for it in Telerik?

Regards
Mazdak
Shinu
Top achievements
Rank 2
 answered on 27 Jun 2011
0 answers
78 views

in my radgrid i bind description field that 5000 records are saved ,
i want to show this on four lines only ,
how i achieve this scenario  

Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 asked on 27 Jun 2011
4 answers
2.0K+ views
Hi,
the code I am using like this:  <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="300px" DataSourceID="SqlDataSource1"
        DataTextField="ProdName" DataValueField="ProdID" AutoPostBack="True"  AppendDataBoundItems="true">

How can I combine two fields ProdID and ProdName in DataTextField, I just want to display ProdID & " " & ProdName in combox list
Many Thanks

Zheng
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Jun 2011
5 answers
374 views
I'm trying to make a Cancel button for my RadEditor, but running into a problem.  On my site, I display the RadEditor as Enabled=false when the page loads.  The causes just the text to be seen, not all the editing controls and whatnot.

There is a "Add/Edit Text" button the user can click that will enable the RadEditor, and show my Submit and Cancel buttons.

When the user clicks my "Cancel" button, I'd like the RadEditor to once again be disabled AND discard any changes that were made.  I can disable it no problem, however the unsaved changes persist.

On the older RadEditor, when you clicked the native "Cancel" button, changes were discarded.  I'd like to replicate this using the new RadEditor.

Any suggestions?
d
Top achievements
Rank 1
 answered on 27 Jun 2011
0 answers
145 views
I am using Telerik Controls in Master page.I am facing a problem regrading panel height.Whenever scren size changes then panel height automatically reduce or increase.it should be increase according to Screen resolution.Please provide me solution so that i can use Telerik Controls.

For Example ..

Currently i am using Following code to adjust Panel Height

var div=document.getElementById("ctl00_divWidth");
alert(div);
   if ( (screen.width == 1280) && (screen.height == 1024) ) //1280 x 1024
        divWidth = 1270;
    else if ( (screen.width == 1152) && (screen.height == 864) )  //1152 x 864
        divWidth = 1142;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
        divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
        divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;

Above code is not working properly.Please resolve my problem..
Mangesh
Top achievements
Rank 1
 asked on 26 Jun 2011
1 answer
160 views
Hello

My RadComboBox gets item from a SqlDataSource, custom text is not allowed.

The items are generated well but the SelectedValue when the data is bound on PageLoad is empty. Only when I select another value, the SelectedValue set.

I need SelectedValue right after DataBind, not after changing the value by picking another value from the drop down list.

How can I do this?

Looking forward to your replies.

Thanks
Thanh Dang
Top achievements
Rank 2
 answered on 25 Jun 2011
3 answers
131 views
I use a Radcombobox integrated in a RadListView. (Made from Example Binary image / FirstLook (http://demos.telerik.com/aspnet-ajax/binaryimage/examples/default/defaultcs.aspx)

I tried to use javascript to close the list, but an error occurs when I search the component ID.

JavaScript code:
 function OnClientNodeClickedHandler (sender, e) {
var comboBox = $ find ("<%= ReportsListItems.ClientID %>");
var node = e.get_node ();
if (! node.get_enabled ()) return;
comboBox.set_text (node.get_text ());
comboBox.trackChanges ();
comboBox.get_items (). getItem (0). set_value (node.get_value ());
comboBox.commitChanges ();
comboBox.hideDropDown ();
}

The error message:
Compiler Error Message: BC30451: 'ReportsListItems' is not declared. It may be inaccessible due to its protection level.
I understand that each control must have a unique ID, but then!
How do I manage the closure of the list after selecting an item?

Preview Code:
 

<%

 

@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="general.master" CodeBehind="reportsList.aspx.vb" Inherits=".ReportsList" uiCulture="Auto" Culture="Auto" %>

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<

 

 

asp:Content ID="Content1" ContentPlaceHolderID="Content2" runat="Server">

</

 

 

asp:Content>

<

 

 

asp:Content ID="Content2" ContentPlaceHolderID="OEEDirectContent" runat="server">

 

<script type="text/javascript">

 

function showingMenu(sender, args) {

 

//Disable the menu on the category image

 

if (args.get_targetElement().id == "RadListView1") {

args.set_cancel(

 

true);

}

}

 

function OnClientNodeClickedHandler(sender, e) {

 

var comboBox = $find("<%= ReportsListItems.ClientID %>");

 

var node = e.get_node();

 

if (!node.get_enabled()) return;

comboBox.set_text(node.get_text());

comboBox.trackChanges();

comboBox.get_items().getItem(0).set_value(node.get_value());

comboBox.commitChanges();

comboBox.hideDropDown();

}

 

</script>

 

<div>

 

<div class="Contents">

 

<telerik:RadFormDecorator runat="server" id="radFormDecorator" DecoratedControls="All" />

 

<telerik:RadListView id="RadListView1" runat="server" datasourceid="SqlDataSource1"

 

ItemPlaceholderID="ListViewContainer" >

 

<LayoutTemplate>

 

<asp:PlaceHolder runat="server" id="ListViewContainer" />

 

</LayoutTemplate>

 

<ItemTemplate>

 

<fieldset id="fieldset" style="float: left; width: 230px; height: 150px; border-style:solid; border-width:1px; border-color:#008080; ">

 

<legend>

 

<b><font size="3"><%# Eval("category")%></font></b></legend>

 

<div class="details">

 

<asp:HiddenField ID="HideF" runat="server" Value= '<%# Eval("id_category")%>'/>

 

<div class="photo-container">

 

<telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("image_value") %>'

 

AutoAdjustImageControlSize="false" Width="55px" Height="55px"

 

AlternateText='<%#Eval("category", "Categorie {0}") %>' />

 

</div>

 

<div class="data-container">

 

<div class="data_leftitem" title="<%# Eval("descript")%>">

 

<label>Description:</label><br><%# Eval("descript")%>

 

</div>

 

<div class="data_bottomitem">

 

<label><strong>Rapports </strong><note>(<%# Eval("nbReports")%>):</note></label>

 

<telerik:RadComboBox

 

runat="server"

 

ID= "ReportsListItems"

 

OnClientNodeClicked="OnClientNodeClickedHandler"

 

AllowCustomText="false"

 

skin="Windows7"

 

AutoPostBack="True"

 

datafieldvalue="id_Report" datatextfield="Reporttitle"

 

DataSourceID="SqlDataSource2"

 

Width="215px"

 

ImageUrl="images/report.png"

 

EmptyMessage="">

 

<ItemTemplate>

 

<div>

 

<asp:Image runat="server" ImageUrl="images/report2.png" Width="18" Height="18" />

 

<asp:Label runat="server" ID="Label1">

 

<asp:HyperLink id="hyperlink1"

 

DataNavigateUrlFields="id_Report"

 

DataNavigateUrlFormatString="viewreports.aspx?id={0}"

 

NavigateUrl='<%#"viewreport.aspx?ID=" + EVAL("id_Report").tostring %>'

 

Text='<%# Eval("Reporttitle") %>'

 

Target="_blank"

 

runat="server"/>

 

</asp:Label>

 

</div>

 

</ItemTemplate>

 

</telerik:RadComboBox>

 

<br />

 

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TF5100ConnectionString %>"

 

SelectCommand="SELECT Reporttitle, id_Report FROM report where id_category=@param and isReport =1">

 

<selectparameters>

 

<asp:controlparameter name="param" controlid="HideF" PropertyName="Value"/>

 

</selectparameters>

 

</asp:SqlDataSource>

 

</div>

 

</div>

 

</div>

 

</fieldset>

 

</ItemTemplate>

 

</telerik:RadListView>

 

</div>

 

<div style="clear: both;">

 

</div>

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TF5100ConnectionString %>"

 

SelectCommand="SELECT * FROM (SELECT DISTINCT rc.id_category, rc.category, rc.descript, rc.image_value, (Select ri.num_order from ReportCategory ri where id_category = rc.id_category ) as num, (SELECT COUNT(id_category) FROM Report WHERE id_category = rc.id_category AND isReport= 1) as nbReports FROM ReportCategory rc INNER JOIN Report ON rc.id_category = Report.id_category WHERE (rc.category <> '')) as tbl WHERE nbReports >0 ORDER BY num ">

 

</asp:SqlDataSource>

 

</div>

</

 

 

asp:Content>

Thank you for your help

Dimitar Terziev
Telerik team
 answered on 25 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?