Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
61 views
Hi Telerik Team,

Please I need to know how to change the HeaderContextMenu items order.
For example, I want the item "Columns" to be the 1st item in the HeaderContextMenu.

Please let me know how can I achieve this.

Thanks,
Bilal
Marin
Telerik team
 answered on 15 Dec 2011
3 answers
89 views
Hello,

I just added my first webresource/scriptresource to a project.
The class for which I added this contains a RadTreeView.
Since I added this, I get this (server-side) error when the browser tries to load Telerik.Web.UI.WebResource.axd:

   bei Telerik.Web.UI.CombinedScriptWriter.RegisterNamespace(TextWriter builder, String typeName, Boolean isDebug)
   bei Telerik.Web.UI.CombinedScriptWriter.WriteAssemblyScriptResources(TextWriter outputWriter, ScriptEntry scriptEntry)
   bei Telerik.Web.UI.CombinedScriptWriter.WriteScripts(List`1 scriptEntries, TextWriter outputWriter)
   bei Telerik.Web.UI.CombinedScriptWriter.GenerateResponse(List`1 scriptEntries, String hiddenFieldName, String combinedScripts)
   bei Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile()
   bei Telerik.Web.UI.CombinedScriptWriter.WriteCombinedScriptFile(Page page, HttpContext context)
   bei Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context)
   bei System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

This is the code which leads to the exception (the class implements IScriptControl):
public IEnumerable<ScriptReference> GetScriptReferences()
 {
         yield return new ScriptReference("HierarchyTree1.HierarchyTree.js", GetType().Assembly.FullName);
}

When I use a non-existant scriptreference (e.g. "xxx.js") I won't get that error.
Please tell me if you need additional informations.

Regards,
JP

Edit: I just tested this without any telerik component involved and everything works. Somehow the TelerikWebResource won't work together with mine.
Edit2: Using a ScriptManager instead of a RadScriptManager helps.
Simon
Telerik team
 answered on 15 Dec 2011
2 answers
108 views
Hi, I've tried various css/manuals/snippets to get RadSplitter within RadWindow automatically resize on RadWindow resize. I wonder if there's known way to do it without conditionally heavy client-side js.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GlobalException.aspx.cs"
    Inherits="GlobalException" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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></title>
</head>
<body>
    <form id="form2" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <telerik:RadFormDecorator ID="FormDecorator" runat="server" DecoratedControls="all" />
    <telerik:RadSkinManager runat="server" ID="SkinManager" Skin="Windows7" PersistenceKey="Skin"
        PersistenceMode="ViewState" />
    <telerik:RadWindowManager ID="CommonWindowManager" runat="server" Behaviors="Resize, Maximize, Move">
        <Windows>
            <telerik:RadWindow ID="ExceptionWindow" runat="server" VisibleOnPageLoad="true">
                <ContentTemplate>
                    <telerik:RadSplitter ResizeWithParentPane="true" ResizeWithBrowserWindow="true" ID="MainSplitter" runat="server" Orientation="Horizontal">
                        <telerik:RadPane ID="TopPane" runat="server">
                            <telerik:RadTabStrip ID="exceptionTabStrip" runat="server" SelectedIndex="0" MultiPageID="exceptionMultiPage">
                                <Tabs>
                                    <telerik:RadTab runat="server" Text="message" Selected="True">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="details">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                        </telerik:RadPane>
                    </telerik:RadSplitter>
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    </form>
</body>
</html>

I tried clean code from
http://demos.telerik.com/aspnet-ajax/splitter/examples/resizewithwindow/defaultcs.aspx
Everything works in browser page and in RadWindow with Url on another page but not in RadWindow's <ContentTemplate>.

!important: It is only acceptable to me to have a SINGLE page for RadWindow with controls without external url as in windowManager.open("Window.aspx", "Window");

Thanks
Max
Top achievements
Rank 1
 answered on 15 Dec 2011
4 answers
103 views
Everyone at Telerik who has dealt with me knows that I absolutely love your company and the great products you produce.  However, I do have a complaint/suggestion:

I've noticed that the vast majority of your demos and documentation and forum responses are strictly client-side solutions.  I realize that this is great for some developers but I would bet that there are a whole lot of your customers like me who:
  1. Are developing corporate web-based solutions that involve < 500 users.
  2. When it comes to the frequent battle between a Rich-UI and Lightning Fast Speed, often the UI is much more important.
  3. In my particular case, all of my server-side code is written in C#.  There are HUGE benefits to keeping as much of the codebase in C# and minimizing the amount of Javascript & jQuery code.
  4. Because of #1, scalability problems associated with keeping lots of state variables on the server is NOT an issue.

