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

grid editing/inserting not working

2 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 15 Dec 2010, 06:17 PM
I have a grid with 1 master table and 1 details table.  On my development machine when I expand the detail section then click the 'add a new record' button, the edit section appears and I can add some data, then save.  After uploading to  a hosted environment, clicking 'add new record' does nothing !  I get the ajax animated icon, but no edit section appears so I cant input any data.

I have a similar grid on another page and it works perfectly.  Can anyone help ?  this has now gone live but it wont work.  Am I missing something ?


<asp:Panel ID="PanelTypes" runat="server" GroupingText="Banners" Width="100%" >
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="false" Height="75px" Width="75px" Transparency="25">
                            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /></telerik:RadAjaxLoadingPanel>
                            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
                ClientEvents-OnRequestStart="conditionalPostback" Width="100%">
                            <telerik:RadGrid ID="RadGridBannerImages" runat="server"
                                GridLines="None" AllowSorting="True"
                                ShowStatusBar="True" Skin="Vista"
                                ondeletecommand="RadGridBannerImages_DeleteCommand"
                                oninsertcommand="RadGridBannerImages_InsertCommand"
                                onneeddatasource="RadGridBannerImages_NeedDataSource"
                                onupdatecommand="RadGridBannerImages_UpdateCommand"
                                Width="1190px" onitemdatabound="RadGridBannerImages_ItemDataBound"
                                AllowPaging="True" PageSize="5" AutoGenerateColumns="False" Height="100%"
                                    OnDetailTableDataBind="RadGridBannerImages_DetailTableDataBind"
                                    onitemcommand="RadGridBannerImages_ItemCommand" HorizontalAlign="Left"
                                    onitemcreated="RadGridBannerImages_ItemCreated">
                                <HeaderContextMenu Skin="Vista" EnableTheming="True">
                                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                </HeaderContextMenu>
                                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" />
                                <HeaderStyle  Wrap="true" />
 
                                <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" OverrideDataSourceControlSorting="True"
                                    EditMode="InPlace" UseAllDataFields="True" Name="BannerName">
                                    <detailtables>
                                        <telerik:GridTableView runat="server" DataKeyNames="ID" Name="BannerImages" Width="100%" CommandItemDisplay="Top" ShowFooter="True">
                                         
                                        <RowIndicatorColumn>
                                                <HeaderStyle Width="20px" />
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn>
                                                <HeaderStyle Width="20px" />
                                            </ExpandCollapseColumn>
                                            <Columns>
                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandBannerImage">
                                            <HeaderStyle Width="20px" />
                                            </telerik:GridEditCommandColumn>
                                            <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"
                                            ReadOnly="true" Visible="false" SortExpression="ID" UniqueName="ID">
                                            </telerik:GridBoundColumn>
                                             
                                            <telerik:GridTemplateColumn UniqueName="PanelNumber" HeaderText="Panel Location"  SortExpression="Position">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "PanelNumber")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadComboBox ID="RadComboBoxPanelNumber" Runat="server" Skin="Vista">
                                                    <Items>
                                                        <telerik:RadComboBoxItem runat="server" Text="Left" Value="1" />
                                                        <telerik:RadComboBoxItem runat="server" Text="Center" Value="2" />
                                                        <telerik:RadComboBoxItem runat="server" Text="Right" Value="3" />
                                                         
                                                    </Items>
                                                </telerik:RadComboBox>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                             
                                             
                                             
                                           <telerik:GridTemplateColumn UniqueName="ImageNumber" HeaderText="Image Number"  SortExpression="Position">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ImageNumber")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadComboBox ID="RadComboBoxImageNumber" Runat="server" Skin="Vista">
                                                    <Items>
                                                        <telerik:RadComboBoxItem runat="server" Text="1" Value="1" />
                                                        <telerik:RadComboBoxItem runat="server" Text="2" Value="2" />
                                                        <telerik:RadComboBoxItem runat="server" Text="3" Value="3" />
                                                        <telerik:RadComboBoxItem runat="server" Text="4" Value="4" />
                                                        <telerik:RadComboBoxItem runat="server" Text="5" Value="5" />
                                                        <telerik:RadComboBoxItem runat="server" Text="6" Value="6" />
                                                        <telerik:RadComboBoxItem runat="server" Text="7" Value="7" />
                                                        <telerik:RadComboBoxItem runat="server" Text="8" Value="8" />
                                                        <telerik:RadComboBoxItem runat="server" Text="9" Value="9" />
                                                        <telerik:RadComboBoxItem runat="server" Text="10" Value="10" />
                                                         
                                                    </Items>
                                                </telerik:RadComboBox>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                                                                                                     
                                             
                                              <telerik:GridTemplateColumn HeaderText="Image File" UniqueName="ImageUpload">
                                            <ItemTemplate>
                                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageURL") %>' Height="162" Width="207"/>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                    <telerik:RadUpload ID="RadUploadImage" runat="server"
                                                    InitialFileInputsCount="1" MaxFileInputsCount="1"
                                                    ControlObjectsVisibility="None" MaxFileSize="100000"
                                                    AllowedFileExtensions=".jpg,.gif,.jpeg,.png" TargetFolder="~/Uploads"/>
                                            </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                             
                                             
                                             
                                            <telerik:GridButtonColumn ConfirmText="Delete this image ?" ButtonType="ImageButton"
                                        CommandName="Delete" Text="Delete" UniqueName="DeleteFlash">
                                        <HeaderStyle Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                    </telerik:GridButtonColumn>                        
                                            </Columns>
                                             
                                            <rowindicatorcolumn>
                                                <HeaderStyle Width="20px" />
                                            </rowindicatorcolumn>
                                            <expandcollapsecolumn visible="True">
                                                <HeaderStyle Width="20px" />
                                            </expandcollapsecolumn>
                                        </telerik:GridTableView>
                                    </detailtables>
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="20px" />
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn visible="True">
                                        <HeaderStyle Width="20px" />
                                    </ExpandCollapseColumn>
                                    <Columns>
                                                                                 
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandBannerName">
                                        <HeaderStyle Width="20px" />
                                        </telerik:GridEditCommandColumn>                               
                                         
                                                                                
                                         
                                        <telerik:GridBoundColumn UniqueName="BannerName" DataField="BannerName" HeaderText="Banner Name" />
                                                            
                                                                           
                                         
                                        <telerik:GridButtonColumn ConfirmText="Delete this banner ?" ButtonType="ImageButton"
                                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">
                                        <HeaderStyle Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                    </telerik:GridButtonColumn>
 
 
 
                                    </Columns>
                                     
 
                                </MasterTableView>
                                 
                                <FilterMenu EnableTheming="True">
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                </FilterMenu>
                            </telerik:RadGrid>
                            </telerik:RadAjaxPanel>
 
        </asp:Panel>

