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

I have two long-loading asp:panels on a page with lots of ajax controls interactions.

When the page load completes I add two ajax requests to the ajaxmanager queue so the user can interact with the page without being held up.

What I want to do is if the user interacts, make their ajax request 'jump the queue' and get processed before the two long-loading ajax requests are complete. Once the user's request is complete, continue with the queue.

Is this possible? I see ClientEvents-OnRequestStart can eventArgs.set_cancel(true), but this will also cancel the user's request so it won't work.

I have lots of controls on this page within grids, treeview, buttons, links, so it isn't practical to have all of these change to call a javascript function that eventArgs.set_cancel(true) and then raises an onclick() or similar.

Do you have a solution?

Thanks, Dan
Daniel Sim
Top achievements
Rank 1
 answered on 01 Dec 2009
3 answers
104 views

Several folks here where I work have issues with content shifting around in Internet Explorer. I have examples of it happening when mousing over elements (like buttons) and when clicking on buttons. I've come up with an example project to show it happening.

Here's the .aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager AsyncPostBackTimeout="36000" ID="scriptManager1" runat="server" 
        EnableTheming="True">  
    </telerik:RadScriptManager> 
    <telerik:RadFormDecorator ID="changeCheckboxes" runat="server" DecoratedControls="CheckBoxes,RadioButtons, Buttons" /> 
    <div> 
        <asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">  
            <ContentTemplate> 
                <div style="margin: 10px;">  
                    <span>Choose one of these</span> 
                    <asp:Table ID="userTable" runat="server" CellPadding="3" CellSpacing="0" Width="700px" 
                        BackColor="White" GridLines="Vertical" BorderStyle="Solid" BorderColor="#6693CF" 
                        BorderWidth="1">  
                        <asp:TableRow ID="facilityRow" runat="server">  
                            <asp:TableCell Width="150px">blah*</asp:TableCell> 
                            <asp:TableCell Width="450px">  
                                <telerik:RadComboBox ID="facilityRadComboBox" runat="server" Width="250px" Height="150px">  
                                    <Items> 
                                        <telerik:RadComboBoxItem Text="Select One" Value="" /> 
                                        <telerik:RadComboBoxItem Text="red" Value="1" /> 
                                        <telerik:RadComboBoxItem Text="thursday" Value="2" /> 
                                        <telerik:RadComboBoxItem Text="grizzly" Value="3" /> 
                                        <telerik:RadComboBoxItem Text="sad" Value="4" /> 
                                    </Items> 
                                </telerik:RadComboBox> 
                                <asp:RequiredFieldValidator ID="facilityRequiredFieldValidator" runat="server" ControlToValidate="facilityRadComboBox" 
                                    Display="Dynamic" ErrorMessage="<br />This field is required" InitialValue="Select One" /> 
                            </asp:TableCell></asp:TableRow> 
                    </asp:Table> 
                </div> 
                <div style="margin: 10px;">  
                    <span>Now choose one of these</span> 
                    <asp:Table ID="Table1" runat="server" CellPadding="3" CellSpacing="0" Width="700px" 
                        BackColor="White" GridLines="Vertical" BorderStyle="Solid" BorderColor="#6693CF" 
                        BorderWidth="1">  
                        <asp:TableRow ID="TableRow1" runat="server">  
                            <asp:TableCell Width="150px">duh*</asp:TableCell> 
                            <asp:TableCell Width="450px">  
                                <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="250px" AutoPostBack="true" 
                                  
                        Height="150px" onselectedindexchanged="RadComboBox1_SelectedIndexChanged">  
                                    <Items> 
                                        <telerik:RadComboBoxItem Text="Select One" Value="" /> 
                                        <telerik:RadComboBoxItem Text="november" Value="1" /> 
                                        <telerik:RadComboBoxItem Text="farkle" Value="2" /> 
                                        <telerik:RadComboBoxItem Text="verdant" Value="3" /> 
                                        <telerik:RadComboBoxItem Text="carp" Value="4" /> 
                                    </Items> 
                                </telerik:RadComboBox> 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadComboBox1" 
                                    Display="Dynamic" ErrorMessage="<br />This field is required" InitialValue="Select One"/>  
                            </asp:TableCell></asp:TableRow> 
                    </asp:Table> 
                </div>     
                <div style="margin: 10px;">  
                    <span>You Picked</span> 
                    <asp:TextBox ID="first" runat="server" /> 
                    <asp:TextBox ID="second" runat="server" /> 
                    <asp:Button ID="Button1" runat="server" onclick="Button1_Click"   
                        Text="Click Me" /> 
                </div>               
            </ContentTemplate> 
        </asp:UpdatePanel> 
    </div> 
    </form> 
