Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
90 views

Am pulling my hair out on this...

By scenario is kind of complex, but I have a masterpage with a radajaxmanager, then a page with multiple use controls. In one of the controls, I have a button within a radgrid that I want to generate a download request:

Response.Clear()
Response.ContentType = "Application/msword"
Response.AddHeader("content-disposition", "attachment;filename=test.xml")
Response.Write(teststring)
Response.End()

Obviously, I need to disable AJAX for this postback...
In my grid, I have a GridTemplateColumm that has a btnGenerate
On the grid's ItemDataBound:
Dim sm As ScriptManager = ScriptManager.GetCurrent(Page)
sm.RegisterPostBackControl(CType(e.Item.FindControl("btnGenerate"), LinkButton))

But no matter what I try, when the Grid's ItemCommand is raised by the button, it remains an AJAX request.

Thanks,
Reuven
(I don't want to save the generated file nor run it through a handler to generate since it contains confidential data)

 

Daniel
Telerik team
 answered on 27 Sep 2010
2 answers
412 views
hi my dear friends :
how can i do somthing (refresh the page under the alert) with ok button of radalert?


thanks in future advace
Majid Darab
Top achievements
Rank 1
 answered on 27 Sep 2010
3 answers
48 views
Hi,

SCENARIO: We have set AllowFilteringByColumn = true in RadGrid for filteration and also we have restricted the filteraion options as only "CONTAINS"
PROBLEM: In above scenario when we filtered the Grid rows and then click on 3rd filtered row to update its contents then it will consider the before filteration 3rd row
Example: Initially RadGrid contains 6 rows and after filteration suppose it filter out 1st, 3rd, 5th row and now filtered Grid contains 2nd, 4th, 6th row as the 3 elements and when we click on 3rd filtered row (6th) then it considered 3rd instead of 6th.

Please help

Thanks in Advance
Prashant
9810494465
Iana Tsolova
Telerik team
 answered on 27 Sep 2010
3 answers
97 views
I have three tabs in my grid. I am using filter for my 1st tab and whenever I click the filter I get this error. I tried EnableLinqExpressions="False" , no luck.

Expression expected at Telerik.Web.UI.ExpressionParser.ParsePrimaryStart()
at Telerik.Web.UI.ExpressionParser.ParsePrimary()
at Telerik.Web.UI.ExpressionParser.ParseUnary()
at Telerik.Web.UI.ExpressionParser.ParseMultiplicative()
at Telerik.Web.UI.ExpressionParser.ParseAdditive()
at Telerik.Web.UI.ExpressionParser.ParseComparison()
at Telerik.Web.UI.ExpressionParser.ParseLogicalAnd()
at Telerik.Web.UI.ExpressionParser.ParseLogicalOr()
at Telerik.Web.UI.ExpressionParser.ParseExpression()
at Telerik.Web.UI.ExpressionParser.ParseArguments()
at Telerik.Web.UI.ExpressionParser.ParseArgumentList()
at Telerik.Web.UI.ExpressionParser.ParseIif()
at Telerik.Web.UI.ExpressionParser.ParseIdentifier()
at Telerik.Web.UI.ExpressionParser.ParsePrimaryStart()
at Telerik.Web.UI.ExpressionParser.ParsePrimary()
at Telerik.Web.UI.ExpressionParser.ParseUnary()
at Telerik.Web.UI.ExpressionParser.ParseMultiplicative()
at Telerik.Web.UI.ExpressionParser.ParseAdditive()
at Telerik.Web.UI.ExpressionParser.ParseComparison()
at Telerik.Web.UI.ExpressionParser.ParseLogicalAnd()
at Telerik.Web.UI.ExpressionParser.ParseLogicalOr()
at Telerik.Web.UI.ExpressionParser.ParseExpression()
at Telerik.Web.UI.ExpressionParser.ParseParenExpression()
at Telerik.Web.UI.ExpressionParser.ParsePrimaryStart()
at Telerik.Web.UI.ExpressionParser.ParsePrimary()
at Telerik.Web.UI.ExpressionParser.ParseUnary()
at Telerik.Web.UI.ExpressionParser.ParseMultiplicative()
at Telerik.Web.UI.ExpressionParser.ParseAdditive()
at Telerik.Web.UI.ExpressionParser.ParseComparison()
at Telerik.Web.UI.ExpressionParser.ParseLogicalAnd()
at Telerik.Web.UI.ExpressionParser.ParseLogicalOr()
at Telerik.Web.UI.ExpressionParser.ParseExpression()
at Telerik.Web.UI.ExpressionParser.Parse(Type resultType)
at Telerik.Web.UI.DynamicExpression.ParseLambda(ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
at Telerik.Web.UI.DynamicExpression.ParseLambda(Type itType, Type resultType, String expression, Object[] values)
at Telerik.Web.UI.GridDynamicQueryable.Where(IQueryable source, String predicate, Object[] values)
at Telerik.Web.UI.GridDataTableFromEnumerable.FillData35()
at Telerik.Web.UI.GridDataTableFromEnumerable.FillData()
at Telerik.Web.UI.GridResolveEnumerable.Initialize()
at Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized()
at Telerik.Web.UI.GridResolveEnumerable.get_DataTable()
at Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
at Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
at Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
at Telerik.Web.UI.GridTableView.get_ResolvedDataSource()
at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at Telerik.Web.UI.GridTableView.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at Telerik.Web.UI.GridTableView.DataBind()
at Telerik.Web.UI.GridTableView.Rebind()
at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source)
at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
at Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument)
at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Iana Tsolova
Telerik team
 answered on 27 Sep 2010
