Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
184 views
Hello to all,

Me and my team are very "fresh" in working with Telerik Dev Tools and we are exploring its potencials to see how can we use them in the platform we are developing. We are very excited with the available controls but we have some concerns on the correct usage of the controls and which are the best practices to use them.

Today's doubt is regarding the RadAjaxManager best usage.
Our web platform is using Master Pages to have similar GUI and implement many global functions. Also we have different web controls that can be reused on different pages. These controls can make partial updates and like that needed to be "ajaxified" for Rad Ajax Manager, which is a control we want to use to have more flexibility on the Partial Updates and on the controls that trigger these Updates.
With some quick readings we caught and resolve some issues regarding the usage of ascx with Rad Ajax Manager and the best practice is to register the control programatically. We created a simple method on the Page that receives a Control and register it on the Rad Ajax Manager updating some Panels that are on the same Page. We implemented this approach (see code bellow) with good results.
//this method will be available on each page
public void AjaxifyControl(Control ctrl)
{
    //Add the necessary AJAX setting programmatically
    RadAjaxManager1.AjaxSettings.AddAjaxSetting(ctrl, Panel1);
    RadAjaxManager1.AjaxSettings.AddAjaxSetting(ctrl, Panel2);
    RadAjaxManager1.AjaxSettings.AddAjaxSetting(ctrl, Panel3);
}

But now we have a dillema... With the massive usage of the Telerik Controls we have a "Software Design doubt" about where to put the Rad Ajax Manager?
  1. On the Master Page and like that we only allow to programatically register all the "Ajaxified Controls" with all "Updatable Controls", leaving the register decision for each page, but taking the risk that could be many pages without really needing the RadAjaxManager. We think allowing this by making available a method similar to the one i show bellow: 
    //this method will be available on the Master Page.
    public void RegisterAjaxSetting(Control ajaxifiedCtrl, Control updatedCtrl)
    {
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(ctrl, updatedCtrl);
    }
  2. On all needed Pages (we have this approach right now) having a mix between Markup registered controls (the ones that can be registered thru markup -> basic Page controls) and Programatically registered controls (the ones that exists on the Web User Controls ans need to be added by code), creating a RadAjaxManager on each page that needs a Rad Ajax Manager.

We want to know if exists some documentation that can help us with that or simply which is the best practice that you guys advise.

Many thanks in advance.
Hugo Salgado
Maria Ilieva
Telerik team
 answered on 15 Jul 2013
1 answer
104 views
Hi,

I'm having issues sorting a Grid groupped by default.

The thing is that I have a Grid groupped by Department (The grid displays all users within the company). Inside that grouping I want to apply a custom sort order (I have a numeric Order field) but it does not happen.

If I'm not groupping by default the users appear correctly, but when I apply a groupby expression

<GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <SelectFields>
                        <telerik:GridGroupByField FieldAlias="Departamento" FieldName="Departamento" FormatString="{0}"> </telerik:GridGroupByField>
                    </SelectFields>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="Departamento" SortOrder="Ascending"></telerik:GridGroupByField>
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>

it applies an unkown order, my datasource is an SQL and i've tried to apply my custom sort using the "Order By" clause in the "Select".

What I'm doing wrong?
Maria Ilieva
Telerik team
 answered on 15 Jul 2013
1 answer
53 views
I use a RadGrid for displaying, inserting, deleting and updating rows.
I want to have any input field for an image path, that is selected via the standalone ImageManager.
In display mode just the path should be shown without the button for the ImageManager. In update mode the path already saved in the database should be displayed.
I found this article:
http://www.telerik.com/support/kb/aspnet-ajax/editor/using-the-image-and-document-managers-outside-radeditor.aspx

That is working pretty good outside the grid. However how can I realize such a textbox and an upload button inside a RadGrid item in edit / insert mode? Anyhow I have to register the JavaScript event handler, but how to get the ClientIDs for building the correct JS?
Kostadin
Telerik team
 answered on 15 Jul 2013
2 answers
124 views
Hello,

