Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
109 views
I am building a custom content provider to allow FileExplorer to use RackSpace CloudFiles.  So far, I've been able to get it to list directories and contents flawlessly.  However, there seems to be an issue uploading and deleting files (objects).

In my provider class I have the required "DeleteFile" method (really you guys should have a Interface to implement, NOT a class to inherit) however the DeleteFile method is never called when deleting, same goes for the StoreFile method when uploading.

Instead I get the following error: The selected file could not be deleted because the application did not have enough permissions.  Please contact system administrator

I have checked and the Delete and Upload paths are set correctly, and ViewState is turned on as well, but no matter what I do, the FileExplorer never actually calls the Content Provider methods...

ISSUE SOLUTION:
The solution is pretty simple... I did not have an overriding method in my provider for "CheckDeletePermissions" method.  Unfortunately because these providers are setup to Inherit a base provider instead of Implementing an Interface there is nothing to "force" me as a programmer to implement all MANDATORY overrides... I guess it's a matter of preference but I enjoy using Interfaces, they do a great job of enforcing correct programming for providers.

At at any rate, I have implemented this override method and not instead of calling the base provider class for Deleting it's calling the customer provider on delete instead.  I will also assume that overriding "CheckWritePermissions" will also take care of my uploading issue.

Happy Coding, good luck to the rest of you.
Mitch
Top achievements
Rank 1
 answered on 11 May 2011
1 answer
209 views
I have a radGrid which displays a couple of GridBoundColumns representing decimal data fields in editmode as a Percentage = DataFormatString="{p:0}", but if I go to edit one of these and click update I generate the following error, since the other textbox is displaying with "  %"  in the value, ..

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.

How can I have my cake and eat it too? I want to Display percentages as whole numbers and edit them the same way?
grid is named rdAsset

 

 

<

 

telerik:GridBoundColumn DataField="Target" DataType="System.Decimal" DataFormatString="{0:p2}"  HeaderText="Target%" SortExpression="Target" UniqueName="Target">

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="TargetRange" DataType="System.Decimal" DataFormatString="{0:p2}"

 

 

 

HeaderText="Target Range%" SortExpression="TargetRange" UniqueName="TargetRange">

 

 

</telerik:GridBoundColumn>

 

 

 

 

In the code behind, I have...

 

 

 

protected void rdAsset_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 

 

{

 

 

if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode )

 

 

{

 

 

GridEditFormItem item = e.Item as GridEditFormItem;

 

 

 

TextBox target = item["Target"].Controls[0] as TextBox;

 

 

target.Text =

String.Format("{0:p2}", (item.DataItem as DataRowView).Row["Target"]);

 

 

 

TextBox targetRange = item["TargetRange"].Controls[0] as TextBox;

 

 

targetRange.Text =

String.Format("{0:p2}", (item.DataItem as DataRowView).Row["TargetRange"]);

 

 

 

}

Gimmik
Top achievements
Rank 1
 answered on 11 May 2011
3 answers
220 views

I've seen a couple other posts about this, but none of them had an answer that actually worked. My problem is that I have a RadGrid inside of a RadMultiPage, and I'm using RadAjaxManager. Whenever I click to go to the next page, or change the page size, or anything of that nature, the RadGrid disappears. When looking at the source code the markup for the RadGrid does not appear, just a couple of div tags in its place. This is the code on my .aspx page:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CreateAccount.aspx.cs" Inherits="DADCA.Account.CreateAccount" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head id="Head1" runat="server">
    <title>Dayton Defense - Login</title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        /*the following CSS rules take care of expanding the html, body and form elements
        in case the page content is shorter than the browser window viewport.*/
  
        html,
        body,
        form
        {
            min-height:100%; /*all except IE6*/
            margin:0;
            padding:0;
        }
  
        * html html,
        * html body,
        * html form
        {
            height:100%; /*IE6 only*/
        }
  
        .MyModalPanel
        {
            position:absolute;
        }
    </style>