</body> 
</html> 
 

And here's the codebehind

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
 
public partial class _Default : System.Web.UI.Page   
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
    protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
 
    }  
    protected void Button1_Click(object sender, EventArgs e)  
    {  
        first.Text = facilityRadComboBox.SelectedItem.Text;  
        second.Text = RadComboBox1.SelectedItem.Text;  
    }  
}  
 



choose options in the two drop down lists and then click the button.  You'll see the entire page contents shift downward in IE but not in Firefox.

The actual example in my real code shifts when I mouse over the button..

thanks...

--Matt

Dimo
Telerik team
 answered on 01 Dec 2009
1 answer
153 views
Is there a way to get the same functionality using code behind instead of clientside javascript.
For example the following code used in online demo .../liveDemos/Windows/Examples/RestrictionZone/Defaultcs.aspx
goes as follows:

function OnClientNodeClickingTreeview(sender, eventArgs)
{
var oManager = GetRadWindowManager();
//get the clicked node
var Url = eventArgs.get_node(sender, eventArgs).get_value();
//get the active RadWindow
var oWnd = GetRadWindowManager().getActiveWindow();
//now we need to open a new RadWindow and ensure that
//such RadWindow has not been already opened.
var windows = oManager.get_windows();
for (var i=0;i<windows.length;i++)
{
var wnd = windows[i];
//check if an already created window has that Url
if (wnd.get_navigateUrl() == Url)
{
//if so - activate that window
wnd.setActive(true);
return;
}
}
//else open a new window
radopen(Url,null);
}
I have been trying not to use javascript but instead to implement the above in codebehind. Where can I get info to assist me in the above endeavour?
Georgi Tunev
Telerik team
 answered on 01 Dec 2009
1 answer
92 views
I have downloaded the trial version of the RadControls for ASP.NET Ajax, and can't get the skins to work correctly.

In the web.config

<add key="Telerik.EnableEmbeddedSkins" value="false">
<add key="Telerik.Skin" value="HRP">

I have also created a "Skins" directory at the root of my app, and copied in the Default skin files from the Telerik directory.

I have created a sample test page that has:

RadScriptManager
RadFormDeocrator

Two RadTextboxes
Two RadComboboxes
Two DatePickers

I have set enableembeddedstyles to false, but yet In Firebug, I can clearly see that Webresources are still being downloaded.

Can you point me to a sure fire way to use a custom skin?  The embedded ones seem to keep getting in my way.

Thanks.
Bill.

Dimo
Telerik team
 answered on 01 Dec 2009
3 answers
220 views
Hi all,

I'm kind'a new to the Telerik components (work with them everyday but in basic stuff), because we (company) used it for more than 2 years now, I decided to use them (extensively) in a new project I have in hands, and even reading the entire Paging content inside the Grid section for more than 3 times now, I can't find what I'm doing wrong.

I have a Grid control that looks like this:

