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

Template column value is NULL when Insert using Bulk Edit at ClientSide

2 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 06 Apr 2020, 07:26 PM

Hello,

 

I am using RadGrid for Bulk Update at Client Side.

I have a Dropdown in the Template column and inspite of me selecting an item by the time in click "Save changes" the value of that column is going as NULL in the Insert.

I have similar Template columns with RadDropdown and RadCombobox.... they all work fine. There is very minimal server side code to adjust the width of the columns.

In the attached file issue template column is "Specialcategory_FundingID"

 

Kindly post your suggestions.

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 06 Apr 2020, 07:31 PM
<%@ Assembly Name="EDC.WebParts.Budget, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cae4dea92b34186f" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LineItemFormAddUserControl.ascx.cs" Inherits="EDC.WebParts.Budget.Registration.LineItemFormAdd.LineItemFormAddUserControl" %>
<%@ Register assembly="Telerik.Web.UI, Version=2018.1.117.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>


<%--<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function lnkAddNew_Click() {
            alert('IN');
            var oGrid = $find("<%=rgRegEntity.ClientID%>");
            var oMasterTableView = oGrid.get_masterTableView();
            oMasterTableView.insertItem();
        }
    </script>
</telerik:RadCodeBlock>--%>

<asp:Panel runat="server" ID="divError" Visible="false" CssClass="error-Style" Width="50%">
    <asp:Label runat="server" ID="lblError" />
