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

Hierarchical grid: null is null or not an object

3 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco Rosignoli
Top achievements
Rank 1
Marco Rosignoli asked on 13 Dec 2010, 03:54 PM

 

 

<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
<script type="text/javascript">
<!--
function gridCommand(sender, args) {
    
if (args.get_commandName() == "DownloadAttachment") {
        
var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
        manager.set_enableAJAX(
false);
        setTimeout(
function () {
            manager.set_enableAJAX(
true);
        }, 0);
    }
}
-->
</script>
</telerik:RadCodeBlock>

 


<
telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" ShowStatusBar="false"
    AutoGenerateColumns="false" PageSize="3" AllowSorting="false" AllowMultiRowSelection="false"
    AllowPaging="false" GridLines="None" AllowAutomaticDeletes="true"
AllowAutomaticInserts="true" AllowAutomaticUpdates="true">
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="id_manifestazione" AllowMultiColumnSorting="false"
        Width="100%" CommandItemDisplay="Top" Name="Master">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="ID" DataSourceID="SqlDataSourceDetailTable" Width="100%"
                runat="server" CommandItemDisplay="Top" Name="Detail">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="id_manifestazione" MasterKeyField="id_manifestazione" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn2">
                        <HeaderStyle Width="20px" />
                        <ItemStyle CssClass="MyImageButton" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="tipo_file" Visible="true" HeaderText="Tipo file">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton"
                        DataField="ID" UniqueName="ID" ReadOnly="true">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UploadedBy" Visible="false" ReadOnly="true" HeaderText="Proprietario file">
                    </telerik:GridBoundColumn>
                    <telerik:GridAttachmentColumn DataSourceID="SqlDataSource2"
                        MaxFileSize="1048576"
                        EditFormHeaderTextFormat="Upload File:"
                        HeaderText="Download"
                        AttachmentDataField="BinaryData" 
                        AttachmentKeyFields="ID"
                        FileNameTextField="FileName" 
                        DataTextField="FileName"
                        UniqueName="AttachmentColumn">
                    </telerik:GridAttachmentColumn>
                    <telerik:GridBoundColumn DataField="FileName" Visible="false" HeaderText="FileName">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ConfirmText="Eliminare il file selezionato?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Cancellazione file" ButtonType="ImageButton" CommandName="Delete" Text="Elimina"
                        UniqueName="DeleteColumnDetail">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="tipo_file"></telerik:GridSortExpression>
                </SortExpressions>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <HeaderStyle Width="20px" />
                <ItemStyle CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="id_manifestazione" UniqueName="id_manifestazione" Visible="false" ReadOnly="true"></telerik:GridBoundColumn>
            <telerik:GridDropDownColumn DataField="id_attivita" DataSourceID="dsAttivita" 
                ListTextField="descrizione" ListValueField="ID_attivita" Display="true" Visible="true" 
                HeaderText="Attività" SortExpression="descrizione"
                UniqueName="id_attivita" ColumnEditorID="GridTextBoxColumnEditor1"></telerik:GridDropDownColumn>
            <telerik:GridBoundColumn SortExpression="manifestazione" HeaderText="manifestazione" HeaderButtonType="TextButton"
                DataField="manifestazione" UniqueName="manifestazione">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="luogo_data" HeaderText="Luogo e data" SortExpression="luogo_data"
                UniqueName="luogo_data" ColumnEditorID="GridTextBoxColumnEditor1">
            </telerik:GridBoundColumn>
  
            <telerik:GridButtonColumn ConfirmText="Eliminare la manifestazione selezionata?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Cancellazione manifestazione" ButtonType="ImageButton" CommandName="Delete" Text="Elimina"
                UniqueName="DeleteColumn">
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridButtonColumn>
        </Columns>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="id_manifestazione"></telerik:GridSortExpression>
        </SortExpressions          
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnCommand="gridCommand" />
    </ClientSettings>  
</telerik:RadGrid>

Hi,
I have a hierarchical grid. If I insert a <ClientSettings> tags when I update data in detail table, I get javascript's error "null is null or not an object".
Can someone help me?
thanks,
Marco

 

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 16 Dec 2010, 01:21 PM
Hi Marco,

Note that it is not supported to attached client commands (OnCommand) in server bind Grid as the DetailTable ID could not be correctly resolved. It could be only used when you have client data binding. The functionality you need to achieve could be correctly handled in the Ajax OnRequestStart event.

Best wishes,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Diego
Top achievements
Rank 1
answered on 23 Sep 2014, 07:14 PM
Hello,

I have the same problem, any idea.

Thanks.
0
Maria Ilieva
Telerik team
answered on 29 Sep 2014, 08:45 AM
Hello Diego,

Could you please describe what the exact issue you are facing is and what is the scenario you need to implements? Thus we could provide the best solution for your specific case.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Marco Rosignoli
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Diego
Top achievements
Rank 1
Share this question
or