Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
87 views
Hi,

I'm initializing the grid with a blank row using GridTemplateColumn and an empty datatable.
My scenario is that the user can fill this empty row and another empty row will be automatically added upon the user fill the 1st row.

However, when another empty row is added, the previous data in the 1st row became empty.
I want to add another row and keep the data in the previous row.

Nothing is saved in database until the user hits on "Process" button.

Please do let me know how I can achieve this scenario.

Thanks,
Bilal
Marin
Telerik team
 answered on 27 Jan 2012
11 answers
266 views
Recently I have been researching ways to speed up our web application loading time.  One of the things that I noticed was that we use the RadScriptManager in several different pages throughout the site.  What is the real performance gain when using the RadScriptManager with combining scripts enabled.  I realize that this reduces the number of http requests needed by the browser, but does that really translate into real world performance?  One of the major flaws I have discovered is that if each page does not contain the exact same controls, that particular page will have to load its own version of javascript in the form "/Telerik.Web.UI.WebResource.axd?"  Consider the following senario assuming all pages have the RadScriptManager attached with script combining enabled.  I load the initial page of the website which has some telerik controls.  The page loads its telerik web resource and caches the page.  I then open a child page, this page has an extra telerik control on it and therefore the page must also download its own telerik webresource.  This webresouce for the child page contains all the microsoft ajax javascript along with all the telerik javascript that was downloaded in the previous page plus a little extra for the new control.  In my eyes this is actually hurting my performance.  I have already downloaded the microsoft ajax libraries and most of the telerik code needed for the child page so why do I need to download the entire 300 to 500 KB of javascript information over again (in my experience)?  Assuming that this can go on for several pages without getting an actuall solid cache, what kind of performance gain does this control actually offer?
Andrew
Top achievements
Rank 1
 answered on 27 Jan 2012
1 answer
108 views
I've just upgraded to the latest version of telerik to take advantage of the new drag and drop functionality, however I'm having trouble using this feature on my Motorola Droid X. The examples I've found online haven't been too helpful.  I have the following client settings on both the grid and the scheduler.
        <ClientSettings AllowRowsDragDrop="True">
            <Selecting AllowRowSelect="True" />
            <ClientEvents OnRowDropping="rowDropping" />
        </ClientSettings>
 
 
 
function rowDropping(sender, eventArgs) {
    // Fired when the user drops a grid row
    var htmlElement = eventArgs.get_destinationHtmlElement();
 
    var scheduler = $find('<%= RadScheduler1.ClientID %>');
    scheduler.get_element().style.width = k.SchedulerPreferences.SchedulerWidth + "px";
    scheduler.repaint();
    if (isPartOfSchedulerAppointmentArea(htmlElement)) {
        // The row was dropped over the scheduler appointment area
        // Find the exact time slot and save its unique index in the hidden field
        var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
        $get("TargetSlotHiddenField").value = timeSlot.get_index();
        // The HTML needs to be set in order for the postback to execute normally
        eventArgs.set_destinationHtmlElement("TargetSlotHiddenField");
    }
    else {
        // The node was dropped elsewhere on the document
        eventArgs.set_cancel(true);
    }
    refreshPage()
}


What am I Missing? Any help would be much appreciated!
Peter
Telerik team
 answered on 27 Jan 2012
2 answers
82 views
hi

This is probably really simple but I can't work it out, how do you set a different colour for the root items and the child items? I basically want white text for the root and black text in the child items.

Thanks
Martin.
martin
Top achievements
Rank 2
 answered on 27 Jan 2012
3 answers
94 views

I have a requirements to implement a functionality which contains a panelbar, radtapstrip and the radmultipage. The panelbar items are added dynamically. when I clicked an item in the panelbar, a tabitem will be added (which contains a closetemplate to close a tab) along with the corresponding radmultipage item which loads a specific usercontrol. If the RadTabstrip text is existing it will activate the tab, when I click the close tab (image) the current tab should be deleted along with corresponsing multipage item and previous tab should be selected. The problem is when I try to close a particular tab, it focus on the previous tab but the content of the radmultipage item is still the current one that I've deleted.I want to activate the previous tab along with corresponding radmultipage item.  What is the problems, any help please?

Inline Code

 

