Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
699 views
Telerik,

We're using the Q2 2010 release and having an unusual, periodic but consistent and reproducible problem with the controls on load. The user gets a javascript error saying that a client-side event handler (in the below case, Toolbar_Clicked) is undefined. This happens in all versions of IE (but apparently not other browsers). It doesn't seem to happen locally, but it will happen when accessing our site over the Internet. If the user loads a page say 10 times, it will happen half the time. All of our pages have a mix of Telerik controls but this seems to happen mostly when there is a splitter control on the page. Stepping into the browser debugger, the code will look something like this:

WebForm_InitCallback();Telerik.Web.UI.RadSplitter._preInitialize("Radsplitter1");Telerik.Web.UI.RadPane._preInitialize("Radpane1", "Radsplitter1", "", "Radsplitbar1",  0, 0, "False");Telerik.Web.UI.RadSplitBar._preInitialize("Radsplitbar1", "Radsplitter1", "Radpane1", "Radpane2", 1, 0);Telerik.Web.UI.RadPane._preInitialize("Radpane2", "Radsplitter1", "Radsplitbar1", "",  2, 1, "True");Sys.Application.initialize();
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadAjaxManager, {"_updatePanels":"","ajaxSettings":[{InitControlID : "ClientGroupGrid",UpdatedControls : [{ControlID:"ClientGroupGrid",PanelID:""}]},{InitControlID : "ClientGrid",UpdatedControls : [{ControlID:"ClientGrid",PanelID:""}]}],"clientEvents":{OnRequestStart:"",OnResponseEnd:""},"defaultLoadingPanelID":"","enableAJAX":true,"enableHistory":false,"links":[],"styles":[],"uniqueID":"RadAjaxManager1","updatePanelsRenderMode":0}, null, null, $get("RadAjaxManager1"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadToolBar, {"_skin":"Professional","attributes":{},"clientStateFieldID":"ClientGroupToolbar_ClientState","collapseAnimation":"{\"type\":0,\"duration\":0}","expandAnimation":"{\"duration\":450}","itemData":[{"commandName":"NEW","cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/createtool.gif"},{"commandName":"EDIT","enabled":false,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/edittool.gif","disabledImageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/edittool_dis.gif"},{"commandName":"DELETE","enabled":false,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/deltool.gif","disabledImageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/deltool_dis.gif"},{"enabled":false,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/toolsep.gif"},{"commandName":"FILTERS","checkOnClick":true,"group":"Filter","checked":true,"allowSelfUnCheck":true,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/filttool.gif"},{"commandName":"CLIENTS","checkOnClick":true,"group":"Pane","allowSelfUnCheck":true,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/docs.gif"}]}, {"buttonClicked":Toolbar_Clicked,"load":_toolbarOnLoad}, null, $get("ClientGroupToolbar"));
});

The error is on the Sys.Application.add_init() line for the toolbar. The "buttonClicked" attribute is being set to a client-side function, Toolbar_Clicked, which apparently doesn't exist yet in the script DOM. Again, there are no script errors or any other problems on the page itself typically, since it loads properly half the time. It seems like some kind of timing/sync issue. Any help would be greatly appreciated.

Mike Oliver
Infotrieve, Inc.


Q2 2010 Release
Dustin
Top achievements
Rank 1
 answered on 04 Nov 2010
3 answers
124 views
Greetings...

I'm attempting to implement the code from the Related ComboBoxes demo using a Country/State combination. My issue is that I'm doing so in a Popup GridEditForm Template. I'm running into problems with gaining access to the State combo. In the demo, you are using the PageLoad event and a $find("<%= RadComboBox2.ClientID %>"); statement to set a global variable to be used later. Obviously this isn't an option with the GridEditForm Template.

Is there a way to gain access to that second ComboBox in the GridEditFormTemplate so I can kick off the requestItems with the value of the first ComboBox?

Your assistance is much appreciated.
Philip Senechal
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
102 views
Dear Forum,

Please assist! This is my first attempt at using RadFilter with RadGrid and it does work, but the entire page insists upon posting back and I cannot work out how to keep that from happening. I would like the page to work in exactly the same manner as the example
http://demos.telerik.com/aspnet-ajax/filter/examples/saveloadexpressions/defaultcs.aspx
My page does not seem to know that it should be using AJAX for a partial page postback and I don't get the page loading rotating circle image either. I have copied the entire example page and used my radgrid and data source in place of the example radgrid and data source, but still the entire page posts back. What is the deal? Any ideas?

Thanks,
Celeste
Celeste
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
136 views
Hi,

i want to know what i can do against this fail buildup:

http://desmond.yfrog.com/Himg839/scaled.php?tn=0&server=839&filename=failtreeview.png&xsize=640&ysize=640

I used LoadOnDemand approach ServerSide and ServerSideCallBack.

Failing in IE 7.0.5xxxx
Working correct in Firefox 3.5

thanks Mario

Mario
Top achievements
Rank 2
 answered on 04 Nov 2010
3 answers
76 views
Hi,

Here is an interesting issue that a customer brought up:

In FireFox, in a modal popup window with the editor is in DIV mode.  Copy some text from MS Word into the editor.

Close the editor in such a way to save the data (our app saves to a database).

Reopen the editor reading the data from your data store.

Hi-lite all the text (ctrl-a)  Click the Delete key.  Notice that the text does not delete.  You can't delete the text until you type a character at the end or beginning of your pasted text.  This is only a FireFox issue.  Does not happen in Safari or IE. (Haven't testing in Chrome)

Sometimes you don't have to save the pasted text, editing just gets hosed right after pasting.

This feature was introduced sometime in the last 2 versions. (We have a site running an older version of the tools.)

Here is our editor definition in the markup:

 

 

<telerik:RadEditor ID="txtItemSubject" runat="server"
EnableResize="False"

 

 

Width="590" Height="110"

 

EditModes="Design, html"

 

SpellCheckSettings-AllowAddCustom="false"

 

 

 

SpellCheckSettings-DictionaryLanguage="en-US"
SpellCheckSettings-SpellCheckProvider="TelerikProvider"

 

 

 

OnClientPasteHtml="OnClientPaste"

 

 

 

StripFormattingOnPaste="AllExceptNewLines"

 

 

 

ContentAreaMode="Div"

 

 

 

Contentfilters="MozEmStrong, EncodeScripts"

 

 

 

OnClientModeChange="OnClientModeChange"

 

 

 

OnClientLoad="OnRadEditorClientLoad">

 

 

OnClientPaste only checks the length of the text pasted - not modifications are done to the paste. 
OnRadEditorClientLoad resizes the client area so the sizing is the same between browsers - again, not modifying the text.

This is repoducable with any text from Word.  (I just opened a random word doc and copied from several different line and could repro this regardless of the line - so it's not Word doc specific.

Thanks!
Rich

Dobromir
Telerik team
 answered on 04 Nov 2010
2 answers
140 views
I have a situation where I drag from a RadListBox to a RadTreeView.  It is quite similar to this Telerik example.

When a RadListBoxItem is dropped, it fires the OnClientDropping event.  The event argument has a get_sourceItem() method where I can access the RadListBoxItem and its attributes.  The event argument also has a get_destinationItem() method, but it is coming up null.  I'm guessing this is because the destination item is a RadTreeNode and not a RadListBoxItem.

I need to compare a custom attribute in the source and destination items before I allow the drop to occur.  How can I get a reference to the destination RadTreeNode and check its custom attributes inside the OnClientDropping event handler?

Thanks!


Jon Shipman
Top achievements
Rank 1
 answered on 04 Nov 2010
5 answers
283 views
In IE8 the filter boxes are not aligned with the columns. I converted IE8 to compatibility mode and everything worked fine. I am wondering if there is a work around or did telerik provide a solution to this problem. If anyone has a quick fix it would be appreciated!
Daniel
Telerik team
 answered on 04 Nov 2010
11 answers
623 views
Hi Telerik,

I am using a RadGrid with a NestedViewTemplate. Within that NestedViewTemplate is another RadGrid.
All data is binding correctly using Advanced DataBinding techniques. My problem is the nested grid just will not fire the "ItemCommand" event.

If I say add a button within the template this will fire correctly. It's just any commands sent from the inner grid that wont fire.

I've tried adding an ItemCommand eventhandler directly to the inner grid but still nothing. So in the code below the "AddPayment" command fires as it's a button seperate from the grid. But no matter what I've tried (GridButtonCol, Button within a Template Col etc)
no ItemCommand is fired for RadGrid: Payments.

<telerik:RadGrid ID="InvoiceGrid" runat="server" >
    <MasterTableView Name="Master" AutoGenerateColumns="false" EditMode="EditForms" AllowPaging="true" ShowHeader="true" PageSize="10" DataKeyNames="InvoiceId">
        <NestedViewSettings>
            <ParentTableRelation><telerik:GridRelationFields DetailKeyField="InvoiceId" MasterKeyField="InvoiceId" /></ParentTableRelation>
        </NestedViewSettings>
        <NestedViewTemplate>          
           <fieldset style="padding:10px;">
                <legend style="padding:5px;"><b><asp:Label runat="server" ID="InvoiceHeadings" Text="Invoice Payments"></asp:Label></b></legend>
                <div id="InvoicePaymentsGrid" runat="server">
                <asp:Button runat="server" ID="AddNewPayment" Text="Add Payment" CommandName="AddPayment" />
                 <telerik:RadGrid runat="server" ID="Payments">                     
                     <MasterTableView Name="PaymentsMaster" AutoGenerateColumns="false" AllowPaging="true" ShowHeader="true" PageSize="10" DataKeyNames="PaymentId">
                        <Columns>
                            <telerik:GridBoundColumn DataField="PaymentMethod" HeaderText="Payment Method">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Payment Date" DataField="DateCreated" DataFormatString="{0:dd/MM/yyyy HH:mm}" UniqueName="DateCreated" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" DataFormatString="{0:C}" UniqueName="Amount" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn UniqueName="test">
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="Test" CommandName="Test" Text="Test" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridButtonColumn ButtonType="ImageButton" Text="Edit" UniqueName="EditOverride" CommandName="EditPayment">
                                <HeaderStyle Width="20px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Are you sure you want to delete this Invoice?" CommandName="DeletePayment" Text="Delete" UniqueName="Delete">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </telerik:GridButtonColumn>
                        </Columns>                            
                    </MasterTableView>
                 </telerik:RadGrid>               
                 </div>            
            </fieldset>                       
        </NestedViewTemplate>        
        <Columns>
            <telerik:GridBoundColumn DataField="InvoiceNumber" HeaderText="Invoice Number" UniqueName="InvoiceNumber"></telerik:GridBoundColumn>  
            <telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" DataFormatString="{0:C}" UniqueName="Amount" ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Amount Paid" UniqueName="AmountPaid">
                <ItemTemplate><asp:Label runat="server" ID="AmountPaidLabel" ></asp:Label></ItemTemplate>
            </telerik:GridTemplateColumn>          
            <telerik:GridTemplateColumn HeaderText="Subscription" UniqueName="Subscription">
                <ItemTemplate><asp:Label runat="server" ID="SubscriptionLabel" ></asp:Label></ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn HeaderText="Description" UniqueName="Description" DataField="Description">                
            </telerik:GridBoundColumn>  
            <telerik:GridBoundColumn HeaderText="Date Created" DataField="DateCreated" DataFormatString="{0:dd/MM/yyyy HH:mm}" UniqueName="DateCreated" ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Date Updated" DataField="DateUpdated" DataFormatString="{0:dd/MM/yyyy HH:mm}" UniqueName="DateUpdated" ReadOnly="true">
            </telerik:GridBoundColumn>      
            <telerik:GridButtonColumn HeaderText="" ItemStyle-HorizontalAlign="Center" ButtonType="ImageButton" Text="View Invoice" UniqueName="ShowPdf" CommandName="ShowPdf"
                HeaderStyle-Width="20px" ItemStyle-Width="20px" FooterStyle-Width="20px">
            </telerik:GridButtonColumn>
            <telerik:GridButtonColumn HeaderText="" ItemStyle-HorizontalAlign="Center" ButtonType="ImageButton" Text="Email Invoice" UniqueName="Email" CommandName="Email"
                HeaderStyle-Width="20px" ItemStyle-Width="20px" FooterStyle-Width="20px">
            </telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" Text="Edit" UniqueName="EditOverride" CommandName="Edit">
                <HeaderStyle Width="20px" />
            </telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Are you sure you want to delete this Invoice?" CommandName="Delete" Text="Delete" UniqueName="Delete">
                <HeaderStyle Width="20px"></HeaderStyle>
            </telerik:GridButtonColumn>
        </Columns>     
    </MasterTableView>
</telerik:RadGrid>

  private void InvoiceGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {                              
                RadGrid paymentsGrid = (RadGrid)e.Item.FindControl("Payments");
                paymentsGrid.NeedDataSource += new GridNeedDataSourceEventHandler(PaymentsGrid_NeedDataSource);                
            }
            else if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {                
                FormatGridEditForm(e);
            }
            else if (ControlHelper.IsItem(e.Item) && e.Item.OwnerTableView.Name == "Master")
            {
                FormatInvoiceGridRow(e.Item);
            }
        }


        private void PaymentsGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            RadGrid paymentsGrid = source as RadGrid;
            GridNestedViewItem nestedItem = paymentsGrid.NamingContainer as GridNestedViewItem;
            int invoiceId = Utilities.ToInt(nestedItem.ParentItem.GetDataKeyValue("InvoiceId"));
            List<Payment> payments = MembershipDataMethods.SelectPayments(invoiceId, true);
            paymentsGrid.DataSource = from p in payments orderby p.DateCreated descending select p;           
        }