</head>
<body style="background: #fff; ">
    <form id="page_form" runat="server">
    <div style="width:500px; margin: 20px auto 0px auto !important;">
        <telerik:RadScriptManager ID="LoginRadScriptManager" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadSubmitButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="createAccountMultiPage" LoadingPanelID="win7LoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="companySearchResultsGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="createAccountPanel" LoadingPanelID="win7LoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="companySearchResultsGrid" />
                        <telerik:AjaxUpdatedControl ControlID="createAccountMultiPage" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="win7LoadingPanel" runat="server" CssClass="MyModalPanel" Skin="Windows7" IsSticky="true" Width="100%" Height="100%" />
        <telerik:RadMultiPage ID="createAccountMultiPage" runat="server" Width="100%">
            <telerik:RadPageView ID="companySearchView" runat="server" Selected="true">
                <table width="100%" align="center">
                    <tr>
                        <td> </td>
                    </tr>
                    <tr>
                        <td width="40%" align="left">
                            <img src="../Images/DaytonDefenseLogo.jpg" alt="Dayton Defense Logo" width="100%"/>
                        </td>
                        <td width="5%"></td>
                        <td align="left" valign="top" width="55%">
                            <h1>Register</h1>
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                </table>
                <table width="100%" align="center">
                    <tr>
                        <td colspan="3" align="center">
                            Please enter your company's name in the textbox below and click "Submit".<br /><br />
                            This will search our database to see if a record of your company already exists. 
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center">
                            <span class="failureNotification">
                                <span style="color: Red">
                                    <asp:Label ID="errorLabel" runat="server" Visible="false" />
                                </span>
                            </span>
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td width="48%" align="right">
                            <span id="asterikSpan" style="color:Red;" runat="server" visible="false">*</span>Company Name: 
                        </td>
                        <td width="2%"> </td>
                        <td align="left">
                            <telerik:RadTextBox ID="companyName" runat="server" Skin="Windows7" />
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3" align="center">
                            <telerik:RadButton ID="RadSubmitButton" runat="server" OnClick="RadSubmitButton_OnClick" Text="Submit"  Skin="Windows7" Width="150px" ValidationGroup="LoginUserValidationGroup" />
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
            <telerik:RadPageView ID="companySearchResultsView" runat="server">
                <table width="100%" align="center">
                    <tr>
                        <td> </td>
                    </tr>
                    <tr>
                        <td width="40%" align="left">
                            <img src="../Images/DaytonDefenseLogo.jpg" alt="Dayton Defense Logo" width="100%"/>
                        </td>
                        <td width="5%"></td>
                        <td align="left" valign="top">
                            <h1>Register</h1>
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                </table>
                <table width="95%" align="center">
                    <tr>
                        <td colspan="3" align="right" width="100%">
                            <telerik:RadButton ID="backToSearchButton" runat="server" Text="Back To Company Search" Skin="Windows7" OnClick="backToSearchButton_OnClick" />
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3" align="center" width="100%">
                            Below are the results of your search.
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center">
                            If you see your company listed, click on the check mark to view details about your company and how to create your user account.
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3">
                            <telerik:RadGrid ID="companySearchResultsGrid" runat="server" AllowFilteringByColumn="True" AllowSorting="True" GridLines="None" 
                                                AllowPaging="True" Skin="Windows7" PageSize="20" OnSelectedIndexChanged="companySearchResultsGrid_SelectedIndexChanged" AutoGenerateColumns="False">
                                <MasterTableView DataKeyNames="id" Width="100%">
                                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
  
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>
  
                                <Columns>
                                    <telerik:GridButtonColumn CommandName="Select" ButtonType="ImageButton" ImageUrl="~/Images/action_check.png" HeaderStyle-Width="8px" ItemStyle-Width="8px"/>
                                    <telerik:GridBoundColumn DataField="name" FilterControlAltText="Filter By Company Name" HeaderText="Company Name" SortExpression="name" UniqueName="name">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
  
                            <FilterMenu EnableImageSprites="False"></FilterMenu>
  
                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
  
                            </telerik:RadGrid>
                            <asp:SqlDataSource ID="companySearchResultsDS" runat="server" ConnectionString="<%$ ConnectionStrings:DADCAConnectionString %>" />
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3" align="left">
                            Don't see your company? <a href="#">Click here</a> to continue registration for a new company.
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                </table>
            </telerik:RadPageView>
            <telerik:RadPageView ID="companyDetailsView" runat="server">
                <table width="100%" align="center">
                    <tr>
                        <td> </td>
                    </tr>
                    <tr>
                        <td width="40%" align="left">
                            <img src="../Images/DaytonDefenseLogo.jpg" alt="Dayton Defense Logo" width="100%"/>
                        </td>
                        <td width="5%"></td>
                        <td align="left" valign="top">
                            <h1><asp:Label ID="results_company_header_label" runat="server"></asp:Label></h1>
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                </table>
                <table width="95%" align="center">
                    <tr>
                        <td colspan="3" align="right" width="100%">
                            <telerik:RadButton ID="backToSearchResults" runat="server" Text="Back To Company Search Results" Skin="Windows7" OnClick="backToSearchResultsButton_OnClick" />
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3" align="center" width="100%">
                            We currently have a record of your company in our database.<br /><br />
                            The point of contact (POC) for your company is:
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3" align="center">
                            POC details
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3">
                                  
                        </td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr>
                        <td colspan="3" align="left">
                                  
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
        <script language="javascript" type="text/javascript">
  
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }
  
            function CancelWindow() {
                var wnd = GetRadWindow();
                wnd.close();
            }
  
            function CloseWndw() {
                var wnd = GetRadWindow();
                wnd.close();
            }
  
            function Waiting(s, e) {
                Callback.PerformCallback();
                LPWaitConn.Show();
            }
  
            function RequestStart(sender, args) {
                if ($telerik.isSafari) {
                    var scrollTopOffset = document.body.scrollTop;
                    var scrollLeftOffset = document.body.scrollLeft;
                }
                else {
                    var scrollTopOffset = document.documentElement.scrollTop;
                    var scrollLeftOffset = document.documentElement.scrollLeft;
                }
  
                var loadingImageWidth = 55;
                var loadingImageHeight = 55;
  
                loadingPanel.style.backgroundPosition = (parseInt(scrollLeftOffset) + parseInt(viewportWidth / 2) - parseInt(loadingImageWidth / 2)) + "px " + (parseInt(scrollTopOffset) + parseInt(viewportHeight / 2) - parseInt(loadingImageHeight / 2)) + "px";
            }
        </script>
        <asp:Label ID="successLabel" runat="server" />
    </div>
    </form>
