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

Hello Experts,

I found so many below enteries in my server's Event Log.
Please let us know what is this and will it affect any further.

Exception information:
    Exception type: HttpException
    Exception message: Invalid viewstate.

--------------------------------------------------
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date:  7/9/2010
Time:  4:31:51 PM
User:  N/A
Computer: zCon-25
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 7/9/2010 4:31:51 PM
Event time (UTC): 7/9/2010 11:31:51 PM
Event ID: 4941ea0cd25f420cbbb8f4161e4e6b0e
Event sequence: 51426
Event occurrence: 270
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/Root/zCon-9-129229739136548100
    Trust level: Full
    Application Virtual Path: /zCon
    Application Path: C:\Inetpub\wwwroot\zCon.Net\
    Machine name: zCon-25
 
Process information:
    Process ID: 4148
    Process name: w3wp.exe
    Account name: zCon\SGupta
 
Exception information:
    Exception type: HttpException
    Exception message: Invalid viewstate.
 
Request information:
    Request URL: http://zCon-25/Ventures/WebResource.axd?d=qP0xs7JwfD7vLDM_
    Request path: /zCon-25/WebResource.axd
    User host address: 206.111.236.194
    User: lgant
    Is authenticated: True
    Authentication Type: Forms
    Thread account name: zCon\SGupta
 
Thread information:
    Thread ID: 11
    Thread account name: zCon-25\SGupta
    Is impersonating: True
    Stack trace:    at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
   at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
 
Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Simon
Telerik team
 answered on 12 Jul 2010
1 answer
70 views
When I click on a menu item and drag outside the menu area while holding down the mouse, it's giving me some weird styling, which I'm assuming is in the CSS, but I can't figure out where or why that is happening. Has anybody ran into this issue before? Is this a known issue?
Simon
Telerik team
 answered on 12 Jul 2010
1 answer
147 views
Hello everybody.
I have followed the self hierarchy example you published under the ASP.NET AJAX controls page.
As long as I use it in a ASPX page everyhting works fine, but I unfortunately need to use it in an user control.
Since the function " HideExpandColumnRecursive" is called by trapping the Page_PrerenderCompletedEvent and this event does not exists in user controls, how can I hide the rows displaying "No child records to display"?
I mean, is there any event to trap in the user control or any other way to do that?

The following is the ASCX code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ForumSummary.ascx.cs" Inherits="RadControlsWebApp.ForumSummaryControl" %>
    <body>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="WebBlue">
        </telerik:RadSkinManager>
        <div>
            <asp:Label ID="Label1" runat="server" 
                        Text="Forum summary" 
                        ForeColor="White" 
                        BackColor="#9900FF"
                        BorderColor="#000099" 
                        BorderStyle="Solid" 
                        Font-Names="Arial" 
                        Font-Size="11pt" />
        </div>
        <div>
            <telerik:RadGrid ID="radGridParent" 
                                runat="server" 
                                GridLines="None"
                                Height="500px" ShowHeader="False"
                                Width="1000px"
                                Skin="Windows7"
                                AutoGenerateColumns="False"
                                OnColumnCreated="radGridParent_ColumnCreated"
                                OnItemCreated="radGridParent_ItemCreated"
                                OnItemDataBound="radGridParent_ItemDataBound">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />               
                    </ClientSettings>
                <MasterTableView DataKeyNames="UniqueID, ParentID" 
                                    ShowHeader="True" 
                                    ShowFooter="true"
                                    AllowPaging="False" 
                                    PageSize="10"
                                    EditMode="InPlace"
                                    HierarchyDefaultExpanded="true" 
                                    ExpandCollapseColumn-Visible="false" 
                                    ShowHeadersWhenNoRecords="false"
                                    HierarchyLoadMode="Client" 
                                    CommandItemDisplay="None">
                    <SelfHierarchySettings ParentKeyName="ParentID" KeyName="UniqueID" />
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="columnUniqueID" Visible="False">
                            <ItemTemplate>
                                <asp:Label ID="lblUniqueID" runat="server" Text='<%# Eval("CategoryRef.UniqueID") %>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="columnParentID" Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblParentID" runat="server" Text='<%# Eval("CategoryRef.ParentID") %>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="columnName">
                            <HeaderStyle HorizontalAlign="Center" Width="370px"/>
                            <HeaderTemplate>
                                <asp:Label ID="lblNameHeader" runat="server" Text="Categoria"/>                                   
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="hLinkName" runat="server" OnClick="hLinkName_Click" Text='<%# Eval("CategoryRef.Name") %>'/>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="textBoxName" runat="server" Text='<%# Eval("CategoryRef.Name") %>'/>
                                <asp:DropDownList ID="dropDownListParentsEdit" runat="server" DataValueField="UniqueID" DataTextField="Name" />
                            </EditItemTemplate>
                            <FooterTemplate >
                                <asp:TextBox ID="textBoxInsertName" runat="server"/>
                                <asp:DropDownList ID="dropDownListParents" runat="server" DataValueField="UniqueID" DataTextField="Name" />
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="columnDiscussionsNumber">
                            <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                            <HeaderTemplate>
                                <asp:Label ID="lblDiscussionsNumberHeader" runat="server" Text="Discussioni"/>                                   
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblDiscussionsNumber" runat="server" Text='<%# Eval("DiscussionsNumber") %>' />
                            </ItemTemplate>
                            <FooterTemplate >
                                <asp:Button ID="buttonInsert" runat="server" Text="Crea" OnClick="buttonInsert_Click"/>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="columnPostsNumber">
                            <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                            <HeaderTemplate>
                                <asp:Label ID="lblPostsNumberHeader" runat="server" Text="Messaggi"/>                                   
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblPostsNumber" runat="server" Text='<%# Eval("PostsNumber") %>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="columnLastPostUrl">
                            <HeaderStyle HorizontalAlign="Center" Width="300px"/>
                            <HeaderTemplate>
                                <asp:Label ID="lblLastPostUrlHeader" runat="server" Text="Ultimo messaggio"/>                                   
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:HyperLink ID="hLinkLastPostUrl" runat="server" NavigateUrl='<%# Eval("LastPostUrl") %>' Text='<%# Eval("LastPostUrl") %>'/>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn>
                        </telerik:GridEditCommandColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </body>