Jerry T.
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
43 views
Dear Telerik Team !

I ran into trouble with your grid. Firstly I will explain the required scenario.
I've got master page - it contains page toolbar. I've got content page - it must contain grid. This grid will use custom pager logic: I will use OnNeedDataSource and get required records from DB myself. Grid displays first page, but after clicking random page - I can see only empty grid. Having played around for a while I discovered that after post back OnNeedDataSource  event does not fire. Could you please help me - it's an urgent task and I still can't figure out what is wrong. I have to add that if I use the same code withour master/content pages everything works as expected.

Here is the grid:
<telerik:RadGrid ID="m_grid" runat="server" Skin="Black" AllowSorting="false" AllowPaging="True"
    PageSize="30" AllowCustomPaging="true"  OnNeedDataSource="RadGrid1_NeedDataSource">
    <PagerStyle Mode="NumericPages" />
    <ClientSettings>
      <Resizing AllowColumnResize="true" AllowRowResize="false" />
      <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="true" SaveScrollPosition="True" />
      <Selecting AllowRowSelect="true" />
    </ClientSettings>
  </telerik:RadGrid>

OnNeedDataSource handler is very simple the problem page does not call it.
Looking forward to hearing from you asap.
Marin
Telerik team
 answered on 04 Nov 2010
1 answer
96 views
I am trying to uncheck all nodes in a treeview using the clientside API.  I noticed that in the documentation, there is an unselectAllNodes() method, is there a way to do this to uncheck nodes too?

Edit:

This did what I needed: 
var tree = $find("<%= radTreeView.ClientID %>");
        var i;
        for (i = 0; i < tree.get_allNodes().length; i++) {
            var node = tree.get_allNodes()[i];
            var checkbox = node.get_checkBoxElement();
            checkbox.checked = false;
        }


var tree = $find("<%= radTreeViewTopics.ClientID %>");
        var i;
        for (i = 0; i < tree.get_allNodes().length; i++) {
            var node = tree.get_allNodes()[i];
            var checkbox = node.get_checkBoxElement();
            checkbox.checked = false;
 

Yana
Telerik team
 answered on 04 Nov 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?