Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
346 views

Hello

I have a radEditor for which I need to provide relative paths for its various CSS files.

For example:

<CssFiles>
  <trk:EditorCssFile Value="stylesheets/EditorContentArea.css" />
</CssFiles>

where the 'stylesheets' folder would be a subfolder in the same folder as the markup and code files.

But the relative path doesn't work, whereas using an absolute path is successful, e.g., this path does find the CSS file in question:

<CssFiles>
  <trk:EditorCssFile Value="~/[path_to_my_stylesheets]/EditorContentArea.css"

</CssFiles>

What could be occurring here? Is the a behaviour that can be configured and changed somehow to enable the use of a relative path. Possibly at the time of processing, the relative path is being determined from a different location to that of the markup file?

If anyone can point me in the right direction it would be very greatly appreciated!

Regards

 

Rumen
Telerik team
 answered on 21 Apr 2012
1 answer
153 views
I'm getting the following error when attempting to open a new radcontrols ajax web application project (VS2010):

Error executing custom action
Telerik.Web.UI.VSX.Actions.UnfoldFilesAction: Exception of type
'Telerik.VSX.TextTemplating.TemplateException' was thrown.

This just started happening in the last couple of days.  I am totally up-to-date on my RadControls and have reinstalled from the latest download with the same result.

Thanks.
Petar
Telerik team
 answered on 21 Apr 2012
1 answer
191 views
The treeview sorts the items regardless of the way they are added to it (as a collection or individually).
I'd like to disable the auto sorting of the items in the tree but so far can't see the .sort() method as outlined in some other posts.

The version used is v2012.1.301.35 Trial.

Plamen
Telerik team
 answered on 21 Apr 2012
1 answer
50 views
I would like to use the RadDateInput in such a way that it only displays the short month followed by the full year, but only requires the entry of the month number and the short year. For example, a user can input 4/12 and it will display Apr 2012.

If I do something like:
<telerik:radDateInput ID="DateInput2"
runat="server"
DisplayDateFormat="MMM yyyy"
DateFormat="MM/yy">
</
telerik:radDateInput>
it throws an error in Javascript "SCRIPT5007: Unable to get value of the property 'Month': object is null or undefined"

Adding a 'd' somewhere into the DateFormat but keeping the 'MM/yy' first so that it reads something l ike 'MM/yy/d' will work how I want, however, if a user needs to edit a date, clicking into the field changes the text to 04/2012/[today's day number] which is confusing since the only data that is relevant in the field is month and year.

I find that this error actually gets thrown if you ever omit anything from the DateFormat; having only day and year, only day and month, or only month and year will cause this error to be thrown. Is there any way around this? Or is that a limitation based on the current design of the control?
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Apr 2012
2 answers
241 views
Hello friends,


We are using RadEditor in our application.I am getting problem with OnClientPasteHtml() .This event is woking only when i paste something in Design mode and not working in HTML mode of RadEditor.
I have also tried to attach onpaste event  but its also not firing when i paste something on Editor's HTML mode.
I don't know where is going wrong in my code.
This is my code,

<script type="text/javascript">
 function OnClientLoad(editor, args) {                
                editor.attachEventHandler("onkeydown", function(e) {
                    setTimeout(function() {                 
                    var length = $find("<%=RadEditor1.ClientID %>");
                       
                    }, 0);
                });

                editor.attachEventHandler("onpaste", function(e) {
                    setTimeout(function() {                      
                        var length = $find("<%=RadEditor1.ClientID %>");

                    }, 0);
                });

            }


 </script>
<
telerik
:RadEditor runat="server" ID="RadEditor1"
StripFormattingOnPaste="NoneSupressCleanMessage" OnClientLoad="OnClientLoad"

 

</telerik:RadEditor>
onkeydown is working fine but onpaste not working.
Any idea?

Thanks in Advance
Rehan


Rumen
Telerik team
 answered on 21 Apr 2012
1 answer
80 views
Hi, I am trying to populate a RadGrid with a sub table. i can't manage to get the sub table populated (the link between table doesn't seems to be correctly setup).

