or
| foreach (RadComboBoxItem rcbi in cmbAccessories.Items) |
| { |
| if (rcbi.Selected) |
| { |
| //insert value in database |
| } |
| } |
| <telerik:RadComboBox ID="cmbAccessories" Width="200px" |
| OnClientDropDownOpening="OnClientDropDownOpening" |
| EmptyMessage="...Select Accessories" |
| OnClientDropDownClosing="OnClientDropDownClosing" |
| OnClientSelectedIndexChanging="OnClientSelectedIndexChanging" |
| OnClientBlur="OnClientBlur" DataTextField="Name" DataValueField="AccessoryID" |
| ValidationGroup="valItem" HighlightTemplatedItems="false" |
| AllowCustomText="True" Runat="server" ShowDropDownOnTextboxClick="False" |
| EnableTextSelection="False"> |
| <ItemTemplate> |
| <asp:CheckBox ID="chkBox" Text='<%#Eval("Name") %>' onclick="checkboxClick();" runat="server" /> |
| </ItemTemplate> |
| <FooterTemplate> |
| <div style="width:100%;" align="center"><asp:Label ID="lblCloseMe" Text="CLOSE [X]" onclick="CloseMe();" style="cursor:pointer;" runat="server" /></div> |
| </FooterTemplate> |
| </telerik:RadComboBox> |



| <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/images/icon_page_magnify.gif" HeaderText="Select" UniqueName="Select" CommandName="Select" /> |
| if (e.CommandName.ToUpper() == "SELECT") |
| { |
| Session["A"] = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["A"]; |
| Response.Redirect("~/Item/"); |
| } |

| Private Sub InitializeControls() |
| '==Get some info from the logged in user |
| Dim oContact As New Contact(UserInstance.ContactID) |
| '== Labels |
| lblDownline.Text = "My Distributor Downline" |
| LoadDataSet() |
| '== If it's the root node, SponsorID will be zero so use their contactid |
| Dim parentID As Integer = 0 |
| If oContact.SponsorID = 0 Then |
| parentID = UserInstance.ContactID |
| Else |
| parentID = oContact.SponsorID |
| End If |
| BuildTree(TreeView1.Nodes, parentID) |
| End Sub |
| Private Sub LoadDataSet() |
| '==ds is declared at the page level |
| Dim oContacts As New ContactCollection |
| ds = oContacts.GetDownline(UserInstance.ContactID, 8) '==returns a dataset...later would like to return a collection |
| End Sub |
| Private Sub BuildTree(ByVal nodes As TreeNodeCollection, ByVal IntParent As Int32) |
| Dim thisID As Int32 |
| Dim thisName As String |
| Dim children As DataRow() = ds.Tables(0).Select("SponsorID='" & IntParent & "'") |
| If children.Length = 0 Then |
| Return |
| End If |
| Dim newNode As TreeNode |
| For Each child As DataRow In children |
| thisID = Convert.ToInt32(child.ItemArray(0)) |
| thisName = Convert.ToString(child.ItemArray(2)) |
| newNode = New TreeNode(thisName, thisID.ToString) |
| nodes.Add(newNode) |
| newNode.ToggleExpandState() |
| BuildTree(newNode.ChildNodes, thisID) |
| Next |
| End Sub |