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

Edit for detail record fails when multiple detail records present

3 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott Tremain
Top achievements
Rank 1
Scott Tremain asked on 23 Aug 2011, 05:23 PM
I have a grid with a master - detail relationship;
     Master is company information    
     Detail is facility Information

I can edit the Company informaiton in a popup form and I can edit Plant information in a popup form, except when there are multiple detail records.

When there are multiple detail records the edit command may or may not fire. It is sporadic and I cannont find the reason why.
I have included 2 images; The first iamge both edit buttons work flawless, the second image the 'edit comapnay' button works fine but neither 'edit plant' buttons fire the itemcommand event.

Here is my code: (no Code behind used)
 
<form id="form1" runat="server">
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server" CdnSettings-TelerikCdn="Enabled">
   <Scripts>
     <%--Needed for JavaScript IntelliSense in VS2010--%>
     <%--For VS2008 replace RadScriptManager with ScriptManager--%>
     <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
     <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
     <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
   </Scripts>
 </telerik:RadScriptManager>
 <script type="text/javascript">
   var popUp;
   function PopUpShowing(sender, eventArgs) {
     popUp = eventArgs.get_popUp();
     var gridWidth = sender.get_element().offsetWidth;
     var gridHeight = sender.get_element().offsetHeight;
     var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
     var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
     popUp.style.left = ((gridWidth - popUpWidth) / 2 + sender.get_element().offsetLeft).toString() + "px";
   }
 
 </script>
  
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
   <AjaxSettings>
     <telerik:AjaxSetting AjaxControlID="Panel1">
       <UpdatedControls>
         <telerik:AjaxUpdatedControl ControlID="Panel1" />
       </UpdatedControls>
     </telerik:AjaxSetting>
   </AjaxSettings>
 </telerik:RadAjaxManager>
 <div>
   <br />
   Not dolled up yet to fit into the site but here is the preliminary edit form for
   companies to update thier information.<br />
   <a href="Default.aspx">Select another company</a>
   <br />
   <span class="style1"><strong>CAUTION: This data is LIVE!! </strong></span>
   <asp:Panel ID="Panel1" runat="server">
     <p id="divMsgs" runat="server">
       <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080"></asp:Label>
       <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000"></asp:Label>
     </p>
     <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticUpdates="True" AutoGenerateColumns="False"
       CellSpacing="0" DataSourceID="SqlDataSource1" GridLines="None" Skin="Vista" Culture="en-ZW"
       EnableEmbeddedBaseStylesheet="False" EnableTheming="False" BorderStyle="None">
       <MasterTableView DataKeyNames="CompanyID" DataSourceID="SqlDataSource1" CommandItemDisplay="None"
         AllowAutomaticUpdates="true" ShowHeader="False" HierarchyDefaultExpanded="true"
         EditMode="PopUp">
         <DetailTables>
           <telerik:GridTableView runat="server" DataKeyNames="FacilityID" DataSourceID="SqlDataSource2"
             ShowHeader="False" AllowAutomaticUpdates="true" EditMode="PopUp">
             <ParentTableRelation>
               <telerik:GridRelationFields DetailKeyField="CompanyID" MasterKeyField="CompanyID" />
             </ParentTableRelation>
             <Columns>
               <telerik:GridBoundColumn DataField="FacilityID" DataType="System.Int32" ReadOnly="True"
                 UniqueName="FacilityID" Visible="false">
               </telerik:GridBoundColumn>
               <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                 <ItemTemplate>
                   <div id="content" class="divTable">
                     <div id="divHeader" class="divHeaderTable">
                       Facility information for
                       <asp:Label ID="Name" runat="server" Text=' <%# Eval("FacilityName") %>'></asp:Label>
                     </div>
                     <div class="divRow">
                       <div class="divColumn" style="text-align: left; width: 300px;">
                         <div>
                           <asp:Label ID="Address1" runat="server" Text='<%# Eval("Address") %>'></asp:Label><br />
                           <asp:Label ID="Label5" runat="server" Text='<%# Eval("City") %>'></asp:Label>, 
                           <asp:Label ID="Label6" runat="server" Text='<%# Eval("State") %>'></asp:Label
                           <asp:Label ID="Label7" runat="server" Text='<%# Eval("Zip") %>'></asp:Label><br />
                           <strong>PH:</strong>
                           <asp:Label ID="Label15" runat="server" Text='<%# Eval("Phone") %>'></asp:Label><br />
                           <asp:Label ID="Label17" runat="server" Text='<%# Eval("Website") %>'></asp:Label><br />
                           <br />
                           <br />
                           <telerik:RadButton ID="RadButton2d" runat="server" Text="Edit this plant's Information"
                             CommandName="Edit">
                           </telerik:RadButton>
                         </div>
                       </div>
                       <div class="divColumn" style="text-align: left; width: 400px;">
                         <div>
                           <strong>Contact: </strong>
                           <asp:Label ID="Label16" runat="server" Text='<%# Eval("Contact_First") %>'></asp:Label
                           <asp:Label ID="Label30" runat="server" Text='<%# Eval("Contact_Last") %>'></asp:Label><br />
                           <strong>Contact Email: </strong><asp:Label ID="Label18" runat="server" Text='<%# Eval("Email") %>'></asp:Label><br />
                           <strong>Capacity: </strong><asp:Label ID="Label31" runat="server" Text='<%# Format(Eval("NamePlateCapacity"),"##,###,###,###") %>'></asp:Label>
                           <asp:Label ID="Label33" runat="server" Text='<%# IIF(eval("CapacityInfoPublic"),"(Capacity info is Public)","(Capacity info is not Public)") %>'></asp:Label><br />
                           <strong>Feedstock</strong> <asp:Label ID="Label32" runat="server" Text='<%#Eval("Feedstock") %>'>
                           </asp:Label>
                           <asp:Label ID="Label3a4" runat="server" Text='<%# IIF(eval("CapacityInfoPublic"),"(Feedstock info is Public)","(Feedstock info is not Public)") %>'></asp:Label>
                           <br />
                           <br />
                         </div>
                       </div>
                     </div>
                   </div>
                   </div>
                 </ItemTemplate>
               </telerik:GridTemplateColumn>
             </Columns>
             <EditFormSettings EditFormType="Template" FormTableStyle-Width="400px">
               <EditColumn FilterControlAltText="Filter EditCommandColumn column">
               </EditColumn>
               <FormTableStyle Width="400px" />
               <FormTemplate>
                 <div id="content" class="divTable">
                   <div id="divHeader" class="divHeaderTable">
                     <asp:Label ID="lblName" runat="server" Text='<%# Bind("FacilityName") %>'></asp:Label>
                   </div>
                   <div class="divRow">
                     <div class="divColumn" style="text-align: left; width: 400px;">
                       <div>
                         Address:<br />
                         <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Address") %>'
                           Width=" 225px">
                         </telerik:RadTextBox>
                         <br />
                         City:<br />
                         <telerik:RadTextBox ID="RadTextBox4" runat="server" Text='<%# Bind("City") %>' Width=" 225px">
                         </telerik:RadTextBox>
                         <br />
                         State:<br />
                         <telerik:RadComboBox ID="State" runat="server" SelectedValue='<%# bind("State") %>'
                           Skin="Windows7">
                           <Items>
                             <telerik:RadComboBoxItem runat="server" Text="Alabama" Value="AL" />
                             <telerik:RadComboBoxItem runat="server" Text="Alaska" Value="AK" />
                             <telerik:RadComboBoxItem runat="server" Text="Arizona" Value="AZ" />
                             <telerik:RadComboBoxItem runat="server" Text="Arkansas" Value="AR" />
                             <telerik:RadComboBoxItem runat="server" Text="California" Value="CA" />
                             <telerik:RadComboBoxItem runat="server" Text="Colorado" Value="CO" />
                             <telerik:RadComboBoxItem runat="server" Text="Connecticut" Value="CT" />
                             <telerik:RadComboBoxItem runat="server" Text="District of Columbia" Value="DC" />
                             <telerik:RadComboBoxItem runat="server" Text="Delaware" Value="DE" />
                             <telerik:RadComboBoxItem runat="server" Text="Florida" Value="FL" />
                             <telerik:RadComboBoxItem runat="server" Text="Georgia" Value="GA" />
                             <telerik:RadComboBoxItem runat="server" Text="Hawaii" Value="HI" />
                             <telerik:RadComboBoxItem runat="server" Text="Idaho" Value="ID" />
                             <telerik:RadComboBoxItem runat="server" Text="Illinois" Value="IL" />
                             <telerik:RadComboBoxItem runat="server" Text="Indiana" Value="IN" />
                             <telerik:RadComboBoxItem runat="server" Text="Iowa" Value="IA" />
                             <telerik:RadComboBoxItem runat="server" Text="Kansas" Value="KS" />
                             <telerik:RadComboBoxItem runat="server" Text="Kentucky" Value="KY" />
                             <telerik:RadComboBoxItem runat="server" Text="Louisiana" Value="LA" />
                             <telerik:RadComboBoxItem runat="server" Text="Maine" Value="ME" />
                             <telerik:RadComboBoxItem runat="server" Text="Maryland" Value="MD" />
                             <telerik:RadComboBoxItem runat="server" Text="Massachusetts" Value="MA" />
                             <telerik:RadComboBoxItem runat="server" Text="Michigan" Value="MI" />
                             <telerik:RadComboBoxItem runat="server" Text="Minnesota" Value="MN" />
                             <telerik:RadComboBoxItem runat="server" Text="Mississippi" Value="MS" />
                             <telerik:RadComboBoxItem runat="server" Text="Missouri" Value="MO" />
                             <telerik:RadComboBoxItem runat="server" Text="Montana" Value="MT" />
                             <telerik:RadComboBoxItem runat="server" Text="Nebraska" Value="NE" />
                             <telerik:RadComboBoxItem runat="server" Text="Nevada" Value="NV" />
                             <telerik:RadComboBoxItem runat="server" Text="New Hampshire" Value="NH" />
                             <telerik:RadComboBoxItem runat="server" Text="New Jersey" Value="NJ" />
                             <telerik:RadComboBoxItem runat="server" Text="New Mexico" Value="NM" />
                             <telerik:RadComboBoxItem runat="server" Text="New York" Value="NY" />
                             <telerik:RadComboBoxItem runat="server" Text="North Carolina" Value="NC" />
                             <telerik:RadComboBoxItem runat="server" Text="North Dakota" Value="ND" />
                             <telerik:RadComboBoxItem runat="server" Text="Ohio" Value="OH" />
                             <telerik:RadComboBoxItem runat="server" Text="Oklahoma" Value="OK" />
                             <telerik:RadComboBoxItem runat="server" Text="Oregon" Value="OR" />
                             <telerik:RadComboBoxItem runat="server" Text="Pennsylvania" Value="PA" />
                             <telerik:RadComboBoxItem runat="server" Text="Rhode Island" Value="RI" />
                             <telerik:RadComboBoxItem runat="server" Text="South Carolina" Value="SC" />
                             <telerik:RadComboBoxItem runat="server" Text="South Dakota" Value="SD" />
                             <telerik:RadComboBoxItem runat="server" Text="Tennessee" Value="TN" />
                             <telerik:RadComboBoxItem runat="server" Text="Texas" Value="TX" />
                             <telerik:RadComboBoxItem runat="server" Text="Utah" Value="UT" />
                             <telerik:RadComboBoxItem runat="server" Text="Vermont" Value="VT" />
                             <telerik:RadComboBoxItem runat="server" Text="Virginia" Value="VA" />
                             <telerik:RadComboBoxItem runat="server" Text="Washington" Value="WA" />
                             <telerik:RadComboBoxItem runat="server" Text="West Virginia" Value="WV" />
                             <telerik:RadComboBoxItem runat="server" Text="Wisconsin" Value="WI" />
                             <telerik:RadComboBoxItem runat="server" Text="Wyoming" Value="WY" />
                           </Items>
                         </telerik:RadComboBox>
                         <br />
                         Zip:<br />
                         <telerik:RadTextBox ID="RadTextBox2" runat="server" Text='<%# Bind("Zip") %>' Width=" 75px">
                         </telerik:RadTextBox>
                         <br />
                         Phone:<br />
                         <telerik:RadTextBox ID="RadTextBox5" runat="server" Text='<%# Bind("Phone") %>' Width=" 125px">
                         </telerik:RadTextBox>
                         <br />
                         Website:<br />
                         <telerik:RadTextBox ID="RadTextBox7" runat="server" Text='<%# Bind("Website") %>'
                           Width=" 225px">
                         </telerik:RadTextBox>
                         <br />
                         Contact Email:<br />
                         <telerik:RadTextBox ID="RadTextBox9" runat="server" Text='<%# Bind("Email") %>' Width=" 225px">
                         </telerik:RadTextBox>
                       </div>
                     </div>
                     <div class="divColumn" style="text-align: left; width: 400px;">
                       <div>
                         Current Plant Status:<br />
                         <telerik:RadComboBox ID="RadComboBox1" runat="server" SelectedValue='<%# bind("Status") %>'
                           Skin="Windows7">
                           <Items>
                             <telerik:RadComboBoxItem runat="server" Text="Active" Value="Active" />
                             <telerik:RadComboBoxItem runat="server" Text="Idled" Value="Idled" />
                             <telerik:RadComboBoxItem runat="server" Text="Closed" Value="Closed" />
                             <telerik:RadComboBoxItem runat="server" Text="Sold" Value="Sold" />
                           </Items>
                         </telerik:RadComboBox>
                         <br />
                         Name Plate Capacity:<br />
                         <telerik:RadNumericTextBox ID="RadTextBox8" runat="server" Text='<%# bind("NamePlateCapacity") %>'
                           NumberFormat-DecimalDigits="0">
                         </telerik:RadNumericTextBox>
                         <br />
                         <asp:CheckBox ID="cbCapacity" runat="server" Checked='<%# Bind("CapacityInfoPublic") %>' />
                         Check to make Capacity info public.
                         <br />
                         Feedstock:<br />
                         <telerik:RadTextBox ID="RadTextBox10" runat="server" Text='<%#Bind("Feedstock" )%>'>
                         </telerik:RadTextBox>
                         <br />
                         <asp:CheckBox ID="cbFeedstock" runat="server" Checked='<%# Bind("FeedstockInfoPublic") %>' />
                         Check to make Feedstock info public.
                       </div>
                     </div>
                   </div>
                 </div>
                 <telerik:RadButton ID="RadButton1" runat="server" CommandName="Update" Text="Save Changes">
                 </telerik:RadButton>
                 <telerik:RadButton ID="RadButton2" runat="server" CommandName="Cancel" Text="Cancel Changes">
                 </telerik:RadButton>
               </FormTemplate>
             </EditFormSettings>
           </telerik:GridTableView>
         </DetailTables>
         <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False"
           ShowExportToPdfButton="True" />
         <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
         </RowIndicatorColumn>
         <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="False">
         </ExpandCollapseColumn>
         <Columns>
           <telerik:GridBoundColumn DataField="CompanyID" DataType="System.Guid" FilterControlAltText="Filter CompanyID column"
             HeaderText="CompanyID" ReadOnly="True" SortExpression="CompanyID" UniqueName="CompanyID"
             Visible="false">
           </telerik:GridBoundColumn>
           <telerik:GridTemplateColumn DataField="Address1" FilterControlAltText="Filter Address1 column"
             HeaderText="Address1" SortExpression="Address1" UniqueName="Address1">
             <ItemTemplate>
               <div id="content" class="divTable">
                 <div id="divHeader" class="divHeaderTable">
                   <asp:Label ID="MlblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                 </div>
                 <div class="divRow">
                   <div class="divColumn" style="text-align: left;">
                     <div>
                       <strong>Company Information:</strong><br />
                       <asp:Label ID="Address1" runat="server" Text='<%# Eval("Address1") %>'></asp:Label><br />
                       <%# IfAddress2(Eval("Address2"))%>
                       <asp:Label ID="Label5" runat="server" Text='<%# Eval("City") %>'></asp:Label>, 
                       <asp:Label ID="Label6" runat="server" Text='<%# Eval("State") %>'></asp:Label
                       <asp:Label ID="Label7" runat="server" Text='<%# Eval("PostalCode") %>'></asp:Label><br />
                       <strong>PH:</strong>
                       <asp:Label ID="Label15" runat="server" Text='<%# Eval("Phone") %>'></asp:Label>
                          <strong>FX:</strong>
                       <asp:Label ID="Label16" runat="server" Text='<%# Eval("Fax") %>'></asp:Label><br />
                       <asp:Label ID="Label17" runat="server" Text='<%# Eval("Website") %>'></asp:Label>
                       <br />
                       <strong>Contact Email: </strong><asp:Label ID="Label18" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                       <br />
                       <br />
                       <telerik:RadButton ID="RadButton2" runat="server" Text="Edit Your Company Information"
                         CommandName="Edit">
                       </telerik:RadButton>
                     </div>
                   </div>
                   <div class="divColumn">
                     <div>
                       <strong>Primary Information:</strong><br />
                       <asp:Label ID="Label10" runat="server" Text='<%# Eval("Salutation") %>'></asp:Label
                       <asp:Label ID="Label12" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label
                       <asp:Label ID="Label13" runat="server" Text='<%# Eval("LastName") %>'></asp:Label><br />
                       <asp:Label ID="Label14" runat="server" Text='<%# Eval("Title") %>'></asp:Label><br />
                       <asp:Label ID="Label3" runat="server" Text='<%# Eval("Pri_Address") %>'></asp:Label><br />
                       <asp:Label ID="Label4" runat="server" Text='<%# Eval("Pri_City") %>'></asp:Label>, 
                       <asp:Label ID="Label8" runat="server" Text='<%# Eval("Pri_State") %>'></asp:Label
                       <asp:Label ID="Label9" runat="server" Text='<%# Eval("Pri_Zip") %>'></asp:Label><br />
                       <asp:Label ID="Label11" runat="server" Text='<%# Eval("Pri_Phone") %>'></asp:Label><br />
                       <asp:Label ID="Label19" runat="server" Text='<%# Eval("Pri_Email") %>'></asp:Label><br />
                       <em>You must contact NBB to change Primary Information</em>
                     </div>
                   </div>
                   <div class="divColumn">
                     <div>
                       <strong>Alternate Information:</strong><br />
                       <asp:Label ID="Label20" runat="server" Text='<%# Eval("Alt_Salutation") %>'></asp:Label
                       <asp:Label ID="Label21" runat="server" Text='<%# Eval("Alt_First_Name") %>'></asp:Label
                       <asp:Label ID="Label22" runat="server" Text='<%# Eval("Alt_Last_Name") %>'></asp:Label><br />
                       <asp:Label ID="Label23" runat="server" Text='<%# Eval("Alt_Title") %>'></asp:Label><br />
                       <asp:Label ID="Label24" runat="server" Text='<%# Eval("Alt_Address") %>'></asp:Label><br />
                       <asp:Label ID="Label25" runat="server" Text='<%# Eval("Alt_City") %>'></asp:Label>, 
                       <asp:Label ID="Label26" runat="server" Text='<%# Eval("Alt_State") %>'></asp:Label
                       <asp:Label ID="Label27" runat="server" Text='<%# Eval("Alt_Zip") %>'></asp:Label><br />
                       <asp:Label ID="Label28" runat="server" Text='<%# Eval("Alt_Phone") %>'></asp:Label><br />
                       <asp:Label ID="Label29" runat="server" Text='<%# Eval("Alt_Email") %>'></asp:Label><br />
                       <em>You must contact NBB to change Alternate Information</em>
                     </div>
                   </div>
                 </div>
               </div>
               </div>
             </ItemTemplate>
           </telerik:GridTemplateColumn>
         </Columns>
         <EditFormSettings EditFormType="Template" EditColumn-Display="False">
           <EditColumn Display="False" FilterControlAltText="Filter EditCommandColumn column">
           </EditColumn>
           <FormTemplate>
             <div id="content" class="divTable">
               <div id="divHeader" class="divHeaderTable">
                 <asp:Label ID="Name" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
               </div>
               <div class="divRow">
                 <div class="divColumn" style="text-align: left;">
                   <div>
                     Address:<br />
                     <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Address1") %>'
                       Width=" 325px">
                     </telerik:RadTextBox>
                     Address:<br />
                     <telerik:RadTextBox ID="RadTextBox3" runat="server" Text='<%# Bind("Address2") %>'
                       Width=" 325px">
                     </telerik:RadTextBox>
                     Phone:
                     <telerik:RadTextBox ID="RadTextBox5" runat="server" Text='<%# Bind("Phone") %>' Width=" 125px">
                     </telerik:RadTextBox>
                       Fax: <br />
                     <telerik:RadTextBox ID="RadTextBox6" runat="server" Text='<%# Bind("Fax") %>' Width=" 125px">
                     </telerik:RadTextBox>
                     City:
                     <telerik:RadTextBox ID="RadTextBox4" runat="server" Text='<%# Bind("City") %>' Width=" 325px">
                     </telerik:RadTextBox>
                     State:
                     <telerik:RadComboBox ID="State" runat="server" SelectedValue='<%# bind("State")  %>'
                       Skin="Windows7">
                       <Items>
                         <telerik:RadComboBoxItem runat="server" Text="Alabama" Value="AL" />
                         <telerik:RadComboBoxItem runat="server" Text="Alaska" Value="AK" />
                         <telerik:RadComboBoxItem runat="server" Text="Arizona" Value="AZ" />
                         <telerik:RadComboBoxItem runat="server" Text="Arkansas" Value="AR" />
                         <telerik:RadComboBoxItem runat="server" Text="California" Value="CA" />
                         <telerik:RadComboBoxItem runat="server" Text="Colorado" Value="CO" />
                         <telerik:RadComboBoxItem runat="server" Text="Connecticut" Value="CT" />
                         <telerik:RadComboBoxItem runat="server" Text="District of Columbia" Value="DC" />
                         <telerik:RadComboBoxItem runat="server" Text="Delaware" Value="DE" />
                         <telerik:RadComboBoxItem runat="server" Text="Florida" Value="FL" />
                         <telerik:RadComboBoxItem runat="server" Text="Georgia" Value="GA" />
                         <telerik:RadComboBoxItem runat="server" Text="Hawaii" Value="HI" />
                         <telerik:RadComboBoxItem runat="server" Text="Idaho" Value="ID" />
                         <telerik:RadComboBoxItem runat="server" Text="Illinois" Value="IL" />
                         <telerik:RadComboBoxItem runat="server" Text="Indiana" Value="IN" />
                         <telerik:RadComboBoxItem runat="server" Text="Iowa" Value="IA" />
                         <telerik:RadComboBoxItem runat="server" Text="Kansas" Value="KS" />
                         <telerik:RadComboBoxItem runat="server" Text="Kentucky" Value="KY" />
                         <telerik:RadComboBoxItem runat="server" Text="Louisiana" Value="LA" />
                         <telerik:RadComboBoxItem runat="server" Text="Maine" Value="ME" />
                         <telerik:RadComboBoxItem runat="server" Text="Maryland" Value="MD" />
                         <telerik:RadComboBoxItem runat="server" Text="Massachusetts" Value="MA" />
                         <telerik:RadComboBoxItem runat="server" Text="Michigan" Value="MI" />
                         <telerik:RadComboBoxItem runat="server" Text="Minnesota" Value="MN" />
                         <telerik:RadComboBoxItem runat="server" Text="Mississippi" Value="MS" />
                         <telerik:RadComboBoxItem runat="server" Text="Missouri" Value="MO" />
                         <telerik:RadComboBoxItem runat="server" Text="Montana" Value="MT" />
                         <telerik:RadComboBoxItem runat="server" Text="Nebraska" Value="NE" />
                         <telerik:RadComboBoxItem runat="server" Text="Nevada" Value="NV" />
                         <telerik:RadComboBoxItem runat="server" Text="New Hampshire" Value="NH" />
                         <telerik:RadComboBoxItem runat="server" Text="New Jersey" Value="NJ" />
                         <telerik:RadComboBoxItem runat="server" Text="New Mexico" Value="NM" />
                         <telerik:RadComboBoxItem runat="server" Text="New York" Value="NY" />
                         <telerik:RadComboBoxItem runat="server" Text="North Carolina" Value="NC" />
                         <telerik:RadComboBoxItem runat="server" Text="North Dakota" Value="ND" />
                         <telerik:RadComboBoxItem runat="server" Text="Ohio" Value="OH" />
                         <telerik:RadComboBoxItem runat="server" Text="Oklahoma" Value="OK" />
                         <telerik:RadComboBoxItem runat="server" Text="Oregon" Value="OR" />
                         <telerik:RadComboBoxItem runat="server" Text="Pennsylvania" Value="PA" />
                         <telerik:RadComboBoxItem runat="server" Text="Rhode Island" Value="RI" />
                         <telerik:RadComboBoxItem runat="server" Text="South Carolina" Value="SC" />
                         <telerik:RadComboBoxItem runat="server" Text="South Dakota" Value="SD" />
                         <telerik:RadComboBoxItem runat="server" Text="Tennessee" Value="TN" />
                         <telerik:RadComboBoxItem runat="server" Text="Texas" Value="TX" />
                         <telerik:RadComboBoxItem runat="server" Text="Utah" Value="UT" />
                         <telerik:RadComboBoxItem runat="server" Text="Vermont" Value="VT" />
                         <telerik:RadComboBoxItem runat="server" Text="Virginia" Value="VA" />
                         <telerik:RadComboBoxItem runat="server" Text="Washington" Value="WA" />
                         <telerik:RadComboBoxItem runat="server" Text="West Virginia" Value="WV" />
                         <telerik:RadComboBoxItem runat="server" Text="Wisconsin" Value="WI" />
                         <telerik:RadComboBoxItem runat="server" Text="Wyoming" Value="WY" />
                       </Items>
                     </telerik:RadComboBox>
                     <br />
                     Zip:<br />
                     <telerik:RadTextBox ID="RadTextBox2" runat="server" Text='<%# Bind("PostalCode") %>'
                       Width=" 75px">
                     </telerik:RadTextBox><br />
                     Website:
                     <telerik:RadTextBox ID="RadTextBox7" runat="server" Text='<%# Bind("Website") %>'
                       Width=" 325px">
                     </telerik:RadTextBox>
                     Contact Email:
                     <telerik:RadTextBox ID="RadTextBox9" runat="server" Text='<%# Bind("Email") %>' Width=" 325px">
                     </telerik:RadTextBox>
                   </div>
                 </div>
               </div>
             </div>
             </div>
             <telerik:RadButton ID="RadButton1" runat="server" CommandName="Update" Text="Save Changes">
             </telerik:RadButton>
             <telerik:RadButton ID="RadButton3" runat="server" CommandName="Cancel" Text="Cancel Changes">
             </telerik:RadButton>
           </FormTemplate>
         </EditFormSettings>
       </MasterTableView>
       <ClientSettings>
         <ClientEvents OnPopUpShowing="PopUpShowing" />
       </ClientSettings>
       <FilterMenu EnableEmbeddedBaseStylesheet="False" EnableImageSprites="False">
       </FilterMenu>
       <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Vista" EnableEmbeddedBaseStylesheet="False">
       </HeaderContextMenu>
     </telerik:RadGrid>
   </asp:Panel>
 </div>
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:nbbmembersConnectionString %>"
   SelectCommand="SELECT [Name], [Address1], ISNULL([Address2],' ') AS Address2, [City], [State], [PostalCode], [Phone], [Fax], [Website], [Email], [Salutation], [FirstName], [LastName], [Title], [Pri Address] AS Pri_Address, [Pri City] AS Pri_City, [Pri State] AS Pri_State, [Pri Zip] AS Pri_Zip, [Pri Phone] AS Pri_Phone, [Pri Email] AS Pri_Email, [Alt Salutation] AS Alt_Salutation, [Alt First Name] AS Alt_First_Name, [Alt Last Name] AS Alt_Last_Name, [Alt title] AS Alt_title, [Alt Address] AS Alt_Address, [Alt City] AS Alt_City, [Alt State] AS Alt_State, [Alt Zip] AS Alt_Zip, [Alt Phone] AS Alt_Phone, [Alt Email] AS Alt_Email, [CompanyID] FROM [COMP-PRI-ALT for export] WHERE ([CompanyID] = @CompanyID)"
   UpdateCommand="UPDATE [Company] SET [Name] = @Name, [Address1] = @Address1, [Address2] = @Address2, [City] = @City, [State] = @State, [Country] = @Country, [PostalCode] = @PostalCode, [Phone] = @Phone, [Fax] = @Fax, [Website] = @Website, [Email] = @Email, [Contact] = @Contact, [Descript] = @Descript WHERE [CompanyID] = @CompanyID"
   ProviderName="System.Data.SqlClient">
   <SelectParameters>
     <asp:SessionParameter Name="CompanyID" SessionField="CompanyID" Type="String" />
   </SelectParameters>
   <UpdateParameters>
     <asp:Parameter Name="Name" Type="String" />
     <asp:Parameter Name="Address1" Type="String" />
     <asp:Parameter Name="Address2" Type="String" />
     <asp:Parameter Name="City" Type="String" />
     <asp:Parameter Name="State" Type="String" />
     <asp:Parameter Name="Country" Type="String" />
     <asp:Parameter Name="PostalCode" Type="String" />
     <asp:Parameter Name="Phone" Type="String" />
     <asp:Parameter Name="Fax" Type="String" />
     <asp:Parameter Name="Website" Type="String" />
     <asp:Parameter Name="Email" Type="String" />
     <asp:Parameter Name="Contact" Type="String" />
     <asp:Parameter Name="Descript" Type="String" />
     <asp:Parameter Name="CompanyID" Type="Object" />
   </UpdateParameters>
 </asp:SqlDataSource>
 <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:nbbmembersConnectionString %>"
   SelectCommand="SELECT [FacilityID], [CompanyID], [Status], [FacilityName], [Address], [City], [State], [Zip], [Phone], [Contact_First], [Contact_Last], [Email], [NamePlateCapacity], [CapacityInfoPublic], [Feedstock], [FeedstockInfoPublic], [Website] FROM [facilities] WHERE ([CompanyID] = @CompanyID)"
   UpdateCommand="UPDATE [facilities] SET [Status] = @Status, [FacilityName] = @FacilityName, [Address] = @Address, [City] = @City, [State] = @State, [Zip] = @Zip, [Phone] = @Phone, [Contact_First] = @Contact_First, [Contact_Last] = @Contact_Last, [Email] = @Email, [NamePlateCapacity] = @NamePlateCapacity, [CapacityInfoPublic] = @CapacityInfoPublic, [Feedstock] = @Feedstock, [FeedstockInfoPublic] = @FeedstockInfoPublic, [Website] = @Website WHERE [FacilityID] = @FacilityID"
   ProviderName="System.Data.SqlClient">
    
   <SelectParameters>
     <asp:SessionParameter Name="CompanyID" SessionField="CompanyID" Type="String" />
   </SelectParameters>
   <UpdateParameters>
     <asp:Parameter Name="CompanyID" Type="String" />
     <asp:Parameter Name="Status" Type="String" />
     <asp:Parameter Name="FacilityName" Type="String" />
     <asp:Parameter Name="Address" Type="String" />
     <asp:Parameter Name="City" Type="String" />
     <asp:Parameter Name="State" Type="String" />
     <asp:Parameter Name="Zip" Type="String" />
     <asp:Parameter Name="Phone" Type="String" />
     <asp:Parameter Name="Contact_First" Type="String" />
     <asp:Parameter Name="Contact_Last" Type="String" />
     <asp:Parameter Name="Email" Type="String" />
     <asp:Parameter Name="NamePlateCapacity" Type="Double" />
     <asp:Parameter Name="CapacityInfoPublic" Type="Boolean" />
     <asp:Parameter Name="Feedstock" Type="String" />
     <asp:Parameter Name="FeedstockInfoPublic" Type="Boolean" />
     <asp:Parameter Name="Website" Type="String" />
     <asp:Parameter Name="FacilityID" Type="Int32" />
   </UpdateParameters>
 </asp:SqlDataSource>
 </form>