<%

 

 

 

 

 

@ Page Language="C#" AutoEventWireup="true" MasterPageFile="Site.Master" CodeBehind="default2.aspx.cs" Inherits="CapWorks.Web.default2" %>

 

<

 

 

 

 

 

 

 

 

asp:Content ID="ajaxscripts" runat="server" ContentPlaceHolderID="ajaxscripts">

 

</

 

 

 

 

 

 

 

 

asp:Content>

 

<

 

 

 

 

 

 

 

 

asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

 

 

 

 

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

 

 

 

 

</telerik:RadCodeBlock>

 

<

 

 

 

 

 

 

 

 

script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>

 

<

 

 

 

 

 

 

 

 

script type="text/javascript">

 

 

 

 

 

 

function ExportDocuments() {

 

 

 

 

 

 

var inputElements = document.getElementsByTagName("input");

 

 

 

 

 

 

var iElements = inputElements.length;

 

inputElements[

 

 

 

 

 

'<%= txtIds.ClientID %>'].value = "";

 

 

 

 

 

 

for (count = 0; count < iElements; count++) {

 

 

 

 

 

 

if (inputElements[count].type == 'checkbox') {

 

 

 

 

 

 

if (inputElements[count].checked) {

 

document.getElementById(

 

 

 

 

 

'<%= txtIds.ClientID %>').value += inputElements[count].id + ':';

 

}

}

}

 

 

 

 

 

var url = "./dialogues/common/selectoutput.aspx";

 

window.radopen(url,

 

 

 

 

 

"exportdocuments");

 

}

 

 

 

 

 

function removeTab(tabText) {

 

 

 

 

 

 

var tabStrip = $find("<%= topTabs.ClientID %>");

 

 

 

 

 

 

var multiPage = $find("<%= RadMultiPage1.ClientID %>");

 

 

 

 

 

 

var tab = tabStrip.findTabByText(tabText);

 

 

 

 

 

 

var pageView = tab.get_pageView();

 

 

 

 

 

 

var tabToSelect = tab.get_nextTab();

 

 

 

 

 

 

if (!tabToSelect)

 

tabToSelect = tab.get_previousTab();

tabStrip.get_tabs().remove(tab);

multiPage.get_pageViews().remove(pageView);

 

 

 

 

 

if (tabToSelect)

 

tabToSelect.set_selected(

 

 

 

 

 

true);

 

}

 

 

 

 

 

function OnClientItemClicking(sender, args) {

 

 

 

 

 

 

var multiPage = $find("<%=RadMultiPage1.ClientID%>");

 

 

 

 

 

 

var item = args.get_item();

 

 

 

 

 

 

var itemt = item.get_value();

 

 

 

 

 

 

if (multiPage.get_pageViews().get_count() > 0) {

 

 

 

 

 

 

if (multiPage.findPageViewByID(itemt)) {

 

 

 

 

 

 

var pageView = multiPage.findPageViewByID(itemt);

 

pageView.set_selected(

 

 

 

 

 

true);

 

pageView.show();

item.set_postBack(

 

 

 

 

 

false);

 

}

}

}

 

 

 

</

 

 

 

 

 

 

 

 

script>

 

</

 

 

 

 

 

 

 

 

asp:Content>

 

<

 

 

 

 

 

 

 

 

asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">

 

<

 

 

 

 

 

 

 

 

telerik:RadAjaxManager ID="DefaultAjaxManager" runat="server">

 

<

 

 

 

 

 

 

 

 

AjaxSettings>

 

 

 

 

 

 

<telerik:AjaxSetting AjaxControlID="leftPanel">

 

 

 

 

 

 

<UpdatedControls>

 

 

 

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />

 

 

 

 

 

 

<telerik:AjaxUpdatedControl ControlID="topTabs" />

 

 

 

 

 

 

</UpdatedControls>

 

 

 

 

 

 

</telerik:AjaxSetting>

 

 

 

 

 

 

</AjaxSettings>

 

</

 

 

 

 

 

 

 

 

telerik:RadAjaxManager>

 

 

 

 

 

 

<table style="padding-top:3px;padding-right:7px;">

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

<td valign="top">

 

 

 

 

 

 