2 answers
30 views
Hi,
i am new in telerik controls. I've problem with one datasource bound to two grids.
  • First grid contains only columns from 2 to 5 and ID
  • Second grid contains columns from 6 to 10 + ID
  • All other columns are hidden (e.g: last user, change date)
When I edit data using first Grid, all other data are set to null (row in second grid looks like blank).
Vasil
Telerik team
 answered on 27 Sep 2010
1 answer
86 views
Hi,

In a radgrid, when i click on a row, a new row should be appended(preferably client side) ,

and for a subset of rows how can i show 1st as merged column for these subset of rows similar as in excel file.

how can i achive the above senarios.

Thanks in advance.
Marin
Telerik team
 answered on 27 Sep 2010
7 answers
98 views
I had some code in a server side event where it would build a RadWindow and try to open it up from a record on a RadGrid.

After unsuccessfully trying, I removed the AjaxSettings block for that particular control from my markup within the RadAjaxManager and the window popped up. Unfortuantely, the grid now posts back and is not ajaxified anymore which is very annoying.

What I did was to put the AjaxSettings back and use the following instead of building the RadWindow:
<code>
string s = "window.open('../scan/viewChart.aspx','_blank','width=1000,height=600,scrollbars=no,resizable=yes\');";
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", s, true);
</code>

This works fine, but was wondering if there is anyother way to keep the grid ajaxified and to launch a window without using window.open.

Thanks,

Bill.
Ed
Top achievements
Rank 1
 answered on 27 Sep 2010
1 answer
135 views
I have two RadListBox controls on my page. These controls are inside an UpdatePanel. There are few other controls on the page, just a couple of radio buttons. I am transferring items in the left list to the right list in the standard way, according to the sample. The left (or source) list contains about 300 items. Each item is defined by an item template. The item template defines a table with two columns (table name, field name). The data in that list is coming from a declaratively bound objectdatasource. I have tried various combinations of property setting/clearing on the list control but cannot get very good performance in any case. It takes about 2.5 seconds for the list control to completely reflect that a new item has been selected. Further, it takes about 3 seconds for the tranfer from the left to the right list control to complete. There does not appear to be any postbacks occuring nor is there any data 'rebinding' occuring. Why would this control's performance be so dodgy for only a couple of hundred items? Am I missing some finer point? Note that I have seen a similar post where a user had performance problems as well, but that was for 15,000 items. I can reasonably see a problem occuring in that scenario. Also note that when I programmatically limit the data returned from the objectdatasource (and thus into the source list control) to say 10 or 20 items, the performance is much better. Finally, note the performance of the ASP.NET list control is very good in this scenario, but you cannot replicate multiple columns on that list control without resorting to custom string formatting and the use of fixed width fonts. Thanks.
Genady Sergeev
Telerik team
 answered on 27 Sep 2010
5 answers
106 views
Hi telerik,

I have Rad Rotator which is working fine in the english version of the page,but in arabic version the slidshow is not happening.
Below is the ascx and ascx.cs file code.
Can u please help me out to sort this issue.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsTicker.ascx.cs" Inherits="UserControls_GI_NewsTicker" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<%@ Register TagPrefix="sfWeb" Assembly="Telerik.Libraries" Namespace="Telerik.Libraries.WebControls" %>
<style type="text/css">  
    *+html .rrItemsList
    {
        float: none !important;
    }
    *html .rrItemsList
    {
        float: none !important;
    }
</style>
<asp:UpdatePanel ID="updatePanel" runat="server">
    <ContentTemplate>
        <div class="newsHeading">
            <asp:Literal runat="server" ID="liLatestNews" Text="<%$ Resources: GlobalResource, LatestNews %>"></asp:Literal></div>
        <div  class="newsContents" >
            <telerik:RadRotator ID="radRotator" runat="server" Height="30px" Width="500px" ItemWidth="500px"
                ItemHeight="30px" FrameDuration="3000" RotatorType="SlideShowButtons" SlideShowAnimation-Duration="3000"
                SlideShowAnimation-Type="Fade" OnItemDataBound="radRotator_ItemDataBound">
                <ControlButtons LeftButtonID="img_Left" RightButtonID="img_Right" />
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="hlNavigator">
                        <asp:Literal ID="NewsTitle" runat="server" />
                    </asp:HyperLink>
                </ItemTemplate>
            </telerik:RadRotator>
        </div>
        <div class="controls">
            <asp:ImageButton ID="img_Left" runat="server" ImageUrl="~/App_Themes/English/Images/back.png"
                OnClick="Play_Click" />
            <asp:ImageButton runat="server" ID="Play" ImageUrl="~/App_Themes/English/Images/pause.png"
                OnClick="Play_Click" />
            <asp:ImageButton ID="img_Right" runat="server" ImageUrl="~/App_Themes/English/Images/forward.png"
                OnClick="Play_Click" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>





