I think I've found a bug in the Grid when in batch edit mode. I have created a following grid;
<telerik:RadGrid ID="grdFees" runat="server" AutoGenerateColumns="False" GridLines="None"
AllowSorting="False" Height="310px"
OnNeedDataSource="grdFees_NeedDataSource"
OnPreRender="grdFees_PreRender"
OnItemDataBound="grdFees_ItemDataBound">
<MasterTableView CellPadding="4" CommandItemDisplay="Top" EditMode="Batch" DataKeyNames="FeeTypeId, CurrencyCode, ShowCurrencyCode, Paid" ClientDataKeyNames="Paid,ShowCurrencyCode">
<CommandItemSettings ShowExportToWordButton="false" ShowExportToExcelButton="false"
ShowExportToCsvButton="false" ShowExportToPdfButton="false" ShowRefreshButton="false"
ShowAddNewRecordButton="false" />
<BatchEditingSettings EditType="Row" HighlightDeletedRows="true" OpenEditingEvent="Click" />
<Columns>
<telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderStyle-Width="100px" ReadOnly="True" />
<telerik:GridNumericColumn UniqueName="Amount" DataField="Amount" HeaderStyle-Width="70px" HeaderText="Amount" DecimalDigits="3" />
<telerik:GridTemplateColumn UniqueName="CurrencyCode" DataField="CurrencyCode" HeaderText="Currency Code" DefaultInsertValue="GBP" HeaderStyle-Width="60px">
<ItemTemplate>
<%# Eval("CurrencyCode") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="CurrencyCodeDropDown" DataValueField="CurrencyCode"
DataTextField="CurrencyCode" MarkFirstMatch="true" AllowCustomText="true" >
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridCheckBoxColumn UniqueName="Paid" DataField="Paid" HeaderStyle-Width="20px" HeaderText="Paid" SortExpression="Paid" ReadOnly="true" />
<telerik:GridBoundColumn UniqueName="PaidDate" DataField="PaidDate" HeaderText="Paid Date" HeaderStyle-Width="100px" ReadOnly="True"
DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" />
</Columns>
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<ClientEvents OnBatchEditOpening="onBatchEditOpening" />
</ClientSettings>
</telerik:RadGrid>
with the javascript;
function onBatchEditOpening(sender, args)
{
var row = args.get_row();
var grid = $find("<%=grdFees.ClientID %>");
var masterTable = grid.get_masterTableView();
var rows = masterTable.get_dataItems();
var isPaid = rows[row.sectionRowIndex].getDataKeyValue("Paid");
if (isPaid === "True")
{
// prevent any editing on paid fees
args.set_cancel("true");
return;
}
var showCC = rows[row.sectionRowIndex].getDataKeyValue("ShowCurrencyCode");
if (showCC === "False" && args.get_columnUniqueName() == "CurrencyCode")
{
// do not show Currency Code drop down menu
args.set_cancel("true");
}
}
I want to prevent the RadComboBox from appearing if a value in the dataset is false. The good news is that it works. The bad news is after clicking on a row where showCC is false, the rest of the grid becomes unresponsive.
The grid comes back to life after clicking on Cancel Changes.
Is this a bug?