or
01.<telerik:RadPanelBar ID="rpbHeader" runat="server" Skin="Outlook" Width="100%" ExpandMode="FullExpandedItem" OnPreRender="rpbHeader_PreRender">
02. <Items>
03. <telerik:RadPanelItem ID="rpi_Header" runat="server" Owner="rpbHeader" Text="Statement Details">
04. <ContentTemplate>
05. <asp:UpdatePanel ID="UpdatePanel3" runat="server">
06. <ContentTemplate>
07. <div style="padding-top: 8px;">
08. </div>
09. <div class="RFSHeader">
10. <uc2:ucStatementHeader ID="ucStatementHeader" runat="server" />
11. </div>
12. </ContentTemplate>
13. </asp:UpdatePanel>
14. </ContentTemplate>
15. </telerik:RadPanelItem>
16. </Items>
17. </telerik:RadPanelBar>
1.protected void Page_PreRender(object sender, EventArgs e)
2. {
3. if (sessionInfo.SessionObject().FinData.BankStatement != null)
4. {
5. rpi_Header.Expanded = true;
6. }
7. }

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadListBox1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadListBox2" UpdatePanelCssClass="" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadListBox2"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadListBox1" UpdatePanelCssClass="" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <table> <tr> <td> <telerik:RadListBox ID="RadListBox1" runat="server" AllowTransfer="True" TransferToID="RadListBox2" SelectionMode="Multiple" AutoPostBackOnTransfer="true" Width="300px" Height="300px" EnableDragAndDrop="true"> <ButtonSettings TransferButtons="All"></ButtonSettings> <Items> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem1" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem2" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem3" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem4" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem5" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem6" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem7" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem8" /> <telerik:RadListBoxItem runat="server" Text="RadListBoxItem9" /> </Items> </telerik:RadListBox> </td> <td> <telerik:RadListBox ID="RadListBox2" runat="server" SelectionMode="Multiple" AllowReorder="true" EnableDragAndDrop="true" Width="300px" Height="300px"> <Items> <telerik:RadListBoxItem runat="server" Text="RequiredItem1 (required)" /> <telerik:RadListBoxItem runat="server" Text="RequiredItem2 (required)" /> </Items> </telerik:RadListBox> </td> </tr> </table></asp:Content>private const string REQUIRED_FLAG = "(required)";protected void Page_Init(object sender, EventArgs e){ RadListBox1.Transferred += new Telerik.Web.UI.RadListBoxTransferredEventHandler(RadListBox1_Transferred); RadListBox1.Transferring += new Telerik.Web.UI.RadListBoxTransferringEventHandler(RadListBox1_Transferring); RadListBox1.Reordered += new RadListBoxEventHandler(RadListBox1_Reordered);}protected void Page_Load(object sender, EventArgs e){}void RadListBox1_Transferred(object sender, Telerik.Web.UI.RadListBoxTransferredEventArgs e){ RadListBox1.Sort = Telerik.Web.UI.RadListBoxSort.Ascending; RadListBox1.SortItems();}void RadListBox1_Transferring(object sender, Telerik.Web.UI.RadListBoxTransferringEventArgs e){ Boolean transferFail = false; foreach (RadListBoxItem item in e.Items) { if (item.Text.EndsWith(REQUIRED_FLAG)) { transferFail = true; break; } } // only do special processing if required fields are in e.Items // otherwise, let the Transferring and Transferred events fire normally if (transferFail) { // cancel the event // (this also prevents the Transferred event from firing after) e.Cancel = true; foreach (RadListBoxItem item in e.Items) { if (!item.Text.EndsWith(REQUIRED_FLAG)) { //e.SourceListBox.Transfer(item,e.SourceListBox,e.DestinationListBox); e.SourceListBox.Items.Remove(item); e.DestinationListBox.Items.Add(item); } } // Since the Transferred event doesn't fire, sort items e.DestinationListBox.Sort = RadListBoxSort.Ascending; e.DestinationListBox.SortItems(); }}void RadListBox1_Reordered(object sender, RadListBoxEventArgs e){ // Needed to sort AFTER the automatic reordering that Telerik does during the drag-n-drop action RadListBox1.Sort = Telerik.Web.UI.RadListBoxSort.Ascending; RadListBox1.SortItems();}<telerik:GridTemplateColumn Display="false" UniqueName="colClass" HeaderText="Class"> <ItemTemplate> <asp:Label runat="server" ID="lblClass" Text=<%# Eval("Class") %> ></asp:Label> </ItemTemplate> <EditItemTemplate> <telerik:RadComboBox runat="server" ID="cbbClass" DataSourceID="classesDS" OnSelectedIndexChanged="cbbClass_SelectedIndexChanged" AutoPostBack="true" EmptyMessage="--Select a Class--" Filter="Contains" DataValueField="Class_ID" DataTextField="Class" SelectedValue = <%# Eval("Class_ID") %> ></telerik:RadComboBox> <asp:RequiredFieldValidator runat="server" ID="cbbClassValidator" ValidationGroup="SessionSave" ErrorMessage="You must select a Class!" Text="*" Display="Dynamic" ControlToValidate="cbbClass" ></asp:RequiredFieldValidator> <asp:CompareValidator runat="server" ID="cbbClassValidator2" ValueToCompare="" Operator="NotEqual" ControlToValidate="cbbClass" Display="Dynamic" ErrorMessage="You must select a Class2!" Text="*" ValidationGroup="SessionSave" /> </EditItemTemplate></telerik:GridTemplateColumn><%----------------------- DATA SOURCE FOR DELIVERABLE -------------------------%><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ITSConnectionString %>" DeleteCommand="DELETE FROM [Deliverable] WHERE [DeliverableId] = @DeliverableId" InsertCommand="INSERT INTO [Deliverable] ([DeliverableTitle],[CCIds]) VALUES (@DeliverableTitle, @CCIds)" SelectCommand="SELECT * FROM [Deliverable] WHERE ([DeliverableId] = @DeliverableId)" UpdateCommand="UPDATE [Deliverable] SET [DeliverableTitle] = @DeliverableTitle, [CCIds] = @CCIds WHERE [DeliverableId] = @DeliverableId"> <DeleteParameters> <asp:Parameter Name="DeliverableId" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="DeliverableId" Type="int32" /> <asp:Parameter Name="DeliverableTitle" Type="String" /> <asp:Parameter Name="CCIds" Type="String" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="DeliverableId" Type="int32" /> <asp:Parameter Name="DeliverableTitle" Type="String" /> <asp:Parameter Name="CCIds" Type="String" /> </UpdateParameters> <SelectParameters> <asp:QueryStringParameter Name="DeliverableId" QueryStringField="DeliverableId" Type="Int32" /> </SelectParameters></asp:SqlDataSource><%----------------------- DATA SOURCE FOR COMBOBOX -------------------------%><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ITSConnectionString %>" SelectCommand="SELECT [UserId], [DisplayName] FROM [Users]"></asp:SqlDataSource><%----------------------- THE DETAILS VIEW -------------------------%><asp:DetailsView ID="DetailsView1" runat="server" DefaultMode="Insert" AutoGenerateRows="False" DataKeyNames="DeliverableId" DataSourceID="SqlDataSource2" Height="50px" Width="125px" OnItemInserting="DetailsView1_ItemInserting" OnDataBinding="DetailsView1_DataBinding" OnDataBound="DetailsView1_DataBound"> <Fields> <asp:BoundField DataField="DeliverableId" HeaderText="DeliverableId" InsertVisible="False" ReadOnly="True" SortExpression="DeliverableId" /> <asp:BoundField DataField="DeliverableId" HeaderText="DeliverableId" SortExpression="DeliverableId" /> <asp:BoundField DataField="DeliverableTitle" HeaderText="DeliverableTitle" SortExpression="DeliverableTitle"/> <asp:TemplateField> <ItemTemplate> <telerik:RadComboBox ID="CCIds" Text='<% #Bind("CCIds") %>' runat="server" DataSourceID="SqlDataSource1" DataTextField="DisplayName" DataValueField="UserId" CheckBoxes="true"></telerik:RadComboBox> </ItemTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" /> <asp:ButtonField Text="Insert" CommandName="Insert" /> <asp:ButtonField Text="Update" CommandName="Update" /> </Fields> </asp:DetailsView> public string GetCheckBoxValues(string RadComboBoxName) { RadComboBox rcb = (RadComboBox)DetailsView1.FindControl(RadComboBoxName); var collection = rcb.CheckedItems; StringBuilder sbValues = new StringBuilder(); if (collection.Count != 0) { foreach (var item in collection) { sbValues.Append(item.Value); sbValues.Append(Delimiter); } if (sbValues.ToString().EndsWith(Delimiter)) sbValues.Remove(sbValues.Length - 1, 1); } return sbValues.ToString(); } // Get the comma separate values and insert them into the DB. protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e) { string CCIds = GetCheckBoxValues("CCIds"); if (CCIds != null) { e.Values["CCIds"] = CCIds; } }