</body>
</html>

And this is my code-behind file:

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;
using DADCA.Authentication;
  
namespace DADCA.Account
{
    public partial class CreateAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                companySearchResultsGrid.DataSource = companySearchResultsDS;
                companySearchResultsGrid.DataBind();
            }
        }
  
        protected void RadSubmitButton_OnClick(object sender, EventArgs e)
        {
            if (companyName.Text != null && companyName.Text != "")
            {
                //Get the parameters for the query based on the company name the user gave us
                List<string> parameters = companyName.Text.Split(' ').ToList<string>();
  
                if (parameters != null && parameters.Count > 0)
                {
                    //Set the SQL query of the data source
                    string sql = "SELECT [Companies].id, [Companies].name FROM Companies WHERE ";
  
                    foreach (string p in parameters)
                    {
                        sql += "[Companies].name LIKE '%" + p + "%' OR ";
                    }
  
                    sql = sql.Substring(0, sql.Length - 4); //Trim off the last ' OR '
  
                    //Set the select command of the data source
                    companySearchResultsDS.SelectCommand = sql;
  
                    //Assign the data source and rebind
                    companySearchResultsGrid.DataSource = companySearchResultsDS;
                    companySearchResultsGrid.DataBind();
  
                    //Change to the correct page view
                    companySearchResultsView.Selected = true;
  
                    //Get rid of any errors that may be there
                    errorLabel.Visible = false;
                    asterikSpan.Visible = false;
                }
            }
            else
            {
                errorLabel.Text = "You must supply your company name to continue.";
                errorLabel.Visible = true;
                asterikSpan.Visible = true;
            }
        }
  
        protected void companySearchResultsGrid_SelectedIndexChanged(object sender, EventArgs e)
        {
            var selectedCompany = companySearchResultsGrid.SelectedItems[0] as GridDataItem;
            if (selectedCompany != null)
            {
                string key = selectedCompany.GetDataKeyValue("id").ToString();
  
                //Once we have the ID of the company the user selected, show them the company's details
                //along with information on how to get added as a user
                  
            }
        }
  
        protected void backToSearchButton_OnClick(object sender, EventArgs e)
        {
            //Make sure we aren't showing any errors when we go back
            errorLabel.Visible = false;
            asterikSpan.Visible = false;
            companySearchView.Selected = true;
        }
  
        protected void backToSearchResultsButton_OnClick(object sender, EventArgs e)
        {
  
        }
  
    }
}

I have absolutely no idea what I'm doing wrong. I tried to rebind the grid in the page load method, but still no dice. Any ideas?
Andrew
Top achievements
Rank 1
 answered on 11 May 2011
