Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
124 views
Hi!

I have some problems with my custom FileBrowserContentProvider.

I the Image editor I get an error message "Cannot write to the target folder".

I guess it has something to do with the path set in FileItem constructor and/or DirectoryItem constructor.

Ive set uploadpaths to "/" which I read in another forum thread.

Can you please explain how the paths set are used.
Fiko
Telerik team
 answered on 04 Mar 2010
1 answer
148 views
Hello Friends,

I used RadFormDecorator for apply different skin as per skin selection from the combo.

RadFormDecorator is working fine for checkbox, textbox, button etc. but its not working for radgrid.

Why skin are not changed in radgrid as per skin selection from the combo?

Please help me.

Thanks & Regards
Jignesh Patel

Georgi Tunev
Telerik team
 answered on 04 Mar 2010
1 answer
247 views
I have a master/content page with the timer, window, and the code below all in the content page. I am trying to stop the ajax timer when the window shows and then start the timer when the window closes. The windows opens and closes fine.

The problem is that I get a javascript error on the _startTimer() and _stopTimer() functions:

Error: Object doesn't support this property or method

How can I stop and restart the ajax timer?

Thanks!
------------------------------------------------------
Window code:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Web20" Width="500"
        Height="300" VisibleStatusbar="False" ReloadOnShow="True" ShowContentDuringLoad="False"
        DestroyOnClose="True" EnableViewState="False" Modal="True" OnClientClose="enableTimer()"
        OnClientShow="disableTimer()">
        <Windows>
            <telerik:RadWindow runat="server" Left="" NavigateUrl="ShowAmendments.aspx" Style="display: none;"
                Top="" ID="rwShowAmendments" Title="Amendments Information" VisibleStatusbar="False"
                InitialBehaviors="None" Modal="True">
            </telerik:RadWindow>
        </Windows>
</telerik:RadWindowManager>

Timer and javascript code:
    <asp:Panel ID="Panel1" runat="server">
        <asp:timer id="Timer1" runat="server" interval="8000" ontick="Timer1_Tick" />
    </asp:Panel>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script language="javascript" type="text/javascript">
            function openRadWindowAmendments(Measure) {
                var oWnd = radopen("ShowAmendments.aspx?Measure=" + Measure, "rwShowAmendment");
                var TitleBar = oWnd.GetTitlebar();
                var parent = TitleBar.parentNode;

                var oUL = parent.getElementsByTagName('UL')[0];
                //oUL.style.width = "192px";

                var li = document.createElement("LI");
                var a = document.createElement("A");
                li.appendChild(a);
                a.className = "custombutton";
                a.title = "Print Content";
                a.onmousedown = printWin;

                oUL.insertBefore(li, oUL.firstChild);
                oWnd.center();
            }

            function printWin(e) {
                var oManager = GetRadWindowManager();
                var oWnd = oManager.GetWindowByName("rwShowFloorCalendar");
                var content = oWnd.GetContentFrame().contentWindow;
                var printDocument = content.document;
                if (document.all) {
                    printDocument.execCommand("Print");
                }
                else {
                    content.print();
                }

                //Cancel event!
                if (!e) e = window.event;

                return $telerik.cancelRawEvent(e);
            }

            </script>
        <script type="text/javascript" src="scrollsaver.min.js"></script>
   
    <script type="text/javascript">

        function disableTimer() {
            var t = document.getElementById("<%=Timer1.ClientID%>");
            if (t != null) {
                t._stopTimer();
            }
        }

        function enableTimer() {
            var t = document.getElementById("<%=Timer1.ClientID%>");
            if (t != null) {
                t._startTimer();
            }
        }

    </script>
    </telerik:RadCodeBlock>







Georgi Tunev
Telerik team
 answered on 04 Mar 2010
2 answers
72 views
For example i hava two combos.. 2nd combobox with checkboxes.when i select 1st combo then 2 combo bind.....

when i getting problem here


when i change 1st combo  item how can i clear 2nd combo text displayed...


radcombobox1.items.clear() i written   it cleared the items ...but combotext periovs selected data is not cleared....


how can i cleared...
Kalina
Telerik team
 answered on 04 Mar 2010
5 answers
455 views

My application and controls work fine on my local machine, the local dev server, and the remote dev server. I put the dlls in the bin directory and not the GAC to minimize the issues as the application goes through testing on different servers. I moved it to the next step - the link server and it stopped working. 

Server Error in '/' Application.


Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Key_statistics.aspx.cs" Inherits="Default3" %>
Line 2:  
Line 3: <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>Line 4:  
Line 5:  

Source File: /nchs/nhanes/bibliography/key_statistics.aspx    Line: 3

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.Web.UI' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