2 Answers, 1 is accepted

Sort by
0
mww
Top achievements
Rank 1
answered on 15 Dec 2010, 06:39 PM
I managed to get an error message, but it makes no sense

Webpage error details
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)
Timestamp: Wed, 15 Dec 2010 17:32:39 UTC
 
 
Message: Sys.WebForms.PageRequestManagerServerErrorException: DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'ImageURL'.
Line: 6
Char: 62099
Code: 0
URI: http://ukliveentertainment.co.uk/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a3de828f0-5e0d-4c7d-a36b-56a9773c0def%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.527.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a1e3fef00-f492-4ed8-96ce-6371bc241e1c%3a16e4e7cd%3a86526ba7%3aed16cbdc%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3a68f76a79%3a58366029%3aaa288e2d%3a874f8ea2%3a2a2fc429


This seems to be whats causing the problem, but why is it working on my development machine but not in the hosted environment ???



<telerik:GridTemplateColumn HeaderText="Image File" UniqueName="ImageUpload">
                                           <ItemTemplate>
                                           <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageURL") %>' Height="162" Width="207"/>
                                           </ItemTemplate>
                                           <EditItemTemplate>
                                                   <telerik:RadUpload ID="RadUploadImage" runat="server"
                                                   InitialFileInputsCount="1" MaxFileInputsCount="1"
                                                   ControlObjectsVisibility="None" MaxFileSize="100000"
                                                   AllowedFileExtensions=".jpg,.gif,.jpeg,.png" TargetFolder="~/Uploads"/>
                                           </EditItemTemplate>
                                           </telerik:GridTemplateColumn>


There IS a column called ImageURL, so whats going on here, can anyone help me ?
0
Tsvetina
Telerik team
answered on 21 Dec 2010, 09:58 AM
Hi,

This could be caused by using a name for the column that is already used for a property name in the application and this might be confusing the control. Additionally, it might be some problems with the way you bind your RadGrid control, so could you please paste the code you use to bind the grid (and also rebind it where you need to)?

Greetings,
Tsvetina
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.
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
mww
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or