I am having a problem getting RadAjaxManager_AjaxRequest to update a control on the page.  Here is my scenario...

I have a page with RadAjaxManager declared as below...

<telerik:RadAjaxManager ID="ramMain" runat="server" OnAjaxRequest="RamMain_AjaxRequest">

I have a standard asp:Repeater bound to a datasource server side, it is wrapped in an asp:Panel and it is laid out like so..

<div runat="server" id="caseStudyDisplayPanel" class="span6">
<asp:Repeater ID="rptrCaseStudies" runat="server" ClientIDMode="Static">
<HeaderTemplate>
<ul id="List">
</HeaderTemplate>
<ItemTemplate>
<li>
<div><%# DataBinder.Eval(Container.DataItem, "Name") %></div>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</div>

Above the repeater I have a "Add New" button which pops a RadWindow, Containing a UserControl with a RadGrid.  Each Row in the popup grid has a "Select" button, which triggers the RowSelected event.  On RowSelected I do some small javascript functions then hand off to the ajaxManager.ajaxRequest request via javascript passing over the info from the selected row.  So far so good, everything works to this point...the server side method (RamMain_AjaxRequest) gets fired and runs perfectly.  The last thing I do in the request is add my newly selected row to the datasource, and rebind the repeater.  On rebind (if I add a break point) I see exactly what I am expecting with the newly added item included in the datasource collection.  Problem is the screen never updates.  If I save at this point, and come back the item is there, so I know it is getting added, just not displayed.