<telerik:RadGrid ID="gvResult" CssClass="tblQuery queryWindow maxSize ui-widget-content" 
        runat="server" GridLines="None" CellPadding="15" AutoGenerateColumns="False" 
        PageSize="25" AllowPaging="True" OnRowDataBound="gvResult_RowDataBound" onpageindexchanging="gvResult_PageIndexChanging" 
        Skin="Web20" onneeddatasource="gvResult_NeedDataSource"> 
        <MasterTableView> 
            <NoRecordsTemplate> 
                Hummmm, there is nothing to show, the search result in absolutly nothing! Maybe you want to <a href="javascript:history.back(-1);">go back</a> and search again with other parameters? 
            </NoRecordsTemplate> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
        <HeaderStyle HorizontalAlign="Left" /> 
        <ItemStyle HorizontalAlign="Left" /> 
        <AlternatingItemStyle HorizontalAlign="Left" /> 
    </telerik:RadGrid> 

simple right ? ...

and on code behind on PageLoad I populate the Data
protected void Page_Load(object sender, EventArgs e) 
{ 
    if (!IsPostBack) 
        PopulateData(); 
}

where inside the PopulateData method I call a method that creates a DataTable and attach it to the Grid DataSource.

The DataTable is created with static columns and dynamic, so I never know the column size, only on runtime.

My CreateSource method dos this in summary:

1 - Creates a new DataTable object
2 - Creates 5 DataColumns (statict columns) and adds them into the DataTable object
3 - Loops through all dynamic columns and adds the same way

4 - For each Business Object in my Collection I add the Data into a DataRow and attach it to the DataTable.Rows Collection

5 - Foreach DataColumn in DataTable.Columns I Bound the DataFields, GridCheckBoxColumn, GridHyperlinkColumn and GridBoundColumn respectivly by my Business Object type

6 - Keep this DataTable object into a Session Variable
7 - RadGrid.DataSource = myDataTable