<telerik:RadPanelBar CssClass="panelbar" ID="leftPanel" runat="server" OnClientItemClicking="OnClientItemClicking"

 

 

 

 

 

 

AllowCollapseAllItems="True" OnItemClick="RadPanelBarItemClick"

 

 

 

 

 

 

Width="160px" ExpandMode="SingleExpandedItem">

 

 

 

 

 

 

<ExpandAnimation Type="InElastic" Duration="1"></ExpandAnimation>

 

 

 

 

 

 

<CollapseAnimation Type="InElastic" Duration="1"></CollapseAnimation>

 

 

 

 

 

 

</telerik:RadPanelBar>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

<td valign="top">

 

 

 

 

 

 

<div style="float:left">

 

 

 

 

 

 

<input type="hidden" runat="server" ID="txtIds" />

 

 

 

 

 

 

<asp:HiddenField ID="markfornotify" Value="" runat="server" />

 

<

 

 

 

 

 

 

 

 

asp:HiddenField ID="selectedValues" Value="" runat="server" />

 

<

 

 

 

 

 

 

 

 

div id="tabsandpages">

 

<

 

 

 

 

 

 

 

 

telerik:RadTabStrip ID="topTabs" runat="server"

 

 

 

 

 

 

MultiPageID="RadMultiPage1" OnTemplateNeeded="TopTabsTemplateNeeded"

 

 

 

 

 

 

style="float:left">

 

</

 

 

 

 

 

 

 

 

telerik:RadTabStrip>

 

<

 

 

 

 

 

 

 

 

input id="hdnSelectedTab" type="hidden" value="none" runat="server" />

 

<

 

 

 

 

 

 

 

 

telerik:RadMultiPage ID="RadMultiPage1" Runat="server" style="padding-top:26px;" OnPreRender="RadPageMultiPageViewRender">

 

</

 

 

 

 

 

 

 

 

telerik:RadMultiPage>

 

</

 

 

 

 

 

 

 

 

div>

 

 

 

 

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server"

 

 

 

 

 

 

VisibleStatusbar="false" Behaviors="Close" Modal="true" Width="450px"

 

 

 

 

 

 

Height="430px" style="z-index:9999" >

 

 

 

 

 

 

<Localization Close ="<%$ Resources:CapWorksResource,close %>" Cancel="<%$ Resources:CapWorksResource,Cancel %>"

 

 

 

 

 

 

OK="<%$ Resources:CapWorksResource, ok %>" No="<%$ Resources:CapWorksResource, no %>" Yes="<%$ Resources:CapWorksResource, yes %>" />

 

 

 

 

 

 

<Windows>

 

 

 

 

 

 

<telerik:RadWindow ID="UserListDialog" runat="server" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" >

 

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

 

<telerik:RadWindow ID="UserListDialog1" runat="server" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Width="700px" >

 

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

 

<telerik:RadWindow ID="editdocumentheadwindow" InitialBehaviors="Maximize" runat="server" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Behaviors="Maximize,Close,Resize" >

 

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

 

<telerik:RadWindow runat="server" ID="exportdocuments" >

 

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

 

<telerik:RadWindow ID="findall" runat="server" ReloadOnShow="true"

 

 

 

 

 

 

ShowContentDuringLoad="false" Modal="true" AutoSize="true" Behaviors="Move,Resize,Close">

 

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

 

</Windows>

 

 

 

 

 

 

</telerik:RadWindowManager>

 

 

 

 

 

 

</div>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

</table>

 

</

 

 

 

 

 

 

 

 

asp:Content>

 

 

 

 

 

 

 

 

 

Code -Behind

using

 

 System;
 
using

 

 System.Globalization;
 
using

 

 System.Web.UI;
 
using

 

 System.Web.UI.WebControls;
 
using

 

 CapWorks.Web.Helpers.RadPanelManager;
 
using

 

 CapWorks.Web.UserControls;
 
using

 

 Telerik.Web.UI;
 
namespace

 

 CapWorks.Web
 