I have manager to make it working with a simple grid having the property AutoGenerateHierarchy="true" and providing a single dataset with DataRelation.

How can I make it work without the setting AutoGenerateHierarchy? I don't want the columns to be automaticaly populated.

Can you help me?

--------------- ASP code ---------------------
<telerik:RadGrid runat="server" ID="MainGrid" Skin="Office2007"  Height="100%" Width="100%"
    AutoGenerateHierarchy="false" AutoGenerateColumns="false">
    <MasterTableView HierarchyLoadMode="Client">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="SubTableID" Name="SubGrid" Width="100%"
                AutoGenerateColumns="false">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="SubTableID" MasterKeyField="ID" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn HeaderText="SubTableID" DataField="SubTableID" />
                    <telerik:GridBoundColumn HeaderText="ValueColumnInSubTable" DataField="ValueColumnInSubTable" />
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridBoundColumn HeaderText="ID" DataField="ID" />
            <telerik:GridBoundColumn HeaderText="ValueColumnInMainTable" DataField="ValueColumnInMainTable" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
  

---------------- VB code ------------------------
   Dim dsMain As DataSet = GetMainDataset()
   Me.MainGrid.DataSource = dsMain

   Dim dsSub As DataSet = GetSubDataset()
   Me.MainGrid.MasterTableView.DetailTables(0).DataSource = dsSub
   Me.MainGrid.DataBind()
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Apr 2012
1 answer
72 views
Hi, I looking for an implementation example where there is a new button located beside the combobox. When new button click, a popup appear for user to enter new value. when saved, the new value gets populated in the combobox for selection. Not sure doable in web form. Any suggestion welcome. Thanks!

Regards
cwk
Kalina
Telerik team
 answered on 21 Apr 2012
3 answers
508 views

Anyone know how to programmatically add rows to a detail table in hierarchical radgrid?  I need to add rows to an unknown number of details tables at one time based on values the user has selected in a listbox. 

protected void btnAdd_Click(object sender, EventArgs e)
{
    foreach (RadListBoxItem li in lbSnSelected.Items)
    {
        foreach (GridDataItem gi in rgDefects.Items)
        {
            if ((gi.OwnerTableView.ParentItem as GridDataItem).GetDataKeyValue("SERIAL_NBR").ToString()
                == li.Value)
            {
                GridTableView tv = (GridTableView)gi.ChildItem.NestedTableViews[0];
 
                //Need to insert using Grid Item but not sure how to create and fill grid item object from
                //Details table
                //tv.InsertItem(ddTest.SelectedItem.Text, ddTest.SelectedValue, ddRefDes.SelectedValue,
                //    ddDefect.SelectedItem.Text, ddDefect.SelectedValue, rddTech.SelectedValue, DateTime.Now);
                //tv.Rebind();
            }
        }
    }
}
Marin
Telerik team
 answered on 21 Apr 2012
3 answers
215 views
I'm trying to find the best way to make an _AjaxRequest fired from client side java script update select controls on my page that has a masterpage.  The control may also be within a user control.  

Currently I have a master page with an AjaxManager on it as follows:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientIDMode="Static"
       RequestQueueSize="1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
       <ClientEvents OnRequestStart="requestStart" />
   </telerik:RadAjaxManager>

I then have a aspx page using the master page my aspx page has a ajaxmanager proxy on it. On the aspx page I have a radbutton that will call a java script function to make an ajaxrequest as follows:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    </telerik:RadAjaxManagerProxy>
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            // Ajax Request
            function CallJSFileInitAjaxRequestFromButtonPress()
            {
                // alert('Start Request');
                initAjaxRequest("Pressed");
                // alert('End Request');
            }
 
