Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
107 views
Hello,
I readed this article about checking the filesize on clientsite: http://www.telerik.com/help/aspnet-ajax/upload_howtoclientfilesize.html

Now I customized this code for my project:

<script type="text/javascript"
 function checkUploadedFilesSize(progressArea, args) 
 { 
   if (!progressArea.confirmed && 
       args.get_progressData().RadUpload.RequestSize > 10485760) 
     { 
       progressArea.cancelRequest();    
     } 
  } 
 
</script> 

It work's, but how can I set a custom validator to "false" after I canceld the request to show the user an error message??

My cumstom validator looks like this:
<asp:CustomValidator  
  ID="checksizevalidator" runat="server" 
  Display="Dynamic"
The total size of the selected files is more than the limit. 
</asp:CustomValidator> 

Thanks in advance for your help.

Regards
Dirk





Dirk Eberhardt
Top achievements
Rank 1
 answered on 15 Jan 2010
1 answer
91 views
I want to provide a defaultDisplay (during development) which will display a single row from a table in a vertical manner. I would like associated detail tables to be presented in the normal horizontal manner.
I've used the PivotGrid examples to display this row as though it is a form. I have autoassigned the columns so that it can display table A, B or C according to some value passed to the form. The data is all provided by a dataset with the appropriate relations set up. I would like Table A to also be able to display its table subA details (using A.Id = SubA.Id).
I programmatically define the detail table because there are various detail tables according to whether Table A, B or C is being displayed.
If I programtatically define the detail table, because the MasterDetailTable has been pivoted, I pick up the incorrect details for the masterKey Values. How can I access the correct values when rows and columns are switched?

Basically can I mix vertical and horitontal RadGrids?
Yavor
Telerik team
 answered on 15 Jan 2010
2 answers
346 views
I would like to be able to auto close a Rad Window after 2 seconds. (Everything works except for the auto close after 2000ms). I have tried the setTimeout like this:

 

function openQuickActionRadWindow(tabid,XModID)

 

{

 

var oWnd = radopen("/Default.aspx?tabid=" + tabid + "&xmfid=5&SkinSrc=[G]Skins/Blue-NCPP/Plain&xmid=" + XModID, "RadWindow3" );

 

oWnd.Center();

oWnd.add_close(RefreshGrid);

setTimeout(oWnd.Close, 2000);

}

but I get a javascript error: Object doesn't support this property or method. 

The details:
Browser: IE 8
Version: 2009.3.1208.35

Thanks,
Joe

Georgi Tunev
Telerik team
 answered on 15 Jan 2010
0 answers
80 views
Hello
In my project i m using Scheduler Control,when i click on my button scheduler control is pop up using rad window,but issue is my Date panel and Time panel means First Column after Header and Left Column of Time not able to Freeze how can i freeze that column.
waiting for your reply


Amitkumar
Top achievements
Rank 1
 asked on 15 Jan 2010
2 answers
153 views
Hi, All

I want to export to excel with html code

like
<table>
    <tr>
        <td>1</td>
        <td>2</td>
    </tr>
    <tr>
        <td>3</td>
        <td>4</td>
    </tr>
</table>

Not using this CS code
    grdList.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;

please help me
Yoon-Ho Choi
Top achievements
Rank 1
 answered on 15 Jan 2010
1 answer
96 views
Hi There

I have a page where I am using two tabs. Within the RadPageView I am loading UserControls.

UC1 is the first to focus, and I can't seem to get UC2 to focus at all.

Here is the ASPX with the tabs
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register TagPrefix="uc" TagName="Properties" Src="~/App_Modules/Properties.ascx" %> 
<!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></title>  
    <script type="text/javascript" src="http://www.google.com/jsapi"></script> 
    <script type="text/javascript">  
        google.load("language", "1");  
    </script> 
</head> 
<body class="body">  
    <form id="form1" runat="server">  
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" /> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        <Scripts> 
            <asp:ScriptReference Path="~/App_Assets/Scripts/Admin.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" > 
        <Tabs> 
            <telerik:RadTab Text="Page Details" /> 
            <telerik:RadTab Text="Page Properties" /> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" EnableEmbeddedScripts="true">  
        <telerik:RadPageView ID="DefaultView" runat="server">  
            <asp:Panel ID="EditPanel" runat="server" /> 
        </telerik:RadPageView> 
        <telerik:RadPageView ID="PropertiesView" runat="server">  
            <uc:Properties ID="Properties1" runat="server" /> 
        </telerik:RadPageView> 
    </telerik:RadMultiPage> 
    </form> 
