Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
334 views
Hi folks

I have a rather serious problem trying to get a radTreeView to show changes in the underlying database and therefore datasource. My scenario is as follows.

1. In the Load event hander, the radTreeView is initialized as in the following example code:

                radCommentTreeView1.DataSource = Nothing
               
                // Initialize custom data object from custom hierarchical data source class
                cdsPubCommentDataSource = New CommentDataSource(1)
                radCommentTreeView1.DataSource = cdsPubCommentDataSource


                // Configure radTreeView from datasource fields
                radCommentTreeView1.DataFieldID = "ID"
                radCommentTreeView1.DataFieldParentID = "ParentID"
                radCommentTreeView1.DataTextField = "Content"


                // Bind radTreeView to datasource
                radCommentTreeView1.DataBind()

2. The page loads with radTreeView rendered correctly

3. User attempts to add or delete a node by clicking a button with a server-side handler ....

4. ... so that the postback cycle begins in the server-side code, with the Load handler from (2) above running again, to rebind the radTreeView

5. ... only after which the server-side button handler is run, successfully running an SQL command through another BLL business object (i.e., the SQL database is successfully modified ) ....

6. However, when the page renders after the postback, the radTreeView still reflects the original node hierarchy from (4) above, before the node was deleted in (5).

Could someone indicate how this process ought to be achieved within the cycle of a single postback - if I try to rebind again after the button handler, none of the radTreeView nodes render properly at all, presumably because the process must occur no later than the Load handler?

I am aware of the idea of using the INotifyPropertyChanged interface for the datasource object, and already have the event in question being successfully fired up from the DataSource object, namely a PropertyChanged event indicating a change in the DataSourceView object, but I am not sure how a PropertyChanged event handler can help in the scenario I describe - the PropertyChanged event handler in the page is still invoked before the button handler, and so the database has not been changed at the time the event handler runs. Is the PropertyChanged event the correct way forward, or is there another approach better suited for refreshing the radTreeView within a single postback cycle?

Thanks if someone can point me in the right direction with this problem.

Regards


Plamen
Telerik team
 answered on 16 Nov 2012
1 answer
96 views
Hello,

I have an application which uses RadAjaxManager to populate RadComboBoxes as users make selections on the page.  This works correctly most of the time however roughly 10% of the time the user will make a selection from combo box 1 which is supposed to populate combo box 2, the Ajax request seems to fire but it loads no values in combo box 2.

I have tested and the error is definitely not related to the data.  I can test using the exact same data that was used by someone who encountered the error and combo box 2 will load correctly for me.

Here are the Ajax settings for Combo Box 1:

<telerik:AjaxSetting AjaxControlID="rcmbMarket">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rcmbApplicationField" 
                    LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="ApplicationFieldSource" 
                    LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>

Here is the markup for combo boxes 1 & 2:

<asp:TableRow HorizontalAlign="Center" ID="ProductRow3">
        <asp:TableCell Width="25%" HorizontalAlign="Left" ID="MarketLabelCell">
            <asp:Label ID="lblMarket" runat="server" Text="Market: "></asp:Label>
            <asp:RequiredFieldValidator ID="vldMarket" runat="server" ControlToValidate="rcmbMarket" 
                ErrorMessage="*" ForeColor="Red" SetFocusOnError="true" ValidationGroup="grpMain"></asp:RequiredFieldValidator>
        </asp:TableCell>
        <asp:TableCell Width="25%" HorizontalAlign="Left" ID="MarketDDLCell">
            <telerik:RadComboBox ID="rcmbMarket" runat="server" AllowCustomText="false" DataSourceID="MarketSource" AutoPostBack="true" CausesValidation="false"
                DataTextField="MarketDesc" DataValueField="pkMarketID" AppendDataBoundItems="true" OnSelectedIndexChanged="Market_Check">
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" />
                </Items>
            </telerik:RadComboBox>
            <asp:SqlDataSource ID="MarketSource" runat="server" ConnectionString="<%$ ConnectionStrings:QuoteProdConn %>" SelectCommand="SELECT pkMarketID, MarketDesc FROM Data.Market WHERE Active = 'True' ORDER BY MarketDesc ASC"></asp:SqlDataSource>
        </asp:TableCell>
        <asp:TableCell Width="25%" HorizontalAlign="Left" ID="ApplicationLabelCell">
            <asp:Label ID="lblApplicationField" runat="server" Text="Application Field:"></asp:Label>
            <asp:RequiredFieldValidator ID="vldAppField" runat="server" ControlToValidate="rcmbApplicationField" 
                ErrorMessage="*" ForeColor="Red" SetFocusOnError="true" ValidationGroup="grpMain"></asp:RequiredFieldValidator>
        </asp:TableCell>
        <asp:TableCell Width="25%" HorizontalAlign="Left" ID="ApplicationTextCell">
            <telerik:RadComboBox ID="rcmbApplicationField" runat="server" AllowCustomText="false" DataSourceID="ApplicationFieldSource" ExpandDirection="Down"
                AutoPostBack="true" DataTextField="AppDescription" DataValueField="pkAppFieldID" AppendDataBoundItems="true" CausesValidation="false" MaxHeight="300px">
                <Items>
                    <telerik:RadComboBoxItem Text="" Value="" />
                </Items>    
            </telerik:RadComboBox>
            <asp:SqlDataSource ID="ApplicationFieldSource" runat="server" ConnectionString="<%$ ConnectionStrings:QuoteProdConn %>"></asp:SqlDataSource>
        </asp:TableCell>
    </asp:TableRow>