</html>

And this the code behind:
protected void Page_Load(object sender, EventArgs e)
{
    if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1 || Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("4.0") != 1)
    {
        radGridParent.MasterTableView.FilterExpression = @"!it.ParentID.HasValue";
    }
    else
    {
        radGridParent.MasterTableView.FilterExpression = "ParentID IS NULL";
    }
    LoadData();
    radGridParent.DataSource = forumSummaries;
}
protected void radGridParent_ItemCreated(object sender, GridItemEventArgs e)
{
    CreateExpandCollapseButton(e.Item, "columnName");
    if (e.Item is GridHeaderItem && e.Item.OwnerTableView != radGridParent.MasterTableView)
    {
        e.Item.Style["display"] = "none";
    }
    if (e.Item is GridFooterItem)
    {
        DropDownList ddlList = e.Item.FindControl("dropDownListParents") as DropDownList;
        if (ddlList != null)
        {
            if (ddlList.DataSource == null)
            {
                ddlList.DataSource = GetCategoriesForDropDownList();
            }
        }
    }
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        ForumSummary summary = e.Item.DataItem as ForumSummary;
        GridEditableItem item = e.Item as GridEditableItem;
        DropDownList list = item.FindControl("dropDownListParentsEdit") as DropDownList;
        if (list != null)
        {
            list.DataSource = GetCategoriesForDropDownList();
            if (summary != null)
            {
                if (summary.CategoryRef.ParentID != null)
                {
                    list.SelectedValue = summary.CategoryRef.ParentID.ToString();
                }
            }
        }
    }
    if (e.Item is GridNestedViewItem)
    {
        e.Item.Cells[0].Visible = false;
    }
}
public void HideExpandColumnRecursive(GridTableView tableView)
{
    GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
    foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
    {
        foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
        {
            nestedView.Style["border"] = "0";
            Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");
            if (nestedView.Items.Count == 0)
            {
                if (MyExpandCollapseButton != null)
                {
                    MyExpandCollapseButton.Style["visibility"] = "hidden";
                }
                nestedViewItem.Visible = false;
            }
            else
            {
                if (MyExpandCollapseButton != null)
                {
                    MyExpandCollapseButton.Style.Remove("visibility");
                }
            }
            if (nestedView.HasDetailTables)
            {
                HideExpandColumnRecursive(nestedView);
            }
        }
    }
}
public void CreateExpandCollapseButton(GridItem item, string columnUniqueName)
{
    if (item is GridDataItem)
    {
        int level = item.ItemIndexHierarchical.Split(':').Length;
        if (level > 1)
        {
            foreach (WebControl ctr in item.Controls)
            {
                for (int i = 0; i < ctr.Controls.Count; i++)
                {
                    if (ctr.Controls[i] is WebControl && !(ctr.Controls[i] is Button))
                    {
                        (ctr.Controls[i] as WebControl).Style["margin-left"] = level * 10 + "px";
                    }
                }
            }
        }
    }
}
As you can see by reading the code behind it misses a place where to call the HideExpandColumnRecursive that hides the the sub row of empty childs.
Is there any way to hide that??
Thanks a lot in advance.
Nick
Martin
Telerik team
 answered on 12 Jul 2010
