Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
Is there a way to add column (preferably static) at the end of a grid to contain sum of other columns? Thank you
Princy
Top achievements
Rank 2
 answered on 18 Jun 2014
2 answers
214 views
I am using the TabStrip to dynamically add PageView's to my MultiView as shown in the "RadTabStrip and RadPanelBar for ASP.NET AJAX – Overview" training tutorial.

Everything works 100% fine, until I put it into a LoginView. Once the TabStrip and MultiPage are located inside a LoginView within the AnonymousTemplate (or any other "view" of the LoginView) and I run the code, the first click on any tab causes a Postback to be fired instead of an Ajax-Postback call. Once the postback is completed (i.e. the page is "reloaded") and I click on another tab (not the one I previously clicked), then the Ajax-Postback call happens as it should have the first time. If I place the TabStrip and the Multiview outside the LoginView, the Ajax-Postback call(s) take place as designed.

Has anybody had this kind of an issue before? I do not quite understand why the "first" postback is not handled by the Ajax library ... does anybody have an explanation for this?

I have modified the tutorial code in order to reproduce the error. I have placed the TabStrip and the MultiView within a WebControl. I have removed the comments from the tutorial code. Here ist the code that reproduces the error:

DynamicMultiPage.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DynamicMultiPage.aspx.cs" Inherits="DynamicMultiPage" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register TagPrefix="UC" TagName="DynamicMultiPage" Src="DynamicMultiPage.ascx" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
        <telerik:RadScriptManager runat="server"></telerik:RadScriptManager> 
        <telerik:RadAjaxManager runat="server"></telerik:RadAjaxManager> 
        <asp:LoginView runat="server" ID="LoginView1"
        <AnonymousTemplate> 
            <UC:DynamicMultiPage runat="server" ID="DynamicMultiPage1" /> 
        </AnonymousTemplate> 
        </asp:LoginView> 
    </form> 
</body> 
</html> 

DynamicMultiPage.aspx.cs
using System; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
 
partial class DynamicMultiPage : System.Web.UI.Page 

DynamicMultiPage.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DynamicMultiPage.ascx.cs" Inherits="DynamicMultiPage" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<script type="text/javascript"
    function onTabSelecting(sender, args) { 
        if (args.get_tab().get_pageViewID()) { 
            args.get_tab().set_postBack(false); 
        } 
    } 
</script> 
 
<telerik:RadAjaxManagerProxy runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadTabStrip1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> 
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
<div> 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="2" MultiPageID="RadMultiPage1" OnClientTabSelecting="onTabSelecting" OnTabClick="RadTabStrip1_TabClick"
        <Tabs> 
            <telerik:RadTab runat="server" Text="Business" PageViewID="RadPageView1"
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Employees" PageViewID="RadPageView2"
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Customers" PageViewID="RadPageView3" Selected="True"
            </telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    &nbsp; 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated"
    </telerik:RadMultiPage> 
</div> 
 

DynamicMultiPage.ascx.cs
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; 
 
public partial class DynamicMultiPage : System.Web.UI.UserControl 
    bool newPageView = false
 
    protected void Page_Load(object sender, System.EventArgs e) 
    { 
        if (!(Page.IsPostBack)) 
            ViewState["sequence"] = "0"
    } 
 
    protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e) 
    { 
        e.Tab.PageViewID = AddPageView(e.Tab.Text); 
        e.Tab.PageView.Selected = true
    } 
 
    private string AddPageView(string pageViewID) 
    { 
        RadPageView pageView = new RadPageView(); 
        pageView.ID = pageViewID; 
        newPageView = true
        RadMultiPage1.PageViews.Add(pageView); 
        return pageViewID; 
    } 
 
    protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e) 
    { 
        Label contentLabel = new Label(); 
        contentLabel.ID = e.PageView.ID + "content"
        int sequence = 0; 
        if ((newPageView)) 
        { 
            sequence = Convert.ToInt32(ViewState["sequence"]) + 1; 
            ViewState["sequence"] = Convert.ToString(sequence); 
        } 
        else 
        { 
            sequence = e.PageView.MultiPage.PageViews.Count; 
        } 
        contentLabel.Text = RadTabStrip1.Tabs[RadTabStrip1.SelectedIndex].Text + " added as page # " + Convert.ToString(sequence); 
        e.PageView.Controls.Add(contentLabel); 
    } 
 




Jason
Top achievements
Rank 1
 answered on 17 Jun 2014
3 answers
78 views
Hi, 
  1- How to avoid adding new record when press enter after editing a cell ? 

  2- How to hide Add new record button ?

Thanks
Mansi 
Mansi A.
Top achievements
Rank 1
 answered on 17 Jun 2014
3 answers
142 views
Hi,
i have a radtreeview with contextmenu. In javascript i execute following