</asp:Panel>
<telerik:RadFormDecorator ID="FormDecorator1" runat="server" />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" RenderMode="Inline">
    <asp:Panel runat="server" ID="pnlLineItemFormAdd" >    
       
        <asp:Label Text="[Note: Click button 'Save Changes' to save your changes.]" runat="server" Font-Bold=""></asp:Label>
        <br />
        <br />
        <table cellpadding="4" cellspacing="2"  border="1" width="100%" style="table-layout:fixed" class="detail-SubTable" >
            <tr>
                <td class="grid-Title-Area">
                    <span class="grid-Title">REGISTRATION LINE ITEMS</span>                   
               </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadGrid ID="rgRegEntity" runat="server" AllowSorting="True" AllowPaging="True"
                        RenderMode="Classic" AllowAutomaticInserts="True" AutoGenerateColumns="False" AllowAutomaticUpdates="True"
                        OnItemInserted="rgRegEntity_ItemInserted" OnItemUpdated="rgRegEntity_ItemUpdated"
                        DataSourceID="SqlDataSource1" OnItemDataBound="rgRegEntity_ItemDataBound1" OnItemDeleted="rgRegEntity_ItemDeleted"
                        AllowAutomaticDeletes="True" OnPreRender="rgRegEntity_PreRender" OnItemCreated="rgRegEntity_ItemCreated" OnBatchEditCommand="rgRegEntity_BatchEditCommand">
                        <MasterTableView DataKeyNames="RegistrationFundingSourceUID" ClientDataKeyNames="RegistrationFundingSourceUID"
                            DataSourceID="SqlDataSource1"
                            NoMasterRecordsText="No Records to display." Width="100%" TableLayout="Auto" ShowHeadersWhenNoRecords="true"
                            EditMode="Batch" CommandItemDisplay="TopAndBottom">
                            <BatchEditingSettings EditType="Row" SaveAllHierarchyLevels="true" OpenEditingEvent="Click"/>
                            <ColumnGroups>
                                <telerik:GridColumnGroup  HeaderText="DOCUMENT" Name="PMs"  HeaderStyle-HorizontalAlign="Center"/>
                                <telerik:GridColumnGroup  HeaderText="FMS INFORMATION (Budget Use Only)" Name="Budget" HeaderStyle-HorizontalAlign="Center"/>
                            </ColumnGroups>
                            <CommandItemSettings ShowSaveChangesButton="true" ShowCancelChangesButton="true" />
                            <Columns>
                                 <telerik:GridButtonColumn ConfirmText="Delete this LineItem?" ConfirmDialogType="RadWindow"
                                    ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="3%"  ItemStyle-Width="50px"
                                    CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                </telerik:GridButtonColumn>
                                <telerik:GridBoundColumn DataField="RegistrationUID" HeaderStyle-Width="3%" HeaderText="RegistrationUID" SortExpression="RegistrationUID"
                                    UniqueName="RegistrationUID" Visible="false">                                   
                                </telerik:GridBoundColumn>
                              
                               
                                 <telerik:GridTemplateColumn ColumnGroupName="PMs" HeaderText="Document <br />Type" HeaderStyle-Width="12%" UniqueName="EntityTypeUID" DataField="EntityTypeUID">
                                <ItemTemplate>
                                    <%# Eval("EntityType") %>
                                </ItemTemplate>    
                                        <HeaderTemplate> 
                                            Document <br />Type                                              
                                        </HeaderTemplate>
                                <EditItemTemplate>                               
                                    <telerik:RadDropDownList RenderMode="Classic"  runat="server" DefaultMessage="Select Document Type" ID="cmbEntityType" DataValueField="EntityTypeUID"
                                        DataTextField="EntityType" DataSourceID="SqlEntityTpeMstDataSource" DropDownWidth="200px">
                                    </telerik:RadDropDownList>
                                    <span style="color: Red">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9"
                                                    ControlToValidate="cmbEntityType" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                        </asp:RequiredFieldValidator>
                                     </span>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                                 <telerik:GridBoundColumn ColumnGroupName="PMs"  DataField="EntityNumber" HeaderStyle-Width="6%" HeaderText="Document <br />Number" SortExpression="EntityNumber"
                                UniqueName="EntityNumber" Visible="true" >                                      
                            </telerik:GridBoundColumn>

                                <telerik:GridTemplateColumn ColumnGroupName="PMs"  HeaderStyle-Width="6%" SortExpression="DocumentAmount" UniqueName="DocumentAmount" DataField="DocumentAmount">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblDocumentAmount" Text='<%# Eval("DocumentAmount","{0:C}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderTemplate> 
                                            Document <br />Amount
                                               <asp:ImageButton ID="ImageButton2" runat="server"  ImageUrl="/_layouts/15/images/EDCDigitalAssets/icn_completehelp.gif" ToolTip="Amount listed on the executed document"/>
                                                <telerik:RadToolTip ID="rttDocAmount" runat="server" ShowDelay="400" Skin="Office2007" Sticky="True" TargetControlID="ImageButton2" ToolTip="Amount listed on the executed document" Width="300px">
                                                 </telerik:RadToolTip>
                                        </HeaderTemplate>
                                    <EditItemTemplate>
                                            <telerik:RadNumericTextBox RenderMode="Classic" Width="100%" runat="server" ID="txtDocumentAmount"></telerik:RadNumericTextBox>
                                            <span style="color: Red">
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator15"
                                                         ControlToValidate="txtDocumentAmount" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                                </asp:RequiredFieldValidator>
                                        </span>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>      
                               
                                <telerik:GridTemplateColumn ColumnGroupName="PMs"  HeaderStyle-Width="6%" SortExpression="RegistrationAmount" UniqueName="RegistrationAmount" DataField="RegistrationAmount">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblRegistrationAmount" Text='<%# Eval("RegistrationAmount","{0:C}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderTemplate> 
                                            Registration <br />Amount
                                               <asp:ImageButton ID="ImageButton3" runat="server"  ImageUrl="/_layouts/15/images/EDCDigitalAssets/icn_completehelp.gif" ToolTip="Amount requested in the submission"/>
                                                <telerik:RadToolTip ID="rttRegAmount" runat="server" ShowDelay="400" Skin="Office2007" Sticky="True" TargetControlID="ImageButton3" ToolTip="Amount requested in the submission" Width="300px">
                                                 </telerik:RadToolTip>
                                        </HeaderTemplate>
                                    <EditItemTemplate>                                       
                                            <telerik:RadNumericTextBox RenderMode="Classic" Width="100%" runat="server" ID="txtRegistrationAmount"></telerik:RadNumericTextBox>
                                            <span style="color: Red">
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator10"
                                                         ControlToValidate="txtRegistrationAmount" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                                </asp:RequiredFieldValidator>
                                            </span>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>                                 
                            <telerik:GridTemplateColumn ColumnGroupName="PMs"  HeaderText="Capital <br />Funding Source" ItemStyle-Width="240px"
                                 HeaderStyle-Width="14%" UniqueName="CPFundingsId" >
                                <ItemTemplate>                                   
                                    <%#DataBinder.Eval(Container.DataItem, "fundingsourcename")%>
                                </ItemTemplate>
                                <HeaderTemplate> 
                                    Capital <br />Funding Source
                                        <asp:ImageButton ID="ImageButton4" runat="server"  ImageUrl="/_layouts/15/images/EDCDigitalAssets/icn_completehelp.gif" ToolTip="Funding source approved in the CP and project budget"/>
                                        <telerik:RadToolTip ID="rttCapitalFund" runat="server" ShowDelay="400" Skin="Office2007" Sticky="True" TargetControlID="ImageButton4" ToolTip="Funding source approved in the CP and project budget" Width="600px">
                                            </telerik:RadToolTip>
                                </HeaderTemplate>
                                <EditItemTemplate>                                                                       
                                    <telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="cmbFundingSrc" DefaultMessage="Select Capital Funding Src"
                                        DataTextField="fundingsourcename" DataValueField="CPFundingsId" DataSourceID="SqlFundingDataSource" DropDownWidth="400px" >
                            </telerik:RadComboBox>
                                     <span style="color: Red">
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator20"
                                                        ControlToValidate="cmbFundingSrc" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                     </span>                             
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn  ColumnGroupName="PMs" HeaderText="Expense <br />Funding Source"
                                HeaderStyle-Width="14%" UniqueName="ProgramaticBudgetFundingId" >
                                <ItemTemplate>
                                    <%#DataBinder.Eval(Container.DataItem, "Expensefundingsourcename")%>
                                </ItemTemplate>
                                <HeaderTemplate> 
                                    Expense <br />Funding Source
                                        <asp:ImageButton ID="ImageButton5" runat="server"  ImageUrl="/_layouts/15/images/EDCDigitalAssets/icn_completehelp.gif" ToolTip="Project Number | FY | Fund Type - Fund Source (Accountiing Code) [Reporting Category : Grant PIN]" />
                                        <telerik:RadToolTip ID="rttExpenseFund" runat="server" ShowDelay="400" Skin="Office2007" Sticky="True" TargetControlID="ImageButton5" ToolTip="Project Number | FY | Fund Type - Fund Source (Accountiing Code) [Reporting Category : Grant PIN]" Width="600px">
                                            </telerik:RadToolTip>
                                </HeaderTemplate>
                                <EditItemTemplate>     
                                  <telerik:RadComboBox RenderMode="Classic" runat="server" ID="cmbExpnseFundingSrc" DefaultMessage="Select Exp Funding Src"
                                      DataTextField="Expensefundingsourcename" DataValueField="ProgramaticBudgetFundingId" DataSourceID="SqlExpenseFundingDataSource" DropDownWidth="400px" >
                                  </telerik:RadComboBox>                                  
                                    <span style="color: Red">
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator18"
                                                         ControlToValidate="cmbExpnseFundingSrc" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                                </asp:RequiredFieldValidator>
                                     </span>                                   
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                             <telerik:GridTemplateColumn  ColumnGroupName="PMs" HeaderText="Expense <br />Funding Source"
                                HeaderStyle-Width="14%" UniqueName="Specialcategory_FundingID" DataField="Specialcategory_FundingID" >
                                <ItemTemplate>
                                    <%# Eval("SpecialCategory_FundingSrc") %>
                                </ItemTemplate>
                                <HeaderTemplate> 
                                    Expense <br />Funding Source
                                </HeaderTemplate>
                                <EditItemTemplate> 
                                    <telerik:RadDropDownList RenderMode="Classic"  runat="server" DefaultMessage="Select Exp Funding Src" ID="cmbSpecialCtaegoryExpnseFundingSrc" 
                                        DataValueField="Specialcategory_FundingID"
                                        DataTextField="SpecialCategory_FundingSrc" DataSourceID="sqlSpecialCategoryDataSource" DropDownWidth="400px">                                       
                                    </telerik:RadDropDownList>  
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                              
                                 <telerik:GridTemplateColumn ColumnGroupName="PMs" HeaderText="Contractor" HeaderStyle-Width="12%" UniqueName="ContractorId" DataField="ContractorId">
                                <ItemTemplate>
                                    <%# Eval("CompanyNameWithType") %>
                                </ItemTemplate>
                                 <HeaderTemplate> 
                                    Contractor                                       
                                </HeaderTemplate>
                                <EditItemTemplate>                                   
                                    <telerik:RadDropDownList RenderMode="Classic" runat="server" ID="cmbContractor" DefaultMessage="Select Contractor" DataValueField="ContractorId"
                                        DataTextField="CompanyNameWithType"  DataSourceID="SqlContractorLstDataSource" DropDownWidth="200Px">
                                    </telerik:RadDropDownList>     
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                               
                                <telerik:GridBoundColumn ColumnGroupName="Budget"  DataField="OCCLine" HeaderStyle-Width="5%" HeaderText="OCC <br />Line" SortExpression="OCCLine" ItemStyle-Width="10%"
                                    UniqueName="OCCLine" Visible="true" >    
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn ColumnGroupName="Budget"  DataField="CommodityLine" HeaderStyle-Width="6%" HeaderText="Commodity <br />Line" SortExpression="CommodityLine"
                                    UniqueName="CommodityLine" Visible="true">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn ColumnGroupName="Budget"  DataField="AccountingLine" HeaderStyle-Width="6%" HeaderText="Accounting <br />Line" SortExpression="AccountingLine"
                                    UniqueName="AccountingLine" Visible="true">
                                  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn ColumnGroupName="Budget"  DataField="Agency" HeaderStyle-Width="5%" HeaderText="Agency <br />Code" SortExpression="Agency"
                                    UniqueName="Agency" Visible="true">
                                   
                                </telerik:GridBoundColumn>
                                                               
                                <telerik:GridBoundColumn  ColumnGroupName="Budget" DataField="UofA" HeaderStyle-Width="5%" HeaderText="U/A <br />Code" SortExpression="UofA"
                                    UniqueName="UofA" Visible="true"> 
                                   
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn ColumnGroupName="Budget"  DataField="BC" HeaderStyle-Width="5%" HeaderText="Budget <br />Code" SortExpression="BC"
                                    UniqueName="BC" Visible="true">                                     
                                </telerik:GridBoundColumn>
                               
                                <telerik:GridBoundColumn  ColumnGroupName="Budget" DataField="OBJ" HeaderStyle-Width="5%" HeaderText="Object <br />Code" SortExpression="OBJ"
                                    UniqueName="OBJ" Visible="true">                                     
                                </telerik:GridBoundColumn>
                               
                         </Columns>
                        </MasterTableView>
                        <ClientSettings AllowExpandCollapse="true">
                            <Selecting AllowRowSelect="true"   />
                            <Scrolling AllowScroll="True" ScrollHeight="255" UseStaticHeaders="true" />
                        </ClientSettings>
                    </telerik:RadGrid>                   
                </td>
            </tr>
        </table>
        <hr id="hrLine" class="line-Style-Separator" />
        <div width="100" STYLE="text-align:left;">
            <asp:Label runat="server" ID="lblLastModifiedBy" STYLE="text-align:left;" />
        </div>
        <asp:TextBox runat="server" ID="txtRegID" visible="false"></asp:TextBox>
        <asp:TextBox runat="server" ID="txtPrimeContractorID" visible="false"></asp:TextBox>       
        <asp:TextBox runat="server" ID="txtLoggedInUserID" visible="false"></asp:TextBox>
    </asp:Panel>