2 answers
145 views

 Hi Everyone,

Problem Statement:  Inside of an ASP DetailsView, I have declared a RadEditor.   The content is bound inline with the content property.   When the field is empty, I need to display a stylized (greyed out or whatever..)  set of template text.   This is to help the users properly fill in the field.   I can't seem to figure out the best way to accomplish this.  

Tried so far:   Bind the content inline, and also put the template text in the content tags within the control declaration.  

Is there something I can do in the DetailsView databind to check the contents then post the template text?  

Here is the way I am binding this now:

<asp:TemplateField HeaderText="Summary" SortExpression="Summary">
                                <EditItemTemplate>
                                    <telerik:RadEditor ID="reSummary" runat="server" Height="80" Width="500" ToolsFile="xml\RadEditorToolbars.xml"
                                        Content='<%# Bind("Summary") %>'>
                                        <CssFiles>
                                            <telerik:EditorCssFile Value="Styles/EditorContentArea.css" />
                                        </CssFiles>
                                    </telerik:RadEditor>
                                    <br />
                                    <br />
                                    <br />
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Summary") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Summary") %>'></asp:Label>
                                </ItemTemplate>
                                <ControlStyle Width="600px" />
                                <HeaderStyle HorizontalAlign="Right" VerticalAlign="Top" Width="600px" />
                            </asp:TemplateField>


Thanks,
Daniel
Daniel
Top achievements
Rank 1
 answered on 11 May 2011
2 answers
95 views
Hi,

i do have an issue with the webparts delivered by by the SAK. I did a fresh install on our SP Farm (2 Servers with 2010 as Frontend) and everythings seems to work fine.
I activated the features on farm and collection level and were able to put the webparts on a page.
i added a list as shown in your video, but no list is visible.
After this i tried to add the SP List by Designer and this did the job.

Best regards

Chris
Christof
Top achievements
Rank 1
 answered on 11 May 2011
5 answers
151 views
Hi,
 I was trying to use Client side script as suggested from here
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/opening-the-new-appointment-form-and-pre-populating-fields.aspx

to open a new Appointment by clicking as button. However I get the Javascript error as follows ..

Uncaught TypeError: Cannot call method 'getTimezoneOffset' of null
I am able to create "New appointment" from the context menu of the Scheduler control. But not from a button outside. Please suggest.

Thanks
Sanjeev
Sanjeev Bora
Top achievements
Rank 1
 answered on 11 May 2011
5 answers
162 views
I just recently purchased the Telerik Ajax RAD controls and I was wondering if it is possible to move a child node from one parent node to a different parent node in the TreeList control?  I didn't see a demo for this type of functionality, so I was wondering if it's included.  If not, would it be possible to customize the control to allow this functionality?  I noticed a forum post "TreeList Drag'n'Drop Example (jQuery)" where someone customized the control to have drag and drop functionlity.  Would that customization allow moving child nodes to different parent nodes (I'm not technical, so I can't read the code and try it out)?

Thanks!
Karen
Sebastian
Telerik team
 answered on 11 May 2011
3 answers
488 views
Hi,

I would like to double click on the grid item then display the grid item detail as popup similar to the edit mode but read only.

How can I  achieve this/

Thanks
Gimmik
Top achievements
Rank 1
 answered on 11 May 2011
1 answer
138 views
Hi. We're using the RadEditor but it's not allowing the user to upload any PowerPoint files. Having searched the topic it would seem that it should be a fairly simple case of amending the SearchPatterns, but this seems to have no affect. Below are the two variations I have used;
DocumentManager-SearchPatterns="*.*"
DocumentManager-SearchPatterns="*.doc, *.txt, *.docx, *.xls, *.xlsx, *.pdf, *.pps, *.ppsx, *.ppt, *.pptx"

To be precise, this relates to the document manager that you reach if you go to add a hyperlink into the content, then select the attachment icon next to the url finder, then select upload. It always shows the default:
File extensions allowed: *.doc, *.txt, *.docx, *.xls, *.xlsx, *.pdf

Hope you can help.

Thanks,
Chris
Rumen
Telerik team
 answered on 11 May 2011
5 answers
151 views
I have a RadGrid with 10 columns.

The horizontal scrollbar appears whereas I'd need the column data to be wrappable so that e.g. "FirstName Surname" appears in 2 lines rather than one line so that we won't need to have the scrollbar.

How could it be done?

Many thanks,
Pavlina
Telerik team
 answered on 11 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?