function onClientContextMenuItemClicking(sender, args) {
 
    selectedoption = args.get_menuItem().get_value();
    selectednode = args.get_node();
 
    menuItem = args.get_menuItem();
    treeNode = args.get_node();
    menuItem.get_menu().hide();
 
 
    switch (menuItem.get_value()) {
 
        case "FsFolder-Create":
            //treeNode.startEdit();
            //args.set_cancel(true);
            //radprompt('Enter Node Name', promptCallBackFn);
 
 
            var treeFs = $find('ctl00_MainContent_RadTreeViewFileShare');
            treeFs.trackChanges();
            var newNode = new Telerik.Web.UI.RadTreeNode();
            newNode.set_value(2);
            newNode.set_text('New Folder (' + (treeNode.get_nodes().get_count() + 1) + ')');
            newNode.set_imageUrl('../Content/Images/TreeView/FolderAllow.png');
            treeNode.get_nodes().add(newNode);
            treeNode.set_expanded(true);
            newNode.startEdit();
           // treeFs.commitChanges();
           args.set_cancel(true);
            break;
 
        case "FsFolder-Rename":
            treeNode.startEdit();
            args.set_cancel(true);
            break;
             
 
        case "FsFolder-Delete":
            if (!clickCalledAfterRadconfirm) {
                args.set_cancel(true);
                menuItemDel = args.get_menuItem();
                radconfirm('Are you sure you want to delete the folder: <b>' + treeNode.get_text() + '</b>', confirmCallBackFn, 300, 120, null, 'Folder Delete');
            }
            break;
 
    }
}


hit ENTER this starts the server side event ...NodeEdit.

I need to execute server side ...ContextMenuItemClick after javascript treeNode.startEdit.
Is this possible?
Boyan Dimitrov
Telerik team
 answered on 17 Jun 2014
3 answers
109 views
Is it possible to have drag'n'drop rows as well as having grid grouping enabled?  I can't seem to get d'n'd to work when I turn on grouping.  If it is possible, is there a guide I could follow to see where I'm going wrong?
Konstantin Dikov
Telerik team
 answered on 17 Jun 2014
1 answer
136 views
Only loading....

​ <telerik:RadMediaPlayer ID="RadMediaPlayer1" HDActive="True" Width="640" Height="356" runat="server">
</telerik:RadMediaPlayer>

In code behind
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    RadMediaPlayer1.Source = "~/presentvideo/dansskola.mp4"
    RadMediaPlayer1.HDSource = "~/presentvideo/dansskola_hd.mp4"
    RadMediaPlayer1.Poster = "~/posters/dansskola.jpg"
End Sub

http://www.junis.net/test2/

Kjell
Top achievements
Rank 1
Iron
Iron
 answered on 17 Jun 2014
3 answers
120 views
I am using the drag and drop feature of the RadGrid. I am attempting to determine where in the grid I am dragging and dropping a specific row. Say my grid has 4 rows. I attempt to move the first row to the last row. When I go into e.DraggedItems.DataItem(0).Row.newRecord I see that the newRecord number is the same as oldRecord. I also get an error saying that a non-negative number is required for parameter length if I attempt to do something like

If e.DraggedItems.DataItem(0).Row.newRecord = e.DraggedItems.DataItem(0).Row.oldRecord Then
 
End If


I am only attempting to get the first row that is dragged as I have multi drag turned off.

Am I going about getting the dropped location correctly? Or is there a better way?
Alexander
Top achievements
Rank 1
 answered on 17 Jun 2014
1 answer
113 views
Currently files start uploading as soon and you finish selecting them or when you drop one in the drag and drop area. Is there any way to defer the uploading of the files until a button is pressed?

A second, perhaps dumber question, is there any way to continue uploading files during or after a partial postback? Currently partial postbacks appear to cancel the upload.

Thanks
Hristo Valyavicharski
Telerik team
 answered on 17 Jun 2014
2 answers
158 views
Hello,
I'm having an issue with the number and bullet list setting the bullet to the previous line. Here's my steps:

1. Navigate to the demo. http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx
2. Click on the HTML tab and remove all the HTML.
3. Click back on the Design tab.
4. Type in "Hello There." Press Enter key.
5. Type in "Hello There Again" 
6. Cursor is now on the second line. Click either the number list button or the bullet list button on the toolbar.
7. Bullet or Number goes to the first line, not the second line and both lines are indented.

It should have just set the second line. Is this a known bug?

Thanks,
Scott
Scott Michetti
Top achievements
Rank 1
Iron
 answered on 17 Jun 2014
4 answers
205 views
Hi guys,

In a very simplistic overview, we've got a form which includes a couple of textbox fields and a combobox, which in basic terms are used for the following purposes:

The textbox fields are used for entering HTML script, which is escaped/encoded before any postback - it is then decoded server-side.
The Combobox makes use of EnableLoadOnDemand and MarkFirstMatch to perform a lookup

Everything seems to work perfectly when first open a blank form, populate, and save. The problem comes when editing previously saved data; the textbox fields on the form get populated with HTML as expected (the same escaping/encoding script will be used before any update gets saved) - but when the Combobox causes any postback it seems to hold the original HTML data which was populated at form load - causing a "500" error behind the scenes because "potentially dangerous Request.Form"

We've tried calling every clientEvent (and even wrapping the combobox with a DIV which has a mouse-over etc) to encode the fields appropriately, or even simply clear the form all together... but it seems that no matter what we do the original HTML gets sent back as part of the combobox ajax (assuming part of the original viewstate).

We have tried plugging into every postback handler we could find, the telerik ajaxmanager onRequestStart, and even the form.onsubmit - but as none of the form changes make it into the returned postback content, nothing we do seems to have any effect.

Please let us know if there's anything we can do to fix this.
Cheers








Michael
Top achievements
Rank 1
 answered on 17 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?