</telerik:RadAjaxPanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"
       SelectCommand="SELECT
        [RegistrationUID]
      ,[RegistrationFundingSourceUID]
      ,[OCCLine]
      ,[Agency]
      ,[UOfA]
      ,[BC]
      ,[OBJ]     
      ,[CPFundingsId]
      ,[fundingsourcename]
      ,ExpenseBudgetFundingId
      ,ExpenseFundingSourceName
      ,[CommodityLine]
      ,[AccountingLine]           
      ,[EntityTypeUID]    
      ,[EntityType]
      ,[EntityNumber]
      ,[DocumentAmount]
      ,[RegistrationAmount]     
      ,[ContractorId]
      ,CompanyNameWithType    
     ,SpecialCategory_FundingSrc
    ,Specialcategory_FundingID
       FROM vwRegistrationLineltems WHERE (RegistrationUID  = @RegistrationUID)"
    InsertCommand="
    INSERT INTO [dbo].[tblRegistrationFundingSources]
           ([RegistrationUID]
            ,[OCCLine]
            ,[Agency]
            ,[UOfA]
            ,[BC]
            ,[OBJ]            
            ,CPFundingsId  
            ,ExpenseBudgetFundingId           
            ,[CommodityLine]
            ,[AccountingLine]
            ,[EntityTypeUID]
            ,[CreatedBy]
            ,[CreatedOn]
            ,ModifiedBy
            ,ModifiedOn
            ,EntityNumber
            ,DocumentAmount
            ,RegistrationAmount   
            ,ContractorId
            ,Specialcategory_FundingID
          )
    Values (@RegUID,@OCCLine,@Agency,@UOfA,@BC,@Specialcategory_FundingID,@CPFundingsId,@ProgramaticBudgetFundingId,@CommodityLine,@AccountingLine,@EntityTypeUID,@LoggedInUserUID,GetDate(),@LoggedInUserUID,GetDate(),@EntityNumber,@DocumentAmount,@RegistrationAmount,@ContractorId,@Specialcategory_FundingID)"
  
    UpdateCommand ="UPDATE [dbo].[tblRegistrationFundingSources]
                    SET [OCCLine] = @OCCLine
                        ,[Agency] = @Agency
                        ,[BC] = @BC
                        ,[OBJ] = @OBJ
                        ,[UOfA] = @UOfA                       
                        ,CPFundingsId = @CPFundingsId
                       ,ExpenseBudgetFundingId = @ProgramaticBudgetFundingId                      
                      ,[CommodityLine] = @CommodityLine
                      ,[AccountingLine] = @AccountingLine  
                       ,[EntityTypeUID] = @EntityTypeUID
                       ,[EntityNumber] = @EntityNumber
                       ,[DocumentAmount] = @DocumentAmount
                       ,[RegistrationAmount] = @RegistrationAmount                      
                       ,[ContractorID] = @ContractorId                      
                       ,[ModifiedBy] = @LoggedInUserUID
                      ,[ModifiedOn] = GetDate()   
                       ,[Specialcategory_FundingID] = @Specialcategory_FundingID
                WHERE [RegistrationFundingSourceUID]= @RegistrationFundingSourceUID"