I searched the forums and added httphandlers, updated, removed, and added version numbers, put "fresh" versions of the dlls in the server's bin directory, but nothing changed.
I followed Atana's blog post - http://blogs.telerik.com/AtanasKorchev/Posts/08-07-18/Web_Resources_demystified_Part_3_Troubleshooting.aspx
and Installed Firebug and when I browse the page, I get a 500 internal error, but nothing like the errors the blog post outlines...I attached a screenshot.

What to do next?
Thanks!
Jen
Pavlina
Telerik team
 answered on 04 Mar 2010
3 answers
338 views
Hi,

We're using Advanced binding, and I have a lot of anomalies with the NeedDataSource event.


The strange things I experience:  (EnableViewState="True")

-the event fires even if the Grid.Visible = false
-the event fires on every postback, with RebindReason = InitialLoad

I have EditMode = EditForms, but the event sequence is the following on every postback, for example the clickhandler of a button in the edit usercontrol
1. Page load
2. NeedDataSource
3. EditControl's PageLoad
4. Close_Click

As far as I know it should be
1. Page load
2. EditControl's PageLoad
3. Close_Click
4. NeedDataSource


I call Grid.MasterTableView.Rebind only in the click eventhandler of my Search button, but it doesn't fire the NeedDataSource event, because it's called a bit earlier, because of the postback...

I've read all the articles and forum threads regarding NeedDataSource, I have no idea what's wrong, it seems that the Grid can't use the Viewstate, but that's enabled at every possible location. Moreover I call TrackViewState on InitComplete, but this behaviour doesn't change.

What should I try?

thanks,


     Attila
Radoslav
Telerik team
 answered on 04 Mar 2010
1 answer
292 views
Hi, long time fan.  I'm just getting into the RadEditor and I'm wondering if you can help me with examples or ideas on the following:
1. Send MailMessage with embedded content - I know how to send embedded content with an alternate view, etc. but I'm wondering how I can enumerate all the embedded images in the editor's embedded content - hoping there's a collection where I can create contend IDs for a mail message.  Is that the right idea?  Or is this something the .NET Mail 3.5 supports, i.e. converts SRC=path.jpg to content ids automatically?

2. Can you send an example of how this would work?  All the examples use a fixed attachment or content ID.  I need to do this automatically.

3. Do I really need to resport to parsing the HTML and string.replace on SRC= everywhere?  Seems like sending RadEditor Mail is like the first thing people do with this editor. 

I'm hoping I can at least get at the embedded collection and string.replace without doing RegExpression pattern matching.

thanks
Marty


Rumen
Telerik team
 answered on 04 Mar 2010
1 answer
132 views
I have a linkbutton, when it is clicked i assign an objectdatasource to my RadGrid. I also assign the same objectdatasource to the same RadGrid in OnNeedDataSource event. At runtime when I click on a column name in the RadGrid the arrow changes to point up and down but the actual values are not sorted. Is the sorting lost somehow or the sorting never worked?
Pavlina
Telerik team
 answered on 04 Mar 2010
5 answers
245 views
Hi,
I am creating a grid at runtime with viewstate enabled. I have a few columns that I am adding to this grid, again, at runtime. The item template and edit item template both have custom templates (that implement ITemplate and IBindableTemplate). And I have textboxes in these columns.

After I present the entire grid in edit mode, upon save, the textbox controls within these columns are "lost" upon postback. I am not able to retrieve them using findcontrol. The custom column definitions are there (but not the textboxes) and also available are the edit item count (basically the number of rows that the grid has in edit). Once I get past this challenge, my hope is to use the built-in functionality to extract the values that changed while editing (exported in HashTable format).

So my question is how can I get the controls from the item collection upon postback (without getting it lost)?

Thanks in advance for any help you can provide.

Let me know if you need to see any other code samples.