</body> 
</html> 

And here is the ASCX that contains the Applet.

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Admin.ascx.vb" Inherits="App_Modules_Image_Gallery_Admin" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<div class="Header-Bar">  
    <div class="Header-Bar-Wrapper">  
        <div class="Inner-Header-Bar">  
            SlideShow Manager</div> 
    </div> 
</div> 
<div class="Content-Area">  
    <div class="Inner-Content-Area">  
        <table> 
            <tr> 
                <td> 
                    <div style="border: 1px dotted #336699; padding: 4px; width: 180px;">  
                        <telerik:RadScriptBlock runat="server" ID="Scripts1">  
                            <script type="text/javascript" language="javascript">  
                                {  
                                    document.writeln('<applet ');  
                                    document.writeln('archive  = "../App_Assets/Scripts/RadUploadDNDLite.jar"');  
                                    document.writeln('code     = "com.radinks.dnd.DNDAppletLite"');  
                                    document.writeln('name     = "Rad Upload Lite"');  
                                    document.writeln('hspace   = "0"');  
                                    document.writeln('vspace   = "0" MAYSCRIPT="yes"');  
                                    document.writeln('width    = "180"');  
                                    document.writeln('height   = "180"');  
                                    document.writeln('align    = "middle">');  
                                }  
                            </script> 
                            <param name="max_upload" value="20000">  
                            <param name="url" value="<% ="http://" & HelperClass.GetServerDomain & "/Uploader.axd?allowed=jpg,jpeg&path=" & ThePath %>" /> 
                            <param name="monitor.type" value="thumbnails">  
                            <param name="message" value="<div style='text-align:center;padding-top:50px;color:Gray;'>Drag & Drop<br>or<br>Copy & Paste</div>" /> 
                            <script language="javascript" type="text/javascript">  
                                {  
                                    document.writeln('</applet>');  
                                }  
                            </script> 
                        </telerik:RadScriptBlock> 
                    </div> 
                </td> 
            </tr> 
        </table> 
    </div> 
</div> 
 

I can confirm that my Applet is configured properly, and it loads without issue.  But the problem is that I cannot switch to the "Page Properties" tab.

Thanks in advance.
Chase Florell
Top achievements
Rank 1
 answered on 15 Jan 2010
1 answer
98 views
I just upgraded from v2008 to v2009 AJAX .NET controls.

I have a huge website that I developed using these older controls. I want to use the newer versions going forward, but if I place one on the page it tells me that the file already exists and asks me if I want to replace "Bin/Telerik.Web.UI.dll"?

If I select yes than none of my pages work with the older controls - it tells me "that the 2008 version blah blah could not be found".  if I select no, than wouldn't I really just be working with the older libraries and not even using the new controls?


Schlurk
Top achievements
Rank 2
 answered on 14 Jan 2010
1 answer
138 views
Hi, I have an Export to Excel button (image button) that sits inside an Ajaxified RadPageView and a mult-tabbed interface and as you guessed by the title, The excel file does not export even though the following code executes without error.

 Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click
        Dim filename As String
        filename = Membership.ApplicationName.ToString & txtFirstName.Text & "_" & txtLastName.Text & "_" & lblmemberID.Text & "_OrderHistory"
        RadGrid1.ExportSettings.OpenInNewWindow = True
        RadGrid1.ExportSettings.FileName = filename
        RadGrid1.ExportSettings.ExportOnlyData = True
        RadGrid1.ExportSettings.IgnorePaging = True


        RadGrid1.ExportSettings.OpenInNewWindow = True
        RadGrid1.MasterTableView.ExportToExcel()

    End Sub

Does anyone know how I can keep the Ajax but have the export perform as desired? Thanks.
Daniel
Telerik team
 answered on 14 Jan 2010
0 answers
98 views
I am trying to customize the paging of the radgrid but i hit the dead end.

Inside the NeedDataSource event handler i have these two lines:

RadGrid1.VirtualItemCount = Catalog.ItemCount(Me.txtSearch.Text.Trim, _ 
                                                                    txtRangeFrom.Text, txtRangeTo.Text, _ 
                                                                    IIf(cmbDepartments.SelectedValue <> "", cmbDepartments.SelectedValue, 0), _ 
                                                                    IIf(cmbCategories.SelectedValue <> "", cmbCategories.SelectedValue, 0), _ 
                                                                    0) 
 
 
