<div id="dFieldSelection" style="padding:5px;" runat="server">
<telerik:radlistbox runat="server" DataTextField="Name" DataValueField="FieldID" ID="radListBox_1" AllowDelete="True"
AllowReorder="True" AllowTransfer="True" AutoPostBackOnTransfer="true" AutoPostBackOnDelete="true" TransferToID="radListBox_2">
</telerik:radlistbox>
<telerik:radlistbox runat="server" ID="radListBox_2"
AutoPostBackOnTransfer="true" AutoPostBackOnDelete="true"
ondeleting="radListBox_2_Deleting"></telerik:radlistbox>
</div>
I programmtically place some mandatory fields into radListBox_2... my goal is to prevent a user from deleting these mandatory items from radListBox_2 (i.e. I have noticed that the radListBox_2_Deleting server side event get executed when the user presses the arrow button to transfer an item back to radListBox_1).
Inside of radListBox_2_Deleting server side event I simply do some code checks and if this is a mandtory item I set e.Cancel = true... hoping that that will cancel the deletion. However, this does not appear to work as I expected.
How can I prevent a user from moving 1 RadListBoxItem from radListBox_2 back into radListBox_1?
Thx in advance!!!


<telerik:RadGrid HeaderStyle-Wrap="false" ItemStyle-Wrap="true" ID="gvCustomers" runat="server" AutoGenerateColumns="False" GridLines="None" AllowSorting="true" OnNeedDataSource="gvCustomers_NeedDataSource" OnItemCommand="gvCustomers_ItemCommand"> <MasterTableView DataKeyNames="CustomerId"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FName" HeaderText="First Name" UniqueName="FName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LName" HeaderText="Last Name" UniqueName="LName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" UniqueName="CompanyName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Address1" HeaderText="Address 1" UniqueName="Address1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Town" HeaderText="Town" UniqueName="Town"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Postcode" HeaderText="Postcode" UniqueName="Postcode"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Telephone" HeaderText="Tel" UniqueName="Telephone"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Mobile" HeaderText="Mobile" UniqueName="Mobile"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email"> </telerik:GridBoundColumn> <telerik:GridButtonColumn Text="Select" CommandName="Select" ButtonType="LinkButton" UniqueName="column"> </telerik:GridButtonColumn> <telerik:GridButtonColumn Text="Edit" CommandName="EditCustomer" ButtonType="LinkButton" UniqueName="EditCustomer"> </telerik:GridButtonColumn> </Columns> </MasterTableView> </telerik:RadGrid>protected void gvCustomers_ItemCommand(object sender, GridCommandEventArgs e) { if (!IsPostBack) { var item = (GridDataItem) e.Item; string id = item.GetDataKeyValue("CustomerId").ToString(); if ((e.Item is GridDataItem) && (e.CommandName == "EditCustomer")) { var destination = string.Format("CustomerEdit.aspx?CustomerId={0}", id); Response.Redirect(destination); } if ((e.Item is GridDataItem) && (e.CommandName == "Select")) { var destination = string.Format("CustomerDetail.aspx?CustomerId={0}", id); Response.Redirect(destination); } } }