Thanks,
RN

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender  
        'grid to display the header  
 
        CreateHeaderGridStructure()  
 
        'grid to display the details (w/o header)  
        CreateDetailGridStructure()  
        grdDetail.Rebind()  
 
    End Sub 

    Private Function CreateDetailGridStructure() As Boolean  
        'get the column metadata to create the column input boxes.  
        Dim drTemplateDetails As IDataReader  
        Dim templateColumn As GridTemplateColumn  
 
        grdDetail.MasterTableView.Columns.Clear()  
        grdDetail.MasterTableView.DetailTables.Item(0).AutoGenerateColumns = False 
        grdDetail.MasterTableView.ExpandCollapseColumn.ItemStyle.Width = Unit.Percentage(4)  
 
        columnDefinitions = New System.Collections.Generic.List(Of GridColumnDefinition)  
        drTemplateDetails = 'Get the data here  
        While drTemplateDetails.Read()  
 
            templateColumn = New GridTemplateColumn()  
            templateColumn.DataField = <the column name> 
            templateColumn.UniqueName = <the column name>            templateColumn.ItemTemplate = New GridDetailTemplate(<the column name>, Me.ClientID, ControlType.Label)  
 
            If <if only viewable column with no edit> Then    
                templateColumn.EditItemTemplate = New GridDetailTemplate(columnDefinition.Name, Me.ClientID, ControlType.Label)  
                If columnDefinition.Type = GridColumnType.Hidden Then  
                    templateColumn.Display = False 
                End If  
            Else   
                'if the grid is in edit mode, then inEditMode = True 
                If inEditMode Then  
                    templateColumn.EditItemTemplate = New GridDetailTemplate(columnDefinition.Name, Me.ClientID, ControlType.PremiumTextBox)  
                Else  
                    templateColumn.EditItemTemplate = New GridDetailTemplate(columnDefinition.Name, Me.ClientID, ControlType.Label)  
                End If  
            End If  
            grdDetail.MasterTableView.Columns.Add(templateColumn)  
        End While  
 
    End Function 

    Private Sub grdDetail_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdDetail.PreRender  
 
 
        'If using itemtemplate/edititemtemplate, then use the following to set the grid in edit mode.  
        'todo: look to combine these following if logics into one  
        If inEditMode Then  
            If IsPostBack Then  
                For Each item As GridItem In grdDetail.MasterTableView.Items  
                    If TypeOf item Is GridEditableItem Then  
                        Dim editableItem As GridEditableItem = CType(item, GridDataItem)  
                        editableItem.Edit = True 
                    End If  
                Next  
                grdDetail.Rebind()  
            End If  
        End If  
End Function 

Public Class GridDetailTemplate  
    Implements ITemplate, System.Web.UI.IBindableTemplate  
 
    Private controlID As String  
    Private clientID As String  
    Private type As ControlType  
 
    'This is the only public constructor. Should also accept the kind of control that needs to be created  
    Public Sub New(ByVal controlID As String, ByVal clientID As String, ByVal type As ControlType)  
        MyBase.New()  
        Me.controlID = controlID  
        Me.clientID = clientID  
        Me.type = type  
    End Sub  
 
 
    Public Function ExtractValues(ByVal container As Control) As Collections.Specialized.IOrderedDictionary Implements IBindableTemplate.ExtractValues  
        Dim returnDictionary As Collections.Specialized.OrderedDictionary = New Collections.Specialized.OrderedDictionary()  
        Select Case type  
            Case ControlType.Label  
                returnDictionary.Add(controlID, (DirectCast(((DirectCast(container, Telerik.Web.UI.GridDataItem)).FindControl(controlID)), Label)).Text)  
 
            Case ControlType.PremiumTextBox  
                returnDictionary.Add(controlID, (DirectCast(((DirectCast(container, Telerik.Web.UI.GridDataItem)).FindControl(controlID)), TextBox)).Text)  
        End Select  
        Return returnDictionary  
    End Function  
 
    Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn  
        'create the control that we want  
        Dim control As New Control  
 
        Select Case type  
            Case ControlType.PremiumTextBox  
                Dim txtBox As TextBox  
                txtBox = New TextBox  
 
                'attributes should be added in the item databound event to be consistent  
                txtBox.Attributes.Add("onblur", "return validateInput(this);")  
                'txtBox.Attributes.Add("onchange", "return testInput(this);")  
                'txtBox.Attributes.Add("onchange", "return addNumbers('" + txtBox.ClientID + "')")  
                'should be in the textbox control  
                txtBox.MaxLength = 14 
                txtBox.Width = Unit.Pixel(100)  
                txtBox.Style.Add("text-align", "right")  
                'txtBox.ClientEvents.OnValueChanged = "calculateTtl" 
 
                'event handler to handle the databind event  
                control = txtBox 
                AddHandler control.DataBinding, AddressOf Me.TextBox1_DataBinding  
         End Select  
 
        'set the id to be an unique identifier for that row  
        control.ID = controlID 
 
        'add the control to the control collection  
        container.Controls.Add(control)  
End Function  
 
    Public Sub TextBox1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)  
        Dim textbox As TextBox = CType(sender, TextBox)  
        Dim grid As GridDataItem = CType(textbox.NamingContainer, GridDataItem)  
        Dim item1Value As String = DataBinder.Eval(grid.DataItem, controlID).ToString  
        CType(grid.FindControl(controlID), TextBox).Text = item1Value 
    End Sub  
End Class 
Mira
Telerik team
 answered on 04 Mar 2010
6 answers
157 views
Hi,

I have a grid with alternating items with hover properties and with possibility to select.
When I select the second item (or every other second alternate item) then the UI is incomplete as in the picture, that is, only the first portion of the row is selected and the rest not. Any ideas?

Thanks,
Lektira
Radoslav
Telerik team
 answered on 04 Mar 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?