{
 

 

public partial class default2 : PageBase
 
{
 

 

private const string UserControls = "/UserControls/";
 

 

private const string ExtensionId = "_userControl";
 

 

private void AddCloseButton(Control tab)
 
{
 

 

var template = new CloseTabTemplate();
 
template.InstantiateIn(tab);
 
template.Closed += TemplateClosed;
 
}
 

 

private void AddTab(string key,string tabName,string controlname, bool isselected)
 
{
 

 

var tab = new RadTab { Text = tabName, Selected = isselected };
 

 

var pageView = new RadPageView {ID = string.Format("{0}{1}{2}",key,Constants.GLOBAL_FOLDER_DELIMITER, controlname), Selected = isselected};
 
tab.PageViewID = pageView.ID;
 
topTabs.Tabs.Add(tab);
 
RadMultiPage1.PageViews.Add(pageView);
 
}
 

 

private void TemplateClosed(object sender, ImageClickEventArgs e)
 
{
 

 

var img = (ImageButton)sender;
 

 

var tabfind = topTabs.FindTabByText(img.ID.Replace("closeimg",""));
 

 

if (tabfind.Equals(null)) return;
 
topTabs.Tabs.Remove(tabfind);
 

 

var pageViewFind = topTabs.MultiPage.FindPageViewByID(tabfind.PageViewID);
 

 

if (pageViewFind.Equals(null)) return;
 
RadMultiPage1.PageViews.Remove(pageViewFind);
 

 

//if (topTabs.Tabs.Count <= 0) return;
 

 

//topTabs.Tabs[topTabs.Tabs.Count - 1].Selected = true;
 

 

//RadMultiPage1.PageViews[RadMultiPage1.PageViews.Count - 1].Selected = true;
 
}
 

 

protected void Page_Load(object sender, EventArgs e)
 
{
 

 

if(!IsPostBack)
 
{
 
LoadFirstMenu(leftPanel);
 
LoadOtherMenu(leftPanel);
 

 

var welcome = Resources.CapWorksResource.Welcome;
 

 

var culture = CultureInfo.CurrentUICulture;
 
AddTab(

"welcome",Localize("Welcome"),"welcome", false);
 
AddTab(

"butMy",Localize("Inbox"),"alldocs", true);
 

 

return;
 
}
 
}
 
protected void RadPanelBarItemClick(object sender, RadPanelBarEventArgs e)
 
{
 

 

if (e.Item.Value.Length == 0) return;
 

 

var itemlocal = Localize(e.Item.Text);
 

 

var attributekey = e.Item.Attributes[e.Item.Text];
 

 

var tabFound = topTabs.Tabs.FindTabByText(attributekey);
 

 

if (tabFound==null)
 
{
 
AddTab(attributekey, itemlocal, e.Item.Value,

true);
 
}
 

 

else
 
{
 
tabFound.Selected =

true;
 
tabFound.PageView.Selected =

true;
 
}
 
}
 

 

protected void RadPageMultiPageViewRender(object sender, EventArgs e)
 
{
 

 

foreach (RadPageView pageview in RadMultiPage1.PageViews){
 

 

var control = pageview.ID.Split(new string[] { Constants.GLOBAL_FOLDER_DELIMITER }, StringSplitOptions.None);
 

 

var isPageViewFound = RadMultiPage1.FindControl(pageview.ID);
 

 

if (isPageViewFound == null) return;
 

 

var userControlName = string.Format("{0}{1}.ascx", UserControls, control[1]);
 

 

var userControl = (ControlBase)Page.LoadControl(userControlName);
 
userControl.DataItem = control[0];
 
userControl.ID =

String.Format("{0}{1}", control[0], ExtensionId);
 
pageview.Controls.Add(userControl);
 
}
 

 

if (topTabs.Tabs.Count <= 0) return;
 
topTabs.Tabs[topTabs.Tabs.Count - 1].Selected =

true;
 
topTabs.Tabs[topTabs.Tabs.Count - 1].PageView.Selected = true;
 
 

 

 }
 

 

protected void TopTabsTemplateNeeded(object sender, RadTabStripEventArgs e)
 
{
 

 

if (!e.Tab.Text.ToLower().Equals(Localize("welcome").ToLower()))
 
AddCloseButton(e.Tab);
 
}
 
}
 
}

 

Emilia
Telerik team
 answered on 27 Jan 2012
1 answer
87 views
I have an inline template with an "edit details" button that pops a rad window containing a custom advanced insert form.