Here is the associated code behind function:

Protected Sub Market_Check(ByVal sender As Object, ByVal e As System.EventArgs)
  
        Dim tmpItem As New Telerik.Web.UI.RadComboBoxItem("", "")
        ApplicationFieldSource.SelectCommand = "SELECT pkAppFieldID, AppDescription FROM Data.ApplicationField WHERE Active = 'True' AND fkMarketID = " & rcmbMarket.SelectedValue.ToString() & " ORDER BY AppDescription ASC "
        ApplicationFieldSource.DataBind()
        rcmbApplicationField.Items.Clear()
        rcmbApplicationField.Items.Add(tmpItem)
        rcmbApplicationField.DataBind()
  
    End Sub

Everything here seems fairly simple so I am having a really hard time understanding why my users are encountering this issue.  The fact that it is so hard to replicate has also made this extremely difficult to troubleshoot.  Any help at all would be appreciated.

Thank you!

EDIT:  Some further information... When the issue happens it seems to persist for a few minutes.  All AJAX calls seem to fail but no error is displayed and nothing is reported to the event logs on the web server.  After a few minutes and a browser restart everything works fine once again.
Maria Ilieva
Telerik team
 answered on 16 Nov 2012
11 answers
307 views

This has me stumped.  It just started showing up one day.  We get a javascript error in some of the pages.  The error is in the WebResource.axd.  It seems to be referring to the html <col> fields related to the rad tree. It looks like it chokes on the columns with no width specified.
The really odd thing is that it works fine when it is launched from VStudio (debugging).  It errors on our dev server when we use the unqualified server name, but works when we use the fully-qualified name (http://server/page.aspx vs http://server.domain.com/page.aspx).  On production, it errors when we go through the load balancer, but not when we use the unqualified name or the non-load balanced name.  So, its hard to narrow-down the conditions.

Anyway, here is the javascript error message that we are getting:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E; .NET CLR 1.1.4322; InfoPath.3)
Timestamp: Mon, 17 Oct 2011 21:21:22 UTC

Message: Invalid argument.
Line: 14240
Char: 9
Code: 0
URI: http://servername/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_radScriptManager_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.50508.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a0c8c847b-b611-49a7-8e75-2196aa6e72fa%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.2.915.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a9 ...etc
 

  1. ASP.NET version is  .NET 4.0
  2. OS  is Windows 2008 R2 x64 (server) and Windows 7 x64 (client)
  3. exact browser version is IE 8.0.7600.*
  4. exact version of the Telerik product is Telerik.Web.UI v 2011.2.915.40
  5. preferred programming language is C#

Chuck
Top achievements
Rank 1
 answered on 16 Nov 2012
5 answers
152 views
We have a Grid with Export buttons.  The export functions as it should going to a new window.  When we click to go to another page on the grid it suddenly loses all paging, the command row, and even data in one of the columns.  It appears that when it exports it reformats the grid to remove paging and commands but then it doesn't enable the them again so when the grid posts back to get to the next page, it returns the grid w/o formatting.  We are using advanced data binding.  Here's some code snippets.  Does anyone know how to get around this?  Thanks.

<telerik:RadGrid ID="BusinessGrid" runat="server" AutoGenerateColumns="False"   
CellSpacing="0" GridLines="None" AllowPaging="True" AllowSorting="True"   
OnNeedDataSource="BusinessGrid_NeedDataSource" Height="375px"   
Width="100%" PageSize="25">
.
.
.
<ExportSettings HideStructureColumns="true" IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true"  
<Pdf PageWidth="297mm" PageHeight="210mm" />   
<Pdf PageWidth="297mm" PageHeight="210mm" />   
</ExportSettings>
Kostadin
Telerik team
 answered on 16 Nov 2012
