title: infragistics webdatagrid inserting a row with hidden columns
body: <p>I am using an Infragistics data grid V11.2.  The grid only displays 1 column with 10 columns hidden.  I need to insert a row into the grid. The RowAdding element does not support Templates. So when I use this option it displays only 1 column.  I tried creating a table above the grid with the fields to add and a button to add that calls a javascript function.  When I have it in debug, the function is not called after clicking the button. Also, I don't know now this function can trigger the stored procedure to insert the data into the database.  </p>
  
  <p>This is the table I created to add a row:</p>
  
  <pre><code>&lt;table style="width: 875px; background-color:#F0F8FF; text-align:left;"&gt;
      &lt;tr&gt;
      &lt;td colspan="4" align="left" class="style1"&gt;
          &lt;b&gt;Add New Office:&lt;/b&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          Address Prefix:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtAddressPrefix" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          Address:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtAddress" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          Address Suffix:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtAddressSuffix" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          City:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtCity" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          City Mailing:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtCityMailing" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          State:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtState" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          Zip:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtZip" runat="server" Text="" ClientIDMode="Static" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          County ID:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:DropDownList ID="ddlCounty" runat="server"
              DataSourceID="SqlDataSource3" 
              DataValueField="ID"
              DataTextField="Name" ClientIDMode="Static"&gt;
          &lt;/asp:DropDownList&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          Lat:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtLat" runat="server" Text="" ClientIDMode="Static" /&gt;
          &lt;asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" MaskType="Number"
              TargetControlID="txtLat" Mask="99\.999999999" AcceptNegative="Left"&gt;
          &lt;/asp:MaskedEditExtender&gt;
      &lt;/td&gt;
      &lt;td&gt;
          Long:
      &lt;/td&gt;
      &lt;td&gt;
          &lt;asp:TextBox ID="txtLong" runat="server" Text="" ClientIDMode="Static" /&gt;
          &lt;asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server" MaskType="Number"
              TargetControlID="txtLong" Mask="99\.999999999" AcceptNegative="Left"&gt;
          &lt;/asp:MaskedEditExtender&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td colspan="4" align="left"&gt;  
           &lt;input type="button" onclick="addRow()" value="Add New Row" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This is the infragistics grid and the datasource:</p>
  
  <pre><code>    &lt;ig:WebHierarchicalDataGrid runat="server" height="600px" width="875px" ClientIDMode="Static" 
          AutoGenerateBands="False" AutoGenerateColumns="False" DataKeyFields="ID"          
          DataMember="SqlDataSource1_DefaultView" StyleSetName="Windows7" ID="wdgOffice"
          DataSourceID="WebHierarchicalDataSource1" Key="SqlDataSource1_DefaultView" 
          onrowadded="wdgOffice_RowAdded" onrowadding="wdgOffice_RowAdding"&gt;
          &lt;Columns&gt;
              &lt;ig:BoundDataField DataFieldName="ID" Key="ID" Hidden="true"&gt;
                  &lt;Header Text="ID" /&gt;
                  &lt;header text="ID" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="AddressPrefix" Key="AddressPrefix" Hidden="true"&gt;
                  &lt;Header Text="AddressPrefix" /&gt;
                  &lt;header text="AddressPrefix" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="Address" Key="Address" Hidden="true"&gt;
                  &lt;Header Text="Address" /&gt;
                  &lt;header text="Address" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="AddressSuffix" Key="AddressSuffix" Hidden="true"&gt;
                  &lt;Header Text="AddressSuffix" /&gt;
                  &lt;header text="AddressSuffix" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="City" Key="City" Hidden="true"&gt;
                  &lt;Header Text="City" /&gt;
                  &lt;header text="City" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="CityMailing" Key="CityMailing" Hidden="true"&gt;
                  &lt;Header Text="CityMailing" /&gt;
                  &lt;header text="CityMailing" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="State" Key="State" Hidden="true"&gt;
                  &lt;Header Text="State" /&gt;
                  &lt;header text="State" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="Zip" Key="Zip" Hidden="true"&gt;
                  &lt;Header Text="Zip" /&gt;
                  &lt;header text="Zip" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="CountyName" Key="CountyID" Hidden="true"&gt;
                  &lt;Header Text="CountyID" /&gt;
                  &lt;header text="CountyID" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="Lat" Key="Lat" Hidden="true"&gt;
                  &lt;Header Text="Lat" /&gt;
                  &lt;header text="Lat" /&gt;
              &lt;/ig:BoundDataField&gt;            
              &lt;ig:BoundDataField DataFieldName="Long" Key="Long" Hidden="true"&gt;
                  &lt;Header Text="Long" /&gt;
                  &lt;header text="Long" /&gt;
              &lt;/ig:BoundDataField&gt;
              &lt;ig:BoundDataField DataFieldName="Name" Key="Name" Width="95%"&gt;
                  &lt;Header Text="Name" /&gt;
                  &lt;header text="Name" /&gt;
              &lt;/ig:BoundDataField&gt;    
          &lt;/Columns&gt;   
      &lt;/ig:WebHierarchicalDataGrid&gt;
  &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  &lt;ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server"&gt;
      &lt;DataViews&gt;
          &lt;ig:DataView ID="SqlDataSource1_DefaultView" DataMember="DefaultView" 
              DataSourceID="SqlDataSource1" /&gt;           
      &lt;/DataViews&gt;       
  &lt;/ig:WebHierarchicalDataSource&gt;
   &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:CAP06 %&gt;" 
      SelectCommand="phyadmGetOffices2" SelectCommandType="StoredProcedure"     
      InsertCommand="phyadmInsOffices" InsertCommandType="StoredProcedure"&gt;              
      &lt;InsertParameters&gt;
          &lt;asp:Parameter Name="ID" Type="Int32" /&gt;
          &lt;asp:Parameter Name="AddressPrefix" Type="String" /&gt;
          &lt;asp:Parameter Name="Address" Type="String" /&gt;      
          &lt;asp:Parameter Name="AddressSuffix" Type="String" /&gt;
          &lt;asp:Parameter Name="City" Type="String" /&gt;
          &lt;asp:Parameter Name="CityMailing" Type="String" /&gt;
          &lt;asp:Parameter Name="State" Type="String" /&gt;
          &lt;asp:Parameter Name="Zip" Type="String" /&gt;
          &lt;asp:ControlParameter Name="CountyID" ControlID="ddlCounty" Type="Int32" PropertyName="SelectedValue" /&gt;
          &lt;asp:Parameter Name="Lat" Type="Decimal" /&gt;
          &lt;asp:Parameter Name="Long" Type="Decimal" /&gt;    
      &lt;/InsertParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  &lt;asp:SqlDataSource ID="SqlDataSource3" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:CAP06 %&gt;"
      SelectCommand="phyadmGetCounty2" SelectCommandType="StoredProcedure"&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>I have also tried using the RowAdding behavior by adding:</p>
  
  <pre><code>&lt;ig:RowAdding&gt;
      &lt;AddNewRowClientEvents EnteringEditMode="WebDataGrid1_RowAdding_EnteringEditMode" /&gt;
  &lt;/ig:RowAdding&gt;
  </code></pre>
  
  <p>This did not work either. It added an insertion row. (blank row with a +). When the user clicked the blank row, the method WebDataGrid1_RowAdding_EnteringEditMode was called.  But I need to add 10 fields to the row. THis was not intuitive.</p>
  
  <p>If anyone has any other approaches to how I can insert a row into the database and update the grid, I would greatly appreciate it.</p>
  
  <p>THanks.</p>