1 answer
123 views
Hello Guys,

I have a issue with RadTreeView,
I need to prerender this control for use caching, but i received the folowing message error:
Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.
at Telerik.Web.UI.ScriptRegistrar.GetScriptManager(Control control)
at Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors()
at Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer)

The scriptmanager is in the Masterpage.

code:

RadTreeView orgVivo =

new RadTreeView();

 

 

orgVivo.NodeExpand +=

new RadTreeViewEventHandler(orgVivo_NodeExpand);

 

 

 

 

 

//Pupulate nodes method
PupulateNodes(
);
StringBuilder
sb = new StringBuilder();

 

 

StringWriter sw = new StringWriter(sb);

 

 

using (HtmlTextWriter writer = new HtmlTextWriter(sw))

{

orgVivo.RenderControl(writer);//error >>>

}

 

 

CacheEntry cacheEntry = new CacheEntry();

cacheEntry.Date =

DateTime.Now;

 

 

cacheEntry.Html = sb.ToString();

 

 

 

this.PartCacheWrite(Storage.Shared, CACHE_KEY, cacheEntry, new TimeSpan(0, 30, 0));

 

this.Controls.Add(orgVivo);


Can you help me in this issue ?

Thanks,

Evandro Martins

 

 

 

Dimitar Milushev
Telerik team
 answered on 12 Jul 2010
2 answers
120 views
Hello,

    I am currently using the AJAX controls, is there an tutorial available on dynamically adding additional controls? What I am trying to accomplish is a  "add more" button similar to the functionality in the RadUpload control and I am attempting to use this with the RadComboBox control.

Thanks
Adonis
Top achievements
Rank 1
 answered on 12 Jul 2010
3 answers
141 views
I am using radscriptmanager with 2010 q1 telerik ajax release
     <telerik:RadScriptManager runat="server" EnableScriptCombine="false">
       <AuthenticationService Path="~/Services/SpendusAuthService.asmx" />
       <Scripts>
          <asp:ScriptReference Path="~/js/logon.js"/>
       </Scripts>
    </telerik:RadScriptManager>

In the logon.js file I need to disable ajaxtoolkit validator, and used to like this
    if (AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout != null) {
        AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();
    }

But I am getting AjaxControlToolkit not defined. This is the only thing not working from my .net 3.5 conversion. Any help greatly appreciated



Dimitar Milushev
Telerik team
 answered on 12 Jul 2010
1 answer
101 views
I'm using the radgrid to display/sort data and maintain consistency in the app, but editing and adding of one particular grid is handled by another control due to complexity. 

I'm able to handle most of this in the OnItemCommand event with either RadGrid.InitInsertCommandName, RadGrid.EditCommandName etc.   The part I'm having trouble with is the actual Add button.  The "Add new item" LinkButton works fine but the "+" button never hits the OnItemCommand event even though they presumably would be doing the exact same thing.  What do I have to do?
Martin
Telerik team
 answered on 12 Jul 2010
1 answer
73 views
The RadComboBox appears to position the results of the ItemRequested event so that the most number of items can appear - for example, if there are 100 results returned, and the bottom of the browser window is closer, the results will appear above the box.

Is there any way to force the results to always appear below the combo box?
Simon
Telerik team
 answered on 12 Jul 2010
1 answer
76 views
I have a databound RadComboBox (with databound item list). If the SelectedValue is not in the item list I get a "Selection out of Range" exception.
Is there any way to prevent this and just set SelectedValue to null?

Thanks!
Simon
Telerik team
 answered on 12 Jul 2010
1 answer
81 views
I'm having an issue binding to an OpenAccessDatasource

I have my DS on the page, and I link it to the combo, all works well, but if I specify a DataText or DataValue field in one of the linked objects it throws an error saying that property doesn't exist (when it does)

So this works
DataTextField="RotationID" DataValueField="RotationID">

This fails
DataTextField="Rotation.RotationName" DataValueField="RotationID">
Simon
Telerik team
 answered on 12 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?