4 answers
194 views
It is possible to define (programmaticaly) all the parameters in a series when I use DataBind

DataTable tbl = new DataTable();
...
RadHtmlChart1.DataSource = tbl;
RadHtmlChart1.DataBind();

for a dynamic page I need to control everyting from the CodeFile (C#)

thanks in advance

Jaime


Filupa
Top achievements
Rank 1
 answered on 16 Nov 2012
9 answers
277 views
Hello,

I have replaced the Microsoft ScriptManager with the RadScriptManager in my SharePoint site's master page.  That part seems to work just fine.  However, when I try to use some of the advanced features of RadScriptManager like EnableScriptCombine and TelerikCdn, they do not seem to function. It's as if these setting are getting ignored entirely, so I was wondering if they are even designed to work in SharePoint 2010?  Or perhaps there's some additional configuration steps needed to make them work?

I have successfully used these settings in a stand-alone web site (not hosted in SharePoint) without problem, even on the same machine.  Any help you can offer would be appreciated.  We are desperately trying to use these features to reduce latency in a client's production site.

Thank you,

Chris

P.S. I am currently using Telerik AJAX controls version 2011.1.413.35
Kalina
Telerik team
 answered on 16 Nov 2012
1 answer
274 views
Hi,

Displaytext for textbox not showing once we clear the text from textbox
 
Thanks,
Nagarajan Govindarajan.
Vasil
Telerik team
 answered on 16 Nov 2012
3 answers
158 views
My loading panel not shown up when click the linkbutton.Please help Thanks.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="lnkDownload">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lnkDownload" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Description"
                        UniqueName="TemplateColumn" SortExpression="Description">
                        <ItemTemplate>
                            <asp:Panel ID="pnlContent" runat="server">
                                <asp:LinkButton ID="lnkDownload" Text='<%# Bind("Description") %>' runat="server"
                                    OnClick="lnkDownload_Click"></asp:LinkButton>
                            </asp:Panel>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridTemplateColumn>
Pavlina
Telerik team
 answered on 16 Nov 2012
1 answer
222 views
Hey,

I have a RadGrid which is filtering (using dynamic LINQ), sorting and paging server side within the NeedDataSource event and everything is working perfectly. However, one of the properties I am binding to is a lookup to another table. This is workable, so in NeedDataSource I perform my lookup and set the value e.g. Say the property is called "CategoryID". I wish to display the category name as opposed to the ID. Because of this, I have the the filter template in my grid where the user can choose from a drop down list. The query will use the value "C1" for Category1 and so on (based on different text/value attributes in the RadComboBoxItem). My query runs fine (selects from table where CategoryID = 'C1') and returns results. Unfortunately, the Grid seems to being filtering client side after the results are returned (so it eliminates results that don't equal 'C1', which is everything). I can tell it's being done client side because:

1. I can put a break point in on the server and see my results after my filtering/sorting/paging.
2. If I name the CategoryID and Caterory name the same thing, the results display as expected.
3. The Grid actually displays the number of results and the correct page numbers successfully at the bottom.

Any help is much appreciated, I'm so close!

<telerik:RadGrid ID="radGridExperienceEntry" runat="server" OnNeedDataSource="GetData">
    <GroupingSettings CaseSensitive="False" />
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="Id">
        <Columns>
            <telerik:GridBoundColumn DataField="Category" UniqueName="Category" HeaderText="Category Type">
                <FilterTemplate>
                    <telerik:RadComboBox ID="RadComboBoxCategory" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Category").CurrentFilterValue %>'
                        runat="server" OnClientSelectedIndexChanged="IndexChanged">
                        <Items>
                            <telerik:RadComboBoxItem Text="All" />
                            <telerik:RadComboBoxItem Text="Category1" Value="C1" />
                            <telerik:RadComboBoxItem Text="Category2" Value="C2" />
                        </Items>
                    </telerik:RadComboBox>
                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                        <script type="text/javascript">
                            function IndexChanged(sender, args) {
                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                tableView.filter("Category", args.get_item().get_value(), "EqualTo");
                            }
                        </script>
                    </telerik:RadScriptBlock>
                </FilterTemplate>
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
Antonio Stoilkov
Telerik team
 answered on 16 Nov 2012
5 answers
112 views
I am trying to execute "Ajaxify particular templated gridview buttons" code from the below link.

http://www.telerik.com/help/aspnet-ajax/ajax-ajaxify-particular-templated-gridview-buttons.html#seeAlsoToggle

the imagebutton works well and updated textbox. but the buttonfield(standard postback on textbox) is not getting updated.Please help.
Maria Ilieva
Telerik team
 answered on 16 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?