If the user startes to enter a subject and clicks on edit details, I need a way to populate the subject line in the custom advanced insert form with the user entered subject.  How can I access the text from TitleTextBox2?

--Thanks!

<InlineInsertTemplate>
                        <div id="InlineInsertTemplate" style="height: 20px">
                            <asp:TextBox ID="TitleTextBox2" runat="server" Text='<%# Bind("Subject") %>' Width="90%"
                                TextMode="MultiLine" />
                            <br />
                            <asp:Button ID="InsertButton" runat="server" CssClass="stdButton" CommandName="Insert"
                                Text="Save" />
                            <input type="button" id="InlineInsertEditButton" class="stdButton" onclick="inlineEdit(-1)"
                                value="Edit Details" />
                            <asp:Button ID="InsertCancelButton" runat="server" CssClass="stdButton" CausesValidation="False"
                                CommandName="Cancel" Text="Cancel" />
                            <br />
                        </div>
                    </InlineInsertTemplate>


...
function inlineEdit(inlineEditType) {
            var scheduler = $find('<%=RadScheduler1.ClientID %>');
            var TitleTextBox2ID = $find('<%=TitleTextBox2.ClientID %>');  //Error: 'TitleTextBox2' is not declared. It may be inaccessible due to its protection level.
 
            selectedAppointment = scheduler.get_currentAppointment();            
 
            if (inlineEditType == -1) {  //Create New
                openAdvancedCreateAppointment(selectedAppointment.get_start(), selectedAppointment.get_end(), selectedAppointment._isAllDay(), null);
            }
            else if (inlineEditType == -2) { //Edit
                openAdvancedEditAppointment(selectedAppointment);
            }
            scheduler.hideInlineForm();
            return false;
        }


Peter
Telerik team
 answered on 27 Jan 2012
5 answers
217 views
I use RadProgressArea to show progress of a custom process, and this validation process can last up to 10 or 15 minutes. The flow is supposed to be like this, once a Validate button is clicked, the section showing the Validate button and a list of items for validation is hidden, while RadProgressArea starts showing the progress (this radprogressarea is update via callback of my custom process). In the end after the long process is finished, the RadProgressArea disappears and the Validate button and the list of items are shown. Everything works fine when the process lasts 2 or 3 minutes, once the process lasts about  5 minutes, the RadProgressArea stuck on the last message, even the elapsedtime stops counting but the browser tab has spinning image and progress bar on browser is not complete. It seems like server stops processing the code after the last call to update the RadProgressArea.

I thought this was caused by page time out and the server stopped processing the subsequent call from the page, then I increase the number for the Server.ScriptTimeOut on the page where the Validation method is called, but it does not  make any difference.

Has anyone experienced the similar thing before? Please advise what could be the cause to this behavior.

Thank in advance.

Helen
Genady Sergeev
Telerik team
 answered on 27 Jan 2012
3 answers
169 views
Hello

I am trying to build a bread crumb on client side usign RadSiteMap. I dont see any client side object model for RadSiteMap that i can call to build breadcrumb.
Here is what is want to do.

Have multiple divs on one page. Make first one display = "block" rest display="none". On next button click make second div as display ="block" and add breadcrumb text at the top. So for breadcrumb i am planning to use radsitemap. It is more like wizard style with bread crumb on the top.

The page is very fat with lots of controls so i want to build the entire solution on client side.

Any help is appreciated.
Peter
Telerik team
 answered on 27 Jan 2012
1 answer
74 views
Hello,

I am working with the ExchangeSchedulerProvider. I set the provider for the scheduler programatically as per the instructions. When I run I get the error: 'DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding'

In the working example code I have downloaded from Telerik, I do not see you guys setting these values either at design time or runtime. And yet the example code runs fine. Why am I getting the error? Do I in fact need to set these values when using the ExchangeSchedulerProvider?

Thanks,
Jeremy
Peter
Telerik team
 answered on 27 Jan 2012
3 answers
104 views
I have created my own skin.  how can i make the event to show as much as possible if there is room for it. 
My description only shows 2 lines.  i want more detail in case there arenot any other events on the same day. 

also is there a way to hide the scrolling on the right hand side?
Peter
Telerik team
 answered on 27 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?