Hello Guys,
Long time TELERIK fan.. but my first Post..
I am banging my head for the past 2 days in figuring out the issue.
Below is my RadGrid for Bulk Edit/Update. All the CRUD operations works with a minor issue.
I have two radcomboboxs "cmbFundingSrc" & "cmbEntityType". When i click the row to edit values..
RadCombobox "cmbFundingSrc" will loose the selected value BUT other RadCombobox "cmbEntityType" will retain & show the existing selected value.
What could be the issue? Kindly let me know
<%@ Register assembly="Telerik.Web.UI, Version=2018.1.117.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<telerik:RadFormDecorator ID="FormDecorator1" runat="server" />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" RenderMode="Inline">
<asp:Panel runat="server" ID="pnlLineItemFormAdd" >
<br />
<table cellpadding="4" cellspacing="2" border="1" width="100%" style="table-layout:fixed" class="detail-SubTable" >
<tr>
<td>
<telerik:RadGrid ID="rgRegEntity" runat="server" AllowSorting="True" AllowPaging="True"
RenderMode="Lightweight" AllowAutomaticInserts="True" AutoGenerateColumns="False" AllowAutomaticUpdates="True"
DataSourceID="SqlDataSource1" OnItemDeleted="rgRegEntity_ItemDeleted"
AllowAutomaticDeletes="True">
<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"/>
<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 HeaderText="Funding Source <br />[Reporting Category]" HeaderStyle-Width="14%" UniqueName="CPFundingsId" DataField="CPFundingsId">
<ItemTemplate>
<%# Eval("fundingsourcename") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadDropDownList RenderMode="Lightweight" DefaultMessage="Select Funding Src" runat="server" ID="cmbFundingSrc" DataValueField="CPFundingsId"
DataTextField="fundingsourcename" DataSourceID="SqlFundingDataSource" DropDownWidth="200px" >
</telerik:RadDropDownList>
<span style="color: Red">
<asp:RequiredFieldValidator ID="RequiredFieldValidator12"
ControlToValidate="cmbFundingSrc" ErrorMessage="*Required" runat="server" Display="Dynamic">
</asp:RequiredFieldValidator>
</span>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Document <br />Type" HeaderStyle-Width="7%" UniqueName="EntityTypeUID" DataField="EntityTypeUID">
<ItemTemplate>
<%# Eval("EntityType") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadDropDownList RenderMode="Lightweight" 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>
</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
distinct [RegistrationUID]
,[RegistrationFundingSourceUID]
,[CPFundingsId]
,[fundingsourcename]
,[EntityTypeUID]
,[EntityId]
,[EntityType]
,[SecondaryContractor]
FROM vwRegistrationLineltems WHERE (RegistrationUID = @RegistrationUID)"
DeleteCommand="DELETE FROM [tblRegistrationFundingSources] WHERE [RegistrationFundingSourceUID]= @RegistrationFundingSourceUID"
>
<SelectParameters>
<asp:QueryStringParameter Name="RegistrationUID" Type="Int32" QueryStringField="RegistrationUID" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="RegistrationFundingSourceUID" Type="Int32"></asp:Parameter>
</DeleteParameters>
</asp:SqlDataSource>
</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 [CPFundingsId] ,[fundingsourcename] FROM [Budget2013].[dbo].[vwRegistrationCPListWithFundingInfo] "
>
</asp:SqlDataSource>
<SelectParameters>
<asp:QueryStringParameter Name="RegistrationUID" Type="Int32" QueryStringField="RegistrationUID" />
</SelectParameters>
</asp:SqlDataSource>