What should be added to the AjaxSetting to accomplish this?  It seems I have tried every combination of controls and cannot see the update.  Here is my current seetings (which aren't working)

<telerik:AjaxSetting AjaxControlID="ramMain">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="caseStudiesWrapper" />
                    <telerik:AjaxUpdatedControl ControlID="rptrCaseStudies" />
                </UpdatedControls>
            </telerik:AjaxSetting>   
<telerik:AjaxSetting AjaxControlID="caseStudiesWrapper">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="caseStudiesWrapper" />
                </UpdatedControls>
            </telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="rptrCaseStudies">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rptrCaseStudies" />
                </UpdatedControls>
            </telerik:AjaxSetting>

Thanks So Much!!
Konstantin Dikov
Telerik team
 answered on 15 Jul 2013
3 answers
175 views
I am trying to get to a control in the edittemplate on postback but EditItems[0] returns null.
I check MasterTableView.IsInserted and it shows true.
The grid is part of a user control that opens a new window to enable entering of a new item in order to add it to the combobox in the edit form if it does not exist.
If I skip past the code to update the combobox the grid displays with the insert form open.
The program flow is:
Main page has a grid with a user control for editing, that control will open a window with a control (page 1) containing a grid in order to add a new item to the main page combobox, the return from (page 1) will populate the combo as expected.
(page 1) can also open a window (page 2) with a user control containing a grid to add an item to the combobox on (page 1)
When (page 2) return to (page 1) the grid on (page 1) is the one that returns null for EditItems[0] but shows the grid in insert mode.
Below is the code behind:
if (Request["__EVENTTARGET"] == "wndEquipmentRental")
{
    if (Request["__EVENTARGUMENT"] != "undefined")
    {
        if (RadGrid1.MasterTableView.IsItemInserted)
        {
            GridEditFormInsertItem insItm = RadGrid1.EditItems[0] as GridEditFormInsertItem;
        }
 
        else
        {
            GridEditFormItem editItm = RadGrid1.EditItems[0] as GridEditFormItem;
        }
    }
}

Kostadin
Telerik team
 answered on 15 Jul 2013
6 answers
338 views
I have a aspx page that I open in a radwindow.  On this page is a button that when clicked updates some other elements on the page, and should change the Page.Title which should then be reflected in the radwindow caption.

This works fine & dandy, unless I ajaxify the button. If I use the ajaxmanager to update the other controls when the button is pressed, they update quickly, and the Page.Title does change, but it's not updated in the radwindow caption.

 I'd prefer to use ajax to update the few items on the page, rather than a full postback.  Anybody out there have a solution ?

ver.  2010.1.519.35
Marin Bratanov
Telerik team
 answered on 15 Jul 2013
1 answer
84 views
Dear Telerik Team,

I'm using your RadTileList control on one of my ASP.NET C# projects. This is a very nice addition to the suite, but I feel it is still very "raw". 

I would appreciate your inputs on the following:

- Add a background image to the TileList, and then somehow attach it to the scrolling events, so that I can create a nice parallax effect when the user scrolls through the TileList.
- How to increse the scroll velocity ? I haven't found any property.
- How to add a title to each TileGroup ? This object only has the collection of Tiles.

Thank you in advance for your answers,
Keep up the good work
Marin Bratanov
Telerik team
 answered on 15 Jul 2013
3 answers
178 views
Hi Admin,



I want to display

Pivot Data

with RadGrid control , i have gone through the link
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/pivot/defaultcs.aspx

it helps me but i want some modification

like i dont want to bind grid with automatically generated columns
bcz i need some image fileds and hyperlink fileds and gridtemplate columns
so I want to work with atugeneratedcolumns set to false
and manually adding labels to itemtemplates.

Any help really appreciated (Need help with code)

Thanks
Radoslav
Telerik team
 answered on 15 Jul 2013
1 answer
167 views
HI,
 I am using Rad Editor in my project that I have created with VS2010.   As per my project requirement, I have a html table in radeditor and i want  no one can change the content of this table in design mode as well as in preview mode. 
I have tried to unselect to table on OnClientSelectionChange event of rad editor. But it work only in IE not in other browsers. please help me.
i have use this code.
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="demo.aspx.vb" Inherits="ComplianceTable.demo" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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>
    <telerik:RadScriptBlock ID="scriptBlock" runat="server">
        <script type="text/javascript">
            function OnClientSelectionChange(editor, args) {
                editor.getSelection()._window.document.selection.empty();
            } 
        </script>
    </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadEditor runat="server" ID="RadEditor11" OnClientSelectionChange="OnClientSelectionChange"
            AllowScripts="true">
            <Content>
              
   <table style="width: 700px; margin-top: 20px; margin-left: 15px; border-top-color: rgb(37, 160, 218);
            border-right-color: rgb(37, 160, 218); border-top-width: 1px; border-right-width: 1px;
            border-top-style: solid; border-right-style: solid; float: left;" id="Table1"
            cellspacing="0" cellpadding="0">
            <tbody>
                <tr style="background-color: rgb(205, 242, 242);" >
                    <th>
                        <div contenteditable="true">
                            <b>Header0</b></div>
                    </th>
                    <th>
                        <div contenteditable="true">
                            <b>header1</b></div>
                    </th>
                    <th>
                        <div contenteditable="true">
                            <b>Header2</b></div>
                    </th>
                </tr>
                <tr>
                    <td >
                        <div contenteditable="true">
cell0
                        </div>
                    </td>
                    <td  >
                        <a contenteditable="true"  onclick="return true;" href="">http:// </a>
                    </td>
                    <td  >
                        <div contenteditable="true">
                          cell1</div>
                    </td>
                </tr>
                <tr >
                    <td >
                        <div contenteditable="true">
                         cell0
                       </div>
                    </td>
                    <td >
                        <a contenteditable="true" href="">http:// </a>
                    </td>
                    <td >
                        <div contenteditable="true">
                           cell1
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
            </Content>
        </telerik:RadEditor>
    </div>
    </form>
</body>
</html>


Ianko
Telerik team
 answered on 15 Jul 2013
0 answers
171 views
Hi,

We are looking to use Imperva as a CDN and in testing, it is flagging up XSS issues with codetemplates.xml

Looking in Codetemplates.XML, there are references sucha as {0}, {1} etc  which are triggering the Imperva XSS attack analysis.


Is there anything we can do to circumvent this ?  (using 2010 Rad Ajax)

Is there a risk in removing or commenting out the {0} etc?

Regards
Paul

Paul Buxton
Top achievements
Rank 1
 asked on 15 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?