RadGrid1.DataSource = Catalog.GetProducts(Me.txtSearch.Text.Trim, _ 
                                                                     txtRangeFrom.Text, txtRangeTo.Text, _ 
                                                                     IIf(cmbDepartments.SelectedValue <> "", cmbDepartments.SelectedValue, 0), _ 
                                                                     IIf(cmbCategories.SelectedValue <> "", cmbCategories.SelectedValue, 0), _ 
                                                                     0, Me.RadGrid1.CurrentPageIndex + 1, 10) 

But it seems i am missing something because when i move through the pages after 10 or 20 pages it appears empty althrough it says that there are more pages remaining.

Also when i add some search criteria it does affect the items shown up in the grid itself but not the pager which still refers to the previously counted items/pages.

For instance if i enter search term "test" and click the search button calling RadGrid.Rebind method it affects only the first page of the grid but the pager does not change at all.

Am i missing something e.g. maybe i should replace the code for setting virtualItemCount property in another event?

Thanks

El
Top achievements
Rank 1
 asked on 14 Jan 2010
3 answers
297 views


Ok I need a solution to a problem I keep running into. Basically, I want the edit and delete command columns to be the rightmost columns on my grid. However, when I use the advanced databinding technique, the edit and delete command options are in the leftmost columns.

I tried explicitly declaring my data columns in the <column> section of the masterTableView, but the only thing that does is cause the needDataSource event to duplicate the collumns.

Here is my grid declairation markup:

<telerik:RadGrid ID="gvFirmInfo" runat="server" Width="550px"
    <MasterTableView  
        EditMode="PopUp"  
        CommandItemDisplay="Bottom" CommandItemStyle-BackColor = "#D8D8D8" 
        ShowHeader="true" ShowHeadersWhenNoRecords="false" NoMasterRecordsText="" 
        HeaderStyle-Font-Bold="true" HeaderStyle-BackColor ="#D8D8D8" 
        ItemStyle-BackColor="White" ItemStyle-BorderColor="#C9C4D1"  
        ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1px"  
        AlternatingItemStyle-BackColor="#E0E0E0" AlternatingItemStyle-BorderStyle="Solid" 
        AlternatingItemStyle-BorderWidth="0px" AlternatingItemStyle-BorderColor="#FFFFFF" 
        BorderColor="#C9C4D1" BorderWidth="1px" BorderStyle="Solid" 
        GridLines="None"
         
        <CommandItemTemplate>  
            <div style="text-align: right; padding: 8px;"
                <asp:Button ID="Button1" Text="Add Firm Location"  
                Runat="server" CommandName="InitInsert"></asp:Button>  
            </div> 
        </CommandItemTemplate>  
         
        <Columns> 
            <telerik:GridBoundColumn DataField="city" HeaderText="City"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Country" HeaderText="Country"
            </telerik:GridBoundColumn> 
             
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="columnDelete" 
                ConfirmText="Are you sure you want to delete this record?"
            </telerik:GridButtonColumn> 
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"
            </telerik:GridEditCommandColumn> 
        </Columns> 
         
        <EditFormSettings> 
         <!-- I have a custom edit form in here --> 
        </EditFormSettings> 
         
    </MasterTableView> 
 
    <ClientSettings> 
        <ClientEvents OnPopUpShowing="PopUpShowing" /> 
    </ClientSettings> 
</telerik:RadGrid> 


Here is my VB:

    Protected Sub gvFirmInfo_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gvFirmInfo.NeedDataSource 
        Dim sqlString As String = "" 
        Dim sqlparam(2) As SqlParameter 
        Dim ds As New DataSet 
        Dim dr As SqlDataReader = Nothing 
 
        Try 
            SetParam(sqlparam(0), "@recId", Data.SqlDbType.Int, 4, m_rec_id) 
            SetParam(sqlparam(1), "@recType", Data.SqlDbType.Char, 2, m_rec_type) 
 
 
            
                sqlString = "SELECT ... FROM..."  
 
            ds = SqlHelper.ExecuteDataset(Conn, Data.CommandType.Text, sqlString, sqlparam) 
 
 
            gvFirmInfo.DataSource = ds
 
 
        Catch ex As Exception 
 
        End Try 
 
    End Sub 


Most likely I have been ripping my hair out over something stupid.... any suggestions?



Drew
Top achievements
Rank 2
 answered on 14 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?