title: Passing the value of a readonly radgrid column to a stored procedure
body: <p>I have a radgrid bound to a SqlDataSource that includes a hidden, readonly column that stores a pk.  I want to pass the value bound to that column to a stored procedure for Updates but the default behavior when the column is readonly is not to pass the parameter to the sqlDataSource.  My question is whether there is a way to pass that value without having to go into the code behind.  Here is a snippet of my asp markup.</p>
  
  <pre><code>&lt;telerik:RadGrid ID="rgEmployees" runat="server" AutoGenerateColumns="False" 
          DataSourceID="sdsEmployees" GridLines="None" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"&gt;
          &lt;MasterTableView DataSourceID="sdsEmployees" EditMode="EditForms"&gt;
              &lt;Columns&gt;
                  &lt;telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="20px"
                      UniqueName="Edit" HeaderText="Edit"&gt;
                      &lt;HeaderStyle Width="10px"&gt;&lt;/HeaderStyle&gt;
                      &lt;ItemStyle HorizontalAlign="Center" Width="10px" /&gt;                        
                  &lt;/telerik:GridEditCommandColumn&gt;
                  &lt;telerik:GridBoundColumn DataField="pkWorkerID" HeaderText="pkWorkerID" UniqueName="pkWorkerID" SortExpression="pkWorkerID" Visible="false" ReadOnly="true"&gt;&lt;/telerik:GridBoundColumn&gt;
                  &lt;telerik:GridBoundColumn DataField="ContractManagerName" HeaderText="ContractManager Name" UniqueName="ContractManagerName" SortExpression="ContractManagerName" Visible="true" ReadOnly="true"&gt;&lt;/telerik:GridBoundColumn&gt;
                  &lt;telerik:GridDropDownColumn 
                      DataField="CODE" 
                      HeaderText="Financial Software Name" 
                      DataSourceID="sdsFinancialSystemGetUnassignedWorkers" 
                      ListTextField="NAME" 
                      ListValueField="CODE" 
                      EnableEmptyListItem="true"
                      DropDownControlType="RadComboBox"&gt;                                            
                   &lt;/telerik:GridDropDownColumn&gt;                     
              &lt;/Columns&gt;
          &lt;/MasterTableView&gt;
      &lt;/telerik:RadGrid&gt;
  &lt;asp:SqlDataSource ID="sdsEmployees" runat="server"
              ConnectionString="" ProviderName="System.Data.SqlClient" 
              SelectCommand="spFinancialSystemGetWorkerMappingDataSource" SelectCommandType="StoredProcedure" 
              UpdateCommand="spFinancialSystemMapWorkerToCode" UpdateCommandType="StoredProcedure" 
              DeleteCommand="spFinancialSystemRemoveWorkerMapping" DeleteCommandType="StoredProcedure"&gt;
              &lt;SelectParameters&gt;
                  &lt;asp:ControlParameter ControlID="hfpkSystemSupportedFinancialSoftware" Name="pkSystemSupportedFinancialSystems"
                      Type="Int32" /&gt;
              &lt;/SelectParameters&gt;
              &lt;UpdateParameters&gt;
                  &lt;asp:ControlParameter ControlID="hfpkSystemSupportedFinancialSoftware" Name="pkSystemSupportedFinancialSystems"
                      Type="Int32" PropertyName="Value" /&gt;
                  &lt;asp:Parameter Name="pkWorkerID" Type="Int32" /&gt;
                  &lt;asp:Parameter Name="CODE" Type="String" /&gt;    
              &lt;/UpdateParameters&gt;
              &lt;DeleteParameters&gt;
                  &lt;asp:ControlParameter ControlID="hfpkSystemSupportedFinancialSoftware" Name="pkSystemSupportedFinancialSystems"
                      Type="Int32" PropertyName="Value" /&gt;
                  &lt;asp:Parameter Name="pkWorkerID" Type="Int32" /&gt;                    
              &lt;/DeleteParameters&gt;
          &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>The stored procedure prototype looks like this:</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[spFinancialSystemMapWorkerToCode] 
  @pkWorkerID int,
  @pkSystemSupportedFinancialSystems int,
  @CODE nvarchar(200)
  </code></pre>
  
  <p>When I run the page and try to edit a record I get the following error:</p>
  
  <p>Procedure or function 'spFinancialSystemMapWorkerToCode' expects parameter '@pkWorkerID', which was not supplied.</p>
  
  <p>If I set readonly="false" on the  It works fine but then the user can edit the primary key value which is not desired.  I know work arounds in code behind but is there any way to do it straight in the markup?  Thanks.</p>