that works fine, and it is show lovely on the rendered page... but! (there's always a but) :-( 
I can't work with the pagging, when I press any other page I do not get my data, but the Column Type .ToString() :-/

Reading the help I created a method (NeedDataSource) and added this code into it:
protected void gvResult_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
{ 
    if (HttpContext.Current.Session["EDSWebSearch-SearchReturn-DataTable"] != null) 
    { 
        gvResult.DataSource = (DataTable)HttpContext.Current.Session["EDSWebSearch-SearchReturn-DataTable"]; 
    } 
    else 
    { 
        edsDebug.Write("Session Expired, redirecting to Start page"); 
        Response.Redirect("default.aspx" + Request.Url.Query); 
    } 
} 

The DataTable contains all items I need, what should I do here?


screenshots attached, screencast here: (35 sec: 1,35Mb) http://bit.ly/6xxxMV

Thank you,
// Bruno Alexandre, using Soren's account.





Yavor
Telerik team
 answered on 01 Dec 2009
1 answer
124 views
In design time, binding to and object datasource returns a "ID could not be set to property DataFieldID". However, if I run the application it works fine.

I'm testing http://www.telerik.com/help/aspnet-ajax/menu_dataobjectdatasources.html

Any idea?
I'm using Q2.2009
Jorge
Top achievements
Rank 1
 answered on 01 Dec 2009
3 answers
74 views
Hi,

I am facing an interesting problem with Grid having Child Table and with Slider paging.
When I expand and collapse child row, after collapse the pager of child table still gets displayed.
I have attached screen shots for the reference.

Thanks,
Avi
Pavlina
Telerik team
 answered on 01 Dec 2009
1 answer
341 views
Dear Telerik
                       I placed a radcombobox inside a radgrid.I have autopostback set to true. I am using a GridTemplateColumn inside that I have filtertemplate inside that I placed a radcombobox .I also have itemtemplate inside that I have a checkbox.The combobox is populated with three values attended,unattended and all.when I select unattended/all in radcombobox it is showing the selectedvalue as attended only after postback.If attended is selected in radcombobox then the check boxes appears as checked.If unattended is selected from radcombobox then the checkboxes appears as unchecked.Please let me know what is wrong here.urgent please...

Here is the lines of code of importance

<telerik:GridTemplateColumn ShowFilterIcon="false" HeaderText="Attendance"  CurrentFilterFunction="EqualTo">
    <FilterTemplate>
    <telerik:RadComboBox ID="cmbAttend" runat="server"  DataTextField="ATTENDANCE_TYPE_DESC" DataValueField="ATTENDANCE_TYPE_ID"
    EnableViewState="true"  AutoPostBack="true">
    </telerik:RadComboBox>
    </FilterTemplate>
    <ItemTemplate>
    <asp:CheckBox ID="chkAttend" runat="server" />
    </ItemTemplate>
    </telerik:GridTemplateColumn>


aspx code


<telerik:RadGrid ID="gvEventHistory" skin ="Default" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"  PageSize="100"
     AllowFilteringByColumn="true" OnItemDataBound="gvEventHistory_ItemDataBound" OnItemCreated="gvEventHistory_ItemCreated"      OnNeedDataSource="gvEventHistory_NeedDataSource">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView DataKeyNames="SCHEDULE_EVENT_ID" ClientDataKeyNames="SCHEDULE_EVENT_ID" AllowFilteringByColumn="True">
    <RowIndicatorColumn>
    <HeaderStyle Width="2px" />
    <ItemStyle Width ="10px" />
    </RowIndicatorColumn>
   <Columns>
<telerik:GridTemplateColumn ShowFilterIcon="false" HeaderText="Attendance"  CurrentFilterFunction="EqualTo">
    <FilterTemplate>
    <telerik:RadComboBox ID="cmbAttend" runat="server"  DataTextField="ATTENDANCE_TYPE_DESC" DataValueField="ATTENDANCE_TYPE_ID"
    EnableViewState="true"  AutoPostBack="true">
    </telerik:RadComboBox>
    </FilterTemplate>
    <ItemTemplate>
    <asp:CheckBox ID="chkAttend" runat="server" />
    </ItemTemplate>
    </telerik:GridTemplateColumn>
   </Columns>
    </MasterTableView>
    <ClientSettings Selecting-AllowRowSelect="true">
    </ClientSettings>
    </telerik:RadGrid>

C# code

protected void Page_Load(object sender, EventArgs e)
    {

        aEmpNo = Convert.ToInt32(Request.QueryString["empno"]);
        if (!Page.IsPostBack)
        {
            //Load all events default view
            m_EmpEventHistoryList = EmployeeEventHistoryManager.Instance.GetEventHistory(aEmpNo );
            gvEventHistory.DataSource = m_EmpEventHistoryList;
            gvEventHistory.DataBind();

        }
    }



protected void gvEventHistory_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        m_EmpEventHistoryList = EmployeeEventHistoryManager.Instance.GetEventHistory(this.EmployeeNoParameter);
        gvEventHistory.DataSource = m_EmpEventHistoryList;
    }
   

    protected void gvEventHistory_ItemDataBound(object sender, GridItemEventArgs e)
    {
        RadComboBox cmbEventType = null;
        RadComboBox cmbAttend = null;
        string aAttendValue = string.Empty;
        int aIndex = 0;
        string SelectedValue = "1";

        //Get the eventtypedesc from event_type table
        //GetScheduleEvent will bring all the events and bind it to combobox
        IList<ScheduleEvent> m_ScheduleList = ScheduleEventManager.Instance.GetScheduleEvent();

        //Get this list and bind them to cmbattend combobox which contains attended,unattended
        //all rows
        IList<EmployeeEventHistory> m_EmployeeEventAttendedList = EmployeeEventHistoryManager.Instance.GetEventAttendedDetails();

        if (e.Item is GridFilteringItem)
        {
              cmbAttend = (RadComboBox)e.Item.FindControl("cmbAttend");

             cmbAttend.DataSource = m_EmployeeEventAttendedList;
            cmbAttend.DataBind();
             

        }

}

protected void gvEventHistory_ItemCreated(object sender, GridItemEventArgs e)
    {
        RadComboBox cmbEventType = null;
        RadComboBox cmbAttend = null;
        if (e.Item is GridFilteringItem)
        {
             //Get the cmbAttend RadComboBox
            cmbAttend = (RadComboBox)e.Item.FindControl("cmbAttend");
            cmbAttend.ID = "cmbAttend";
            cmbAttend.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(cmbAttend_SelectedIndexChanged);
        }
    }