DeleteCommand="DELETE FROM [dbo].[tblRegistrationFundingSources] WHERE [RegistrationFundingSourceUID]= @RegistrationFundingSourceUID"
    >  
    <SelectParameters>
        <asp:QueryStringParameter Name="RegistrationUID" Type="Int32" QueryStringField="RegistrationUID" />       
    </SelectParameters>
    <InsertParameters>
        <asp:ControlParameter Name="RegUID" ControlID="txtRegID" Type="String" PropertyName="Text" />
        <asp:ControlParameter Name="LoggedInUserUID" ControlID="txtLoggedInUserID" Type="Int32" PropertyName="Text" />
        <asp:ControlParameter Name="PrimeID" ControlID="txtPrimeContractorID" Type="String" PropertyName="Text" />
        <asp:Parameter Name="RegistrationUID" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="OCCLine" Type="String"></asp:Parameter>
        <asp:Parameter Name="CommodityLine" Type="String"></asp:Parameter>
        <asp:Parameter Name="AccountingLine" Type="String"></asp:Parameter>
        <asp:Parameter Name="Agency" Type="String"></asp:Parameter>
        <asp:Parameter Name="UOfA" Type="String"></asp:Parameter>
        <asp:Parameter Name="BC" Type="String"></asp:Parameter>
        <asp:Parameter Name="OBJ" Type="String"></asp:Parameter>       
        <asp:Parameter Name="CPFundingsId" Type="Int32"></asp:Parameter>       
        <asp:Parameter Name="ProgramaticBudgetFundingId" Type="Int32"></asp:Parameter>                    
        <asp:Parameter Name="EntityTypeUID" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="CreatedBy" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="CreatedOn" Type="DateTime"></asp:Parameter>
        <asp:Parameter Name="ModifiedBy" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="ModifiedOn" Type="DateTime"></asp:Parameter>
        <asp:Parameter Name="EntityNumber" Type="String"></asp:Parameter>
        <asp:Parameter Name="DocumentAmount" Type="Decimal"></asp:Parameter>       
        <asp:Parameter Name="RegistrationAmount" Type="Decimal"></asp:Parameter>    
         <asp:Parameter Name="ContractorId" Type="Int32"></asp:Parameter> 
        <asp:Parameter Name="Specialcategory_FundingID" Type="Int32"></asp:Parameter>
    </InsertParameters>
    <UpdateParameters>
        <asp:ControlParameter Name="LoggedInUserUID" ControlID="txtLoggedInUserID" Type="Int32" PropertyName="Text" />       
        <asp:Parameter Name="OCCLine" Type="String"></asp:Parameter>  
        <asp:Parameter Name="CommodityLine" Type="String"></asp:Parameter>
        <asp:Parameter Name="AccountingLine" Type="String"></asp:Parameter>
        <asp:Parameter Name="Agency" Type="String"></asp:Parameter>
        <asp:Parameter Name="UOfA" Type="String"></asp:Parameter>
        <asp:Parameter Name="BC" Type="String"></asp:Parameter>
        <asp:Parameter Name="OBJ" Type="String"></asp:Parameter>       
        <asp:Parameter Name="CPFundingsId" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="ProgramaticBudgetFundingId" Type="Int32"></asp:Parameter>       
         <asp:Parameter Name="EntityTypeUID" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="ModifiedBy" Type="String"></asp:Parameter>
        <asp:Parameter Name="ModifiedOn" Type="DateTime"></asp:Parameter>      
         <asp:Parameter Name="EntityNumber" Type="String"></asp:Parameter>
        <asp:Parameter Name="DocumentAmount" Type="Decimal"></asp:Parameter>       
        <asp:Parameter Name="RegistrationAmount" Type="Decimal"></asp:Parameter> 
        <asp:Parameter Name="ContractorId" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="Specialcategory_FundingID" Type="Int32"></asp:Parameter>
       
    </UpdateParameters>
    <DeleteParameters>
            <asp:Parameter Name="RegistrationFundingSourceUID" Type="Int32"></asp:Parameter>
    </DeleteParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlGetPrimeContractor" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"
    SelectCommand="SELECT [ContractorId],[CompanyName] FROM [Budget2013].[Lookups].[vwContractContractorList] Where Type='Primary' AND ContractID=@ContractID" >
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlEntityTpeMstDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"
    SelectCommand=" SELECT [EntityTypeUID],[EntityType]  FROM [Budget2013].[Lookups].[tblEntityTypeMst]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlFundingDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"
    SelectCommand="SELECT DISTINCT RegistrationUID,[fundingsourcename],CPFundingsId FROM [Budget2013].[dbo].[vwRegistrationCPListWithFundingInfo]  WHERE RegistrationUID=@RegistrationUID" > 
     <SelectParameters>
         <asp:QueryStringParameter Name="RegistrationUID" Type="Int32" QueryStringField="RegistrationUID" />       
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlExpenseFundingDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"
    SelectCommand ="SELECT DISTINCT RegistrationUID,[ProgramaticBudgetFundingId],[Expensefundingsourcename] FROM [Budget2013].[dbo].[vwRegistartionExpenseBudgetFundingInfo] WHERE RegistrationUID=@RegistrationUID ">
    <SelectParameters>
         <asp:QueryStringParameter Name="RegistrationUID" Type="Int32" QueryStringField="RegistrationUID" />       
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sqlSpecialCategoryDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"   
    SelectCommand = "SELECT distinct [Specialcategory_FundingID],[SpecialCategory_FundingSrc]  FROM [Budget2013].dbo.[vwExpenseFundingForSpecialCategory]">