3 Answers, 1 is accepted

Sort by
0
Scott Tremain
Top achievements
Rank 1
answered on 24 Aug 2011, 04:23 PM
bump
0
Tsvetina
Telerik team
answered on 25 Aug 2011, 12:00 PM
Hello Scott,

I cannot point out a problem inside your code. Does it work with AJAX tuned off? Also, is there any code-behind related to the grid binding? Would it be possible strip your code as much as possible but still have it replicating the problem and paste the stipped version here, so we can use it to create a test page with it to track down the cause of this behavior?

Best wishes,
Tsvetina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Scott Tremain
Top achievements
Rank 1
answered on 25 Aug 2011, 02:50 PM
Tsvetina,

I found the problem. I have the Ajax manager set to manage at the panel level. So if just one control fails they all fail I guess.

The problem child was thid combobox
<telerik:RadComboBox ID="RadComboBox1" runat="server" SelectedValue='<%# bind("Status") %>'   Skin="Windows7">
     <Items>
      <telerik:RadComboBoxItem runat="server" Text="Active" Value="Active" />
      <telerik:RadComboBoxItem runat="server" Text="Idled" Value="Idled" />
      <telerik:RadComboBoxItem runat="server" Text="Closed" Value="Closed" />
      <telerik:RadComboBoxItem runat="server" Text="Sold" Value="Sold" />
    </Items>
