or
I am replacing a standard listbox control with a RADLISTBOX control and thought it would be pretty seamless to switch out, but I am not having any luck with populating the RADLISTBOX. Can someone please tell me what I am doing wrong? I am not doing anything spectacular, just a simple databind with datareader.
Here is my code aspx.vb
Dim item As New RadListBoxItem() While reader4.Read item.Value = reader4("DescriptionLong") ConditionList.Items.Add(item)Here is my aspx. code
<telerik:RadListBox ID="ConditionList" Width="160px" runat="server" Skin="Office2010Blue"> </telerik:RadListBox><telerik:RadGrid ID="myRadGrid" runat="server" Width="100%" BorderWidth="1px" CellPadding="4" Skin="Web20"> <MasterTableView AutoGenerateColumns="false" DataKeyNames="intCategoryId" HierarchyDefaultExpanded="false" Font-Size="10" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center" Name="MasterGrid" ExpandCollapseColumn-ButtonType="ImageButton" HierarchyLoadMode="Client" AllowPaging="True" PageSize="20" PagerStyle-Mode="NumericPages" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png"> <ItemStyle HorizontalAlign="Center" /><AlternatingItemStyle BackColor="#B0C4DE" HorizontalAlign="Center" /><HeaderStyle ForeColor="White" Font-Bold="true" /> <DetailTables> <telerik:GridTableView Name="myManufacGrid" runat="server" DataKeyNames="intManufacturerId" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10" SkinID="web20" AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png"> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="intCategoryId" MasterKeyField="intCategoryId" /> </ParentTableRelation> <HeaderStyle Font-Bold="true" HorizontalAlign="Center" /><ItemStyle HorizontalAlign="Center" /><AlternatingItemStyle HorizontalAlign="Center" /> <DetailTables> <telerik:GridTableView DataKeyNames="intMakeId" Name="myMakeGrid" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10" SkinID="web20" AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png"> <ParentTableRelation><telerik:GridHyperLinkColumn DataNavigateUrlFields="Email" HeaderText=" " DataNavigateUrlFormatString="mailto:{0}" UniqueName="Email" AllowFiltering="False" ItemStyle-HorizontalAlign="Center"> <ItemStyle Width="50px"/></telerik:GridHyperLinkColumn>Private Sub RadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid2.ItemDataBound If (TypeOf e.Item Is GridDataItem) Then Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) Dim hyperlink As HyperLink = CType(dataItem("Email").Controls(0), HyperLink) hyperlink.ImageUrl = "../../../images/iconoutlook.gif" If (dataItem.OwnerTableView.DataKeyValues(dataItem.ItemIndex)("Email") Is System.DBNull.Value) Then Dim ltrl As LiteralControl = New LiteralControl(hyperlink.Text) dataItem("Email").Controls.Clear() dataItem("Email").Controls.Add(ltrl) End If End IfEnd SubGridRowDrop) does not fire and the Page appears to do a PostBack. I believe this has to do with something with AJAX settings, but not certain.Dim SectionGrid As New RadGrid() With SectionGrid .DataSource = GetData(FCTN_TYPE_CD, CALLING_AGENT) With .MasterTableView .NoMasterRecordsText = "No associates assigned" .Columns.Add(New GridDragDropColumn) End With .Rebind() End With ' Set each grid's properties. With SectionGrid .ID = "SectionGrid_" & FCTN_TYPE_CD .AllowSorting = True .Width = Unit.Percentage(99) .AutoGenerateColumns = False .ShowHeader = False .AllowMultiRowSelection = True .CssClass = "BottomCorners" .Attributes.Add("style", "border:none;") With .ClientSettings .AllowRowsDragDrop = True .Selecting.EnableDragToSelectRows = False .Selecting.AllowRowSelect = True .ClientEvents.OnRowDropping = "onRowDropping" .EnablePostBackOnRowClick = False End With End With With SectionGrid.MasterTableView .Width = Unit.Percentage(100) .DataKeyNames = New String() {"LDAP"} .GetColumn("LDAP").Visible = False End With AssignedGrid.Controls.Add(SectionGrid) With PanelItem .Items.Add(AssignedGrid) .Expanded = True End With If SectionGrid.Items.Count = 0 Then PanelItem.Expanded = False AddHandler SectionGrid.RowDrop, AddressOf GridRowDrop AddHandler SectionGrid.NeedDataSource, AddressOf GridNeedDataSource