</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlContractorLstDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Budget2013ConnectionString %>"
    SelectCommand=" SELECT [ContractorId],CompanyNameWithType FROM [Budget2013].[Lookups].[vwContractContractorList] WHERE RegistrationUID=@RegistrationUID ">
    <SelectParameters>
         <asp:QueryStringParameter Name="RegistrationUID" Type="Int32" QueryStringField="RegistrationUID" />       
    </SelectParameters>
</asp:SqlDataSource>
0
Attila Antal
Telerik team
answered on 09 Apr 2020, 09:12 AM

Hi Robert,

Can you please point out which one of the many DropDowns that is not working, it the issue appears with all of them?

Generally, the code responsible for updating the database with the presented value is the UpdateCommand defined in the SqlDataSource control.

So, if you have a Column with a DropDownList like this:

<telerik:GridTemplateColumn HeaderText="Category" DefaultInsertValue="Beverages" HeaderStyle-Width="150px" UniqueName="CategoryID" DataField="CategoryID">
    <ItemTemplate>
        <%# Eval("CategoryName") %>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadDropDownList RenderMode="Lightweight" runat="server" ID="CategoryIDDropDown" DataValueField="CategoryID"
            DataTextField="CategoryName" DataSourceID="SqlDataSource2">
        </telerik:RadDropDownList>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

 

The UpdateCommand must update the respective field in the database based on the "CategoryID" column.

UpdateCommand="UPDATE [Products] SET [FieldNameInDataBase] = @CategoryID WHERE [ProductID] = @ProductID"

 

You can check out our online demo to see the implementation of this scenario and also to test its behavior: Grid - Batch Editing

 

Kind regards,
Attila Antal
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Attila Antal
Telerik team
Share this question
or