function initAjaxRequest(RequestType)
{
        $find("RadAjaxManager1").ajaxRequest(RequestType);
}
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Click Me" OnClientClicking="CallJSFileInitAjaxRequestFromButtonPress">
    </telerik:RadButton>
    <asp:Label ID="lblUpdate" runat="server" Text="Loaded..."></asp:Label>
</asp:Content>

Everything works and the server side code will get called and I attempt to update the label lblupdate.  The problem is that it will not update the browser.  I was able to get this to work without a master page but when I put the masterpage in the screen will not refresh.  

From my codebehind I'm adding the ajaxsetting:
Telerik.Web.UI.RadAjaxManager myManager;
myManager = (Telerik.Web.UI.RadAjaxManager)Page.Master.FindControl("RadAjaxManager1");
myManager.AjaxSettings.AddAjaxSetting(Page.Master.FindControl("RadAjaxManager1"), Page.Master.FindControl("MainContent").FindControl ("lblUpdate"));


Iana Tsolova
Telerik team
 answered on 21 Apr 2012
4 answers
304 views
Ok, first of all hi :)

ALready programming two-months with Telerik, I feel I started to get the grip of things. However there is something that has troubled me for the past few days in my work trying different implementations, but I still cannot seem to find a solution....

What I want to do:
I want to redirect to a new page through a button ( - I don't know if there are practical differences between Image and Link button other than how it is viewed on the user, but I prefer ImageButton - ), which also will pass a variable it in the url (http://www.lala.com?var=myvar - any other way are acceptable)

What I currently do:
In my .aspx file I have
(Grid Properties)
<
 
telerik:RadGrid ID="rdEthnologicalImages" runat="server"
 
AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0"
 
AllowPaging="True" ShowStatusBar="True" GridLines="None"
 
OnItemCommand="RadGrid_Command" OnNeedDataSource="RadGrid_NeedDataSource"
 
OnItemDataBound="RadGrid_ItemDataBound">

(Grid Buttons - Download is the button to redirect, Link keeps the text to parse)
<telerik:GridButtonColumn
    FilterControlAltText="Filter Download column" HeaderText="Download"
    ImageUrl="~/Img/download.png" ItemStyle-HorizontalAlign="Center" Text="Download"
    CommandName="Download" UniqueName="Download"><HeaderStyle Width="50px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="Link"
        FilterControlAltText="Filter ImageLink column" HeaderText="Link"
        UniqueName="ImageLink" Visible="False">
</telerik:GridBoundColumn>

In my .cs file
(I eventually found out that LinkButton has no OnCLick attribute, so that brings me at a dead end...I think..)
(After it found the correct element, it should call the javascript function in the MasterPage - included in the <head>)
if (e.Item.ItemType == GridItemType.Item)
            {
                GridDataItem dataItem = (GridDataItem)rdEthnologicalImages.MasterTableView.GetItems(GridItemType.Item)[0];
                //LinkButton downloadButton = (LinkButton)dataItem.FindControl("Download");
                LinkButton downloadButton = (LinkButton)e.Item.FindControl("Download");
                if (downloadButton != null)
                {
                    downloadButton.Attributes.Add("OnClick", "popup");
                }
            }


In my .js file
(Since I have the text I need in a hidden column, I get it and pass it to the page I want)

function popup()
        {
 
            var grid = $find("<%=rdEthnologicalImages.ClientID %>");
            var MasterTable = grid.get_masterTableView();
            var selectedRows = MasterTable.get_selectedItems();
 
            for (var i = 0; i < selectedRows.length; i++)
            {
                var row = selectedRows[i];
                var link = MasterTable.getCellByColumnUniqueName(row, "ImageLink");
                window.open("~/DownloadPopup.aspx?filename=link");
                break;
            }
        }


Errors:
My main error is that downloadbutton(.cs) is always null. And even if it progressed properly I already have a bad feeling it won't work even then.

For some parts, I am not even 100% of what their functions are.
Any help in the matter?
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Apr 2012
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
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
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?