newsticker.cs file

using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
using System.ComponentModel;
using Telerik.Cms.Web.UI;
using Telerik.Cms.Engine;
using System.Collections.Generic;
using System.Globalization;
using Telerik.Cms.Data;
using System.Threading;
using System;
using System.Collections;
 
public partial class UserControls_GI_NewsTicker : System.Web.UI.UserControl
{
    #region Public Properties
 
 
    [Category("Data")]
    public string ProviderName
    {
        get
        {
            if (String.IsNullOrEmpty(this.providerName))
                this.providerName = ContentManager.DefaultProviderName;
            return this.providerName;
        }
        set
        {
            this.providerName = value;
        }
    }
 
 
    [Category("Filters")]
    public string CategoryName
    {
        get
        {
            return this.categoryName;
        }
        set
        {
            this.categoryName = value;
        }
    }
    [Category("Filters")]
    public string SortExpression
    {
        get
        {
            return this.sortExpression;
        }
        set
        {
            this.sortExpression = value;
        }
    }
    [Category("Main")]
    [WebEditor("Telerik.Cms.Web.UI.CmsUrlWebEditor, Telerik.Cms")]
    public string MoreInfoUrl
    {
        get { return moreInfoUrl; }
        set { moreInfoUrl = value; }
    }
 
    #endregion
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
 
            IList dataSource = null;
            if (this.manager == null)
                this.manager = new ContentManager(this.ProviderName);
            if (!string.IsNullOrEmpty(this.CategoryName))
            {
                List<IMetaSearchInfo> filter = new List<IMetaSearchInfo>();
                // add a new filter to the list
                filter.Add(new MetaSearchInfo(MetaValueTypes.ShortText, "Category", this.CategoryName));
                dataSource = manager.GetContent(this.SortExpression, filter.ToArray());
            }
            else
            {
                dataSource = manager.GetContent();
            }
 
            this.radRotator.DataSource = dataSource;
            this.radRotator.DataBind();
 
            radRotator.RotatorType = RotatorType.SlideShow;
        }
    }
 
    private string moreInfoUrl;
    private ContentManager manager;
    private string providerName = "News";
    private string categoryName;
    private string sortExpression = "Position Asc";
 
    protected void radRotator_ItemDataBound(object sender, Telerik.Web.UI.RadRotatorEventArgs e)
    {
        IContent content = (IContent)e.Item.DataItem;
 
        if (content != null)
        {
            HyperLink hlNav = e.Item.FindControl("hlNavigator") as HyperLink;
            Literal newsTitle = e.Item.FindControl("NewsTitle") as Literal;
            if (newsTitle != null)
                newsTitle.Text = content.GetMetaData("SubTitle").ToString();
            string navigateTitle = content.Url.Trim();
            if (Thread.CurrentThread.CurrentUICulture.Name == "en")
                hlNav.NavigateUrl = "~/en/home/mediacentre/news/" + navigateTitle.Replace(". ", "_").Replace(" ", "_").Replace("(", "").Replace(")", "") + ".aspx";
            else
                hlNav.NavigateUrl = "~/ar/home/mediacentre/news/" + navigateTitle.Replace(". ", "_").Replace(" ", "_").Replace("(", "").Replace(")", "") + ".aspx";
        }
    }
    protected void Play_Click(object sender, ImageClickEventArgs e)
    {
        if (radRotator.RotatorType == RotatorType.SlideShow)
        {
            radRotator.RotatorType = RotatorType.SlideShowButtons;
            Play.ImageUrl = "~/App_Themes/English/Images/play.png";
 
        }
        else if (radRotator.RotatorType == RotatorType.SlideShowButtons)
        {
            radRotator.RotatorType = RotatorType.SlideShow;
            Play.ImageUrl = "~/App_Themes/English/Images/pause.png";
 
        }
    }
}
K
Top achievements
Rank 1
 answered on 27 Sep 2010
1 answer
232 views
Hi Everyone,

I am trying to get an easy way to obtain the Week Number for a given date. I have found the following GetWeekNumber function but it is not the same number that RadCalendar displays.

 

public static int GetWeekNumber(DateTime dtPassed)

 

{

 

 

CultureInfo ciCurr = CultureInfo.CurrentCulture;

 

 

 

int weekNum = ciCurr.Calendar.GetWeekOfYear(dtPassed, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);

 

 

 

return weekNum;

 

}

 

 

 

Does anyone know how to retrieve the Week number display in the Rad Calendar?

also,

Does anyone know how to select a week based on a Week number  in the Rad Calendar?

 

Your response to this thread would be excellent.

 

Regards,

 

Alberto

Dimo
Telerik team
 answered on 27 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?