void cmbAttend_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        IList<WW.FS.SPSS.Business.Employee.EmployeeEventHistory> m_EmpEventHistoryList = null;
        string All = "All";

        int Attended = 1;
        int UnAttended = 2;

        RadComboBox cmbAttend = (RadComboBox)o;
        int aAttendTypeId = 0;
        int aCounter = 0;

        //If All is selected then this code block must be executed
        if (cmbAttend.Text.ToString().ToUpper().Trim() == All.ToUpper().Trim())
        {
            aAttendTypeId = Convert.ToInt32(cmbAttend.SelectedValue.ToString());
            m_EmpEventHistoryList = EmployeeEventHistoryManager.Instance.GetEmpEventAttendance(aAttendTypeId);
            foreach (GridDataItem aGridItem in gvEventHistory.Items)
            {
                if (aGridItem.ItemType == GridItemType.Item)
                {
                    CheckBox chkAttended = (CheckBox)aGridItem.FindControl("chkAttend");
                    if (chkAttended != null)
                    {
                            if (Convert.ToString(m_EmpEventHistoryList[aCounter].ATTENDANCE_TYPE_ID).ToUpper().Trim() == Convert.ToString(Attended).ToUpper().Trim())
                            {
                                chkAttended.Checked = true;

                            }
                            else
                                if (Convert.ToString(m_EmpEventHistoryList[aCounter].ATTENDANCE_TYPE_ID).ToUpper().Trim() == Convert.ToString(UnAttended).ToUpper().Trim())
                                {
                                    chkAttended.Checked = false;

                                }
                       
                         }
                }

            }

            gvEventHistory.DataSource = m_EmpEventHistoryList;
            gvEventHistory.DataBind();





Thanks and Regards
Sri
Yavor
Telerik team
 answered on 01 Dec 2009
1 answer
147 views
Hi,

I found a blog with explanation and example of using RadcomboBox in MVC with LoadOnDemand.
I used the same version of Telerik.Web.UI and the same code but combo box on my page is totally disabled. RadComboBox in my case is placed in a partial view. I read somewhere that there is a problem with css styles if RadControls are placed in partial views but I couldn't find the solution to this.
However, when I placed it in a regular view page (non partial view) I got exception stating that control could not be modified inside server tags <%..%>. For that I found numerous solutions but none worked for me.
Do you have any suggestion of how to make ComboBox operational in partial view?
Do I maybe have to refer to all the JavaScript files needed for RadComboBox directly on the view page?

Thanks in advance.

Here's the sample of the partial view, if it means anything:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<EmailMarketing.Web.Models.MailingDetailsModel>" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Import Namespace="EmailMarketing.Web" %> 
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
<telerik:RadStyleSheetManager runat="server"> 
</telerik:RadStyleSheetManager> 
<div class="divMailingList"></div> 
<div id="MailingDetailsDiv"> 
  <div id="MailingData"> 
    <%= Html.Hidden("Id", Model.Id)%> 
    <div class="MailingDetailsForm"> 
      <div class="MailingDetailsLabel"> 
        <label for="MailingTypeId"> 
          <%= EMResources.MailingDetailsLabelPreferedAddress %></label> 
      </div> 
      <div class="MailingDetailsValue"> 
        <telerik:RadComboBox runat="server" ID="AddressTypeId" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EmptyMessage="Type here ..." Height="200px" Enabled="true"> 
          <WebServiceSettings Path="Mailing" Method="LoadItems" /> 
        </telerik:RadComboBox> 
      </div> 
    </div>    
  </div> 
</div>  

Georgi Krustev
Telerik team
 answered on 01 Dec 2009
5 answers
117 views

Hi,

1. I am using the scheduler to creating arecurring appointments, as pre the documentations RecurenceParentId should have been created for theentry. But, I find the value as null 

2. How, where do I find the value and How cani Check for conflicting appointments?.

3. Can you send me any sample code?

Thanks

Sabarish



Peter
Telerik team
 answered on 01 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?