In my particular case, I'm building a web-based intranet app for a multi-billion dollar company.  But within that company its actual userbase will be less than 50.  As was the case with the app's VB6 WinForms predecessor, I will almost certainly be required to make periodic improvements to it over the next decade.  Because of this it's critically important to minimize the amount of client-side code and instead maximize the amount of type-safe, well structured server-side code.

To Telerik, all I'm asking for is this: Wherever possible, please include a server-side solution (or mostly server-side solution) where you have traditionally presented a strictly client-side solution in times past.  This will go a LONG WAY to helping developers (and loyal customers) like myself.

Sincerely,

Robert Werner
Vancouver, BC

Iana Tsolova
Telerik team
 answered on 15 Dec 2011
1 answer
189 views
Is it possible to use JQuery to select and modify properties on Telerik ASP.NET Ajax controls?

For example, I have the follow code which works fine to disable the ASP.NET textboxes on a particular form, but does not touch the RadComboBoxes or the RadDatePickers, even though they have the appropriate class.

        $(".datafield").attr("disabled", "disabled");

Is there any way, or do I have to select the Telerik controls one by one with Javascript, per the samples in help?:

    var combo = $find("<%= RadComboBox1.ClientID %>"); combo.disable();
    var picker = $find("<%= RadDatePicker1.ClientID %>"); picker.set_enabled(false);


Dobromir
Telerik team
 answered on 15 Dec 2011
3 answers
122 views
My apologies if this has come up before but when using the ShowIcon mode is there a way to make this work properly with No colour?

If I select no colour then the colour shown in the Icon is white - not the nothing icon (checked background with a red line through it).  I appreciate the fact that it does work behind the scenes but visually this is very misleading to the user.

When opening a form how do I know which are set to white and which are set to no colour?  This wouldn't be so much of a worry if when clicking the icon you could tell if white or no colour is picked but you can't - there is no indication whatsoever which is the active colour.

Does anyone know of a work around and can this be added as a bugfix or improvement (depends on your viewpoint but I regard as a bug).

Best Regards,

Jon

Jon
Top achievements
Rank 1
 answered on 15 Dec 2011
1 answer
110 views
As part of my reworking to try and avoid having to use the standard FormView component - as sadly no-one has yet developed a good alternative :(  - I am trying to use RadGrids and RadTreeLists to allow for my New, Edit and View requirements.  

I've got the new and edit forms kind of working (subject to some more help from support) but am having a dilemma re the view form.

My Edit and New forms use a popup formtemplate and that works very well.  I'd like the view only form to be similar.  Has anyone had experience doing this?

I see three potential ways to achieve this:
1) Use some form of detail template to popup a form and show data - the downside is that it means maintaining a second template.
2) Somehow use the FormTemplate and have some code to strip out the fields replacing them with labels showing the data.  I think that this would be the preferred option as it would mean consistency between forms and reuse of code.
3) Same as above but make the fields all read only to prevent user editing.  Downside is that they will look grey.

I haven't been able to find any demos for this kind of thing - some would be useful in the demos section :)

Any pointers?

Best Regards,

Jon
Tsvetina
Telerik team
 answered on 15 Dec 2011
1 answer
79 views
Hi,

Is-it possible to have two TextBox for each node?
Do you have an example in C#?

Thanks

      Michel


Princy
Top achievements
Rank 2
 answered on 15 Dec 2011
1 answer
98 views
Hi there,

I have used the second option for scrolling in grid of following link:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpagingclientbinding/defaultcs.aspx


I want to implement the custom paging along with it. When i am trying to implement both of them, ajax panel goes on loading infinitely..

 Below is the code Snippet for Grid:

<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="prospectGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="prospectGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="prospectGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </telerik:RadAjaxManager>
<telerik:RadGrid ID="prospectGrid" AllowFilteringByColumn="true" AllowPaging="True"
                PageSize="50" runat="server" AllowSorting="true" OnNeedDataSource="prospectGrid_NeedDataSource"
                GridLines="None" AllowMultiRowSelection="false" Height="450px" OnItemDataBound="OnDataBound">
                <PagerStyle Visible="false" />
                <MasterTableView DataKeyNames="ID" TableLayout="Fixed" AutoGenerateColumns="false">
                    <Columns>
                        <telerik:GridBoundColumn DataField="ID" HeaderText="ProspectId" Display="false" UniqueName="ProspectId" />
                        <telerik:GridTemplateColumn DataField="Live" HeaderText="Live" AllowFiltering="false"
                            HeaderStyle-Width="30px">
                            <ItemTemplate>
                                <center>
                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/live.png" Visible='<%#Eval("Live") %>' /></center>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="PartnerCompany" HeaderText="Partner Company"
                            UniqueName="PartnerCompany" />
                        <telerik:GridBoundColumn DataField="PersonName" HeaderText="Person Name" UniqueName="CustomerName" />
                        <telerik:GridBoundColumn DataField="ServiceType" HeaderText="Service Type" UniqueName="ServiceType" />
                        <telerik:GridBoundColumn DataField="PersonContact" HeaderText="Person Contact" UniqueName="Contact" />
                        <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title" />
                        <telerik:GridBoundColumn DataField="PersonDirectNumber" HeaderText="Person Direct No"
                            UniqueName="Phone No" />
                        <telerik:GridBoundColumn DataField="PersonEmail" HeaderText="Person Email" UniqueName="Email" />
                        <telerik:GridBoundColumn DataField="FollowUpDate" HeaderText="FollowUp Date" UniqueName="FollowUpDate" />
                        <telerik:GridBoundColumn DataField="FollowUpDesc" HeaderText="Follow Up Desc" UniqueName="Description" />
                        <telerik:GridBoundColumn DataField="ContractETA" HeaderText="Contract ETA" UniqueName="CotnactETA" />
                        <telerik:GridBoundColumn DataField="ServiceETA" HeaderText="Service ETA" UniqueName="ServiceETA" />
                        <telerik:GridTemplateColumn DataField="NotesDesc" HeaderText="Notes" AllowFiltering="false"
                            HeaderStyle-Width="55px">
                            <ItemTemplate>
                                <center>
                                    <a href="#" onclick="notesClick('<%#DataBinder.Eval(Container.DataItem,"ID")%>'); return false;">
                                        <input type="image" src="images/note.png" /></a></center>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="" HeaderText="Follow Up" AllowFiltering="false"
                            HeaderStyle-Width="70px">
                            <ItemTemplate>
                                <center>
                                    <asp:HyperLink ImageUrl="~/images/schedule.png" ID="schedule" runat="server" />
                                </center>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true" Resizing-AllowColumnResize="true" EnablePostBackOnRowClick="false">
                    <ClientEvents OnRowDblClick="OnRowDblClick" />
                    <Selecting AllowRowSelect="false" />
                    <Scrolling AllowScroll="true" FrozenColumnsCount="3" UseStaticHeaders="true" SaveScrollPosition="true" />
                    <ClientEvents OnScroll="handleScrolling" />
                </ClientSettings>
                <HeaderStyle Width="200px" />
            </telerik:RadGrid>

Below is the Code Snippet for Javascript Function:

<telerik:RadCodeBlock runat="server">     
      function handleScrolling(e) {
                var grid = $find("<%=prospectGrid.ClientID %>");
 
                var scrollArea = document.getElementById("<%= prospectGrid.ClientID %>" + "_GridData");
 
                if (IsScrolledToBottom(scrollArea)) {
                    var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1);
 
                    //if the presently visible items are less than the entire source records count
                    //trigger an ajax request to increase them
 
 
                   if (currentlyDisplayedRecords < 30) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("LoadMoreRecords");
                    }
                }
           }
            //this method calculates whether you have reached the bottom when dragging the vertical grid scroll
            function IsScrolledToBottom(scrollArea) {
                var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight;
                return currentPosition == scrollArea.scrollHeight;
           }
</telerik:RadCodeBlock>

Below is the Code Snippet for .cs file:

protected void prospectGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
       {
           prospectGrid.VirtualItemCount = DbContext.getProspectProfile(startRowIndex ,endRowIndex).ToList().Count();
           int totalCount = prospectGrid.VirtualItemCount;
           int startRowIndex = (prospectGrid.CurrentPageIndex * prospectGrid.PageSize) + 1;
           int endRowIndex = ((startRowIndex + 15) > totalCount ? totalCount : startRowIndex + 15) - 1;
           prospectGrid.DataSource = DbContext.getProspectProfile(startRowIndex ,endRowIndex);
      }

Please help me on this issue.

Regards,
Dhaval
Antonio Stoilkov
Telerik team
 answered on 15 Dec 2011
2 answers
99 views
Hi Experts,

I have been facing strange issue:

While calling radconfirm second time not working as expected.

1) Radconfirm from code behind with callback function.
2) callback function will make ajaxRequest explicitly if user clicks 'Yes'.

Everything is fine for the first time. If user performs same action subsequently receiving error.

Kindly do the needful.
Mohammed
Top achievements
Rank 1
 answered on 15 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?