</telerik:RadComboBox>
I was binding it to a datasource that had more items than I had coded into the Items collection. So when a record was bound that did not conatain one of the four items the itemcommand for the grid would not fire.

My solution was the following;
<telerik:RadComboBox ID="RadComboBox1" runat="server" SelectedValue='<%# bind("Status") %>' Skin="Windows7">
  <Items>
     <telerik:RadComboBoxItem runat="server" Text="Active" Value="Active" />
     <telerik:RadComboBoxItem runat="server" Text="Idled" Value="Idled" />
     <telerik:RadComboBoxItem runat="server" Text="Closed" Value="Closed" />
     <telerik:RadComboBoxItem runat="server" Text="Sold" Value="Sold" />
     <telerik:RadComboBoxItem runat="server" Text="Construction" Value="Construction" Enabled=False />
     <telerik:RadComboBoxItem runat="server" Text="Dead" Value="Dead" Enabled=False />
      <telerik:RadComboBoxItem runat="server" Text="Expansion" Value="Expansion" Enabled=False />
      <telerik:RadComboBoxItem runat="server" Text="Pre_Construction" Value="Pre-Construction" Enabled=False />
      <telerik:RadComboBoxItem runat="server" Text="Private Use" Value="Private Use" Enabled=False />
      <telerik:RadComboBoxItem runat="server" Text="Research" Value="Research" Enabled=False />
      <telerik:RadComboBoxItem runat="server" Text="Study" Value="Study" Enabled=False />
    </Items>
                         </telerik:RadComboBox>

That fixed the problem,
Thanks for your response
Tags
Grid
Asked by
Scott Tremain
Top achievements
Rank 1
Answers by
Scott Tremain
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or