This is a migrated thread and some comments may be shown as answers.

Manipulating control during grid bind causes error

3 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
STCoderGuy
Top achievements
Rank 1
STCoderGuy asked on 29 Oct 2009, 01:25 PM
Hi,

I have a radGrid that I am binding on a timer often (~10secs). I have resize/reorder columns, resize rows and select rows enabled. If while operating any of the resize/reorder commands the grid is rebound, the grid hangs. This is easiest replicated by making the timer 1 sec, and then dragging a column and not placing it right away, allowing the bind to occur during the control manipulation. The page shows a javascript error and the grid does not re-render (the outline if the column header is stuck). The Javascript error is: this.get_element() parentNode is Null or not an object. The little bit of Jscript in the markup is not the issue, I have commented it out and I still recieve the error. Also, my Script manager (using the radManager) is on the Master Page.

Regards

<%@ Page Language="vb" AutoEventWireup="false" EnableEventValidation="false" CodeBehind="radViewAlarms.aspx.vb" Inherits="ClientWebApp.radViewAlarms" MasterPageFile="~/radClientWebApp.Master"%> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
 
<asp:Content ContentPlaceHolderID="cphHeader" ID="cphBreadCrumbs" runat="server">  
<table class="PageHeader">  
 
<tr> 
<td> 
    <asp:Label ID="lblBreadCrumbs" runat="server" ></asp:Label> 
 
</td> 
 
</tr> 
</table> 
 
<table class="PageHeaderToolbar">  
    <tr> 
        <td> 
            <asp:ImageButton ID="imgbtnAck" runat="server" ToolTip="Click to acknowledge the selected alarm." ImageUrl="~/Style/Images/alarm_aknowlege.gif" /> 
            <asp:ImageButton ID="imgbtnDel" runat="server" ToolTip="Click to delete the selected alarm." ImageUrl="~/Style/Images/alarm_delete.gif" style="width: 16px" /> 
        </td> 
    </tr> 
</table> 
 
</asp:Content> 
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="cphBody" runat="server">  
 
<script type="text/javascript">  
    var selected = {};  
    function RadGrid1_RowSelected(sender, args) {  
      
        var AlarmGUID = args.getDataKeyValue("AlarmGUID");  
        if (!selected[AlarmGUID]) {  
          
            selected[AlarmGUID] = true;  
            }  
       }  
       function RadGrid1_RowDeselected(sender, args) {  
           var AlarmGUID = args.getDataKeyValue("AlarmGUID");  
           if (selected[AlarmGUID]) {  
 
               selected[AlarmGUID] = null;  
           }  
       }  
       function RadGrid1_RowCreated(sender, args) {  
           var AlarmGUID = args.getDataKeyValue("AlarmGUID");  
           if (selected[AlarmGUID]) {  
 
               args.get_gridDataItem().set_selected(true);  
           }  
       }  
    </script> 
 
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" > 
 
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true" 
                AllowSorting="True" AutoGenerateColumns="False" GridLines="Both"  Skin="Black" EnableAjaxSkinRendering="false" > 
             <MasterTableView ClientDataKeyNames="AlarmGUID"  RowIndicatorColumn-Display="false" TableLayout="Auto"  > 
             <Columns> 
                    <telerik:GridBoundColumn DataField="Severity"  HeaderText="Severity" SortExpression="Severity"  ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"   />   
                    <telerik:GridBoundColumn  DataField="DisplayName" HeaderText="DisplayName" SortExpression="DisplayName" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"   />   
                    <telerik:GridBoundColumn  DataField="Description" HeaderText="Description" SortExpression="Description" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"  />   
                    <telerik:GridBoundColumn  DataField="TimeFirst" HeaderText="TimeFirst" SortExpression="TimeFirst" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="TimeLast" HeaderText="TimeLast" SortExpression="TimeLast" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="AlarmId" HeaderText="AlarmId" SortExpression="AlarmId" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="AckedBy" HeaderText="AckedBy" SortExpression="AckedBy" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" EmptyDataText="UnAcked" />   
                    <telerik:GridBoundColumn  DataField="TimeAcked" HeaderText="TimeAcked" SortExpression="TimeAcked" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" EmptyDataText="UnAcked" />   
                    <telerik:GridBoundColumn  DataField="OccurrenceCount" HeaderText="OccurrenceCount" SortExpression="OccurrenceCount" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="NewOccurrenceCount" HeaderText="OccurrenceCount" SortExpression="NewOccurrenceCount" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />    
              </Columns> 
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                </MasterTableView> 
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                    <Selecting AllowRowSelect="True" /> <Resizing AllowRowResize="True"/> <Resizing AllowColumnResize="True"/>   
<ClientEvents OnRowSelected="RadGrid1_RowSelected" OnRowDeSelected="RadGrid1_RowDeselected"  OnRowCreated="RadGrid1_RowCreated" /> 
                   </ClientSettings> 
                  
                 </telerik:RadGrid> 
                      
            <asp:Timer ID="Timer1" runat="server" Interval="1000">  
            </asp:Timer> 
       
        </telerik:RadAjaxPanel> 
      
</asp:Content> 
 

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 03 Nov 2009, 02:13 PM
Hello STCoderGuy,

Please find the answer to your questions in the other thread you have posted on this subject.

Regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rory
Top achievements
Rank 1
answered on 09 Apr 2010, 07:13 PM
please place a link to the answer to the questions in the other thread that was posted on this subject.
0
Iana Tsolova
Telerik team
answered on 14 Apr 2010, 11:45 AM
Hi Rory,

To overcome the descried behavior you can try disabling the timer onkeydown and enable it back onkeyup client-side events of the form. This the timer would not fire postback while a user operation is performed.
Find a sample project illustrating the suggested solution with the Timer disabling and enabling here.

I hope this helps.

Kind regards,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
STCoderGuy
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Rory
Top achievements
Rank 1
Share this question
or