I have implemented a RadListBox that utilizes the reorder and delete functionality provided by AllowReorder and AllowDelete. It worked fine until I also began to use the ItemTemplate functionality to create list items as hyperlinks (thanks to some fantastic help from Genady in this forum).
When the listbox first appears, everything is fine. The list items are hyperlinks. If I click off to the side of one of the list items (so the hyperlink is not fired, but the item is selected), and then click either the Move Up or the Move Down button, the item is moved up or down as it should be but, an additional item, with the same name, is added to the list and it is NOT a hyperlink. So, after the Move up or Move down action I have two instances of the selected item in the list. One is a hyperlink and one is not.
As a work-around, I have been experimenting with using the client-side API to handle the reorder and delete functionalty, per the examples on this site. But, that will open up another can of worms, and I would rather avoid doing that.
Has anyone else experienced problems with AllowReorder when using an ItemTemplate to customize the display?
Thanks for any advice you can give.
UPDATE: I used the onClientReordered event to trap the event in an attempt to remove the "additional", non-hyperlink item that was
"added" to the list. When I did this, both items were removed from the list. So, I think that an item wasn't actually added when the Move UP or Move Down buttons are used but, the single item is displaying regular text along with the hyperlink after it is moved in the list. I thought this might be helpful information.

RadGrid using Webservice binding with clientside cache but not export data.(Xls,csv)
This is my code:
<telerik:RadGrid ID="RadGrid2" AllowSorting="true" AllowPaging="true"AllowFilteringByColumn="true" AutoGenerateColumns="false" runat="server"> <MasterTableView CommandItemDisplay="Top"> <CommandItemSettings ShowExportToCsvButton="True" ShowExportToExcelButton="True" /> <Columns> <telerik:GridBoundColumn DataField="Id"HeaderText="Id" /> <telerik:GridBoundColumn DataField="Name"HeaderText="Name" /> </Columns> <PagerStyle AlwaysVisible="True"></PagerStyle> </MasterTableView> <PagerStyle AlwaysVisible="true" /> <ClientSettings> <DataBinding Location="~/mywebservice.asmx" EnableCaching="true" SelectMethod="GetFacilityListCH" /> </ClientSettings> </telerik:RadGrid>Hi all,
I am trying to add columns to my grid programmatically. It works OK with 1 column, but more than 1 throw an error about multiple controls with the same ID. I'm using the below code:
// Add columns programmatically GridBoundColumn boundColumn; int ii = 0; int ij = 0; foreach (DataRow row in dt.Rows) { // We only want to generate columns off the first row if (ii>0) continue; // Create the new column collection in our loop boundColumn = new GridBoundColumn(); foreach (DataColumn col in dt.Columns) { // Increment to pass the first columns ij++; // We don't want the first column because it's our identity (ID) column if (ij == 1) continue; boundColumn.DataField = col.ToString(); boundColumn.HeaderText = col.ToString(); // Add the column to our grid gvLUs.MasterTableView.Columns.Add(boundColumn); } ii++; } // Bind the data to the grid gvLUs.DataBind();
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="3%" ItemStyle-Width="3%"> <HeaderStyle Width="3%"></HeaderStyle> <ItemStyle Width="3%"></ItemStyle></telerik:GridClientSelectColumn><CommandItemTemplate> <td align="right" style="width: 20%">Selected Records:<asp:Label ID="lblselTsks" Width="20px" Font-Size="10pt" Font-Bold="true" runat="server" Text="0"></asp:Label> </td></CommandItemTemplate>protected void rg200_DataBound(object sender, EventArgs e) { foreach (GridDataItem item in rg200.MasterTableView.Items) { CheckBox chkBoxOne = (CheckBox)item.FindControl("ClientSelectColumn"); if (chkBoxOne != null) chkBoxOne.Attributes.Add("onclick", "javascript:return SelectOne('" + chkBoxOne.ClientID + "')"); } }JSfunction SelectOne(id) { var count = 0; count = Number(document.getElementById('ctl00_PagePlaceholder_rg200_ctl00_ctl02_ctl00_lblselTsks').innerHTML); if (document.getElementById(id).checked == true) { if (!document.getElementById(id).disabled) { count = count + 1; } } else if (document.getElementById(id).checked == false) { if (!document.getElementById(id).disabled) { count = count - 1; } } document.getElementById('ctl00_PagePlaceholder_rg200_ctl00_ctl02_ctl00_lblselTsks').innerHTML = count; }| <form id="form1" runat="server"> |
| <ajaxToolkit:ToolkitScriptManager ID="sm" runat="server" /> |
| <telerik:RadSplitter ID="globalsplit" runat="server" Orientation="Horizontal" FullScreenMode="True" LiveResize="True"> |
| <telerik:RadPane ID="globaltoolbar" runat="server" Locked="true"> |
| <telerik:RadToolBar ID="toolbar" runat="server"> |
| <Items> |
| <telerik:RadToolBarButton Text="Item 1" /> |
| <telerik:RadToolBarButton IsSeparator="true" /> |
| <telerik:RadToolBarButton Text="Item 2" /> |
| </Items> |
| </telerik:RadToolBar> |
| </telerik:RadPane> |
| <telerik:RadSplitBar ID="split1" runat="server" CollapseMode="None" /> |
| <telerik:RadPane ID="mainpan" runat="server"> |
| <telerik:RadSplitter ID="mainSplit" runat="server" Orientation="Vertical" |
| FullScreenMode="True" LiveResize="True"> |
| <telerik:RadPane ID="contentPane" runat="server"> |
| <p>Main place</p> |
| </telerik:RadPane> |
| <telerik:RadSplitBar ID="mainSplitBar" runat="server" CollapseMode="Backward" /> |
| <telerik:RadPane ID="schedulePan" runat="server" Width="260px" MinWidth="260" MaxWidth="260"> |
| [Scheduler] |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| </form> |
<%= Html.RadControlCss<RadCalendar>() %>
<%= Html.RadControlScripts<RadCalendar>() %>
<%= Html.RadControlCss<RadDateInput>() %>
<%= Html.RadControlScripts<RadDateInput>() %>
<%= Html.RadControlCss<RadTimeView>() %>
<%= Html.RadControlScripts<RadTimeView>() %>
<%= Html.RadControlCss<RadTextBox>() %>
<%= Html.RadControlScripts<RadTextBox>() %>
<%= Html.RadControlCss<RadDatePicker>() %>
<%= Html.RadControlScripts<RadDatePicker>() %>
<%= Html.RadControlCss<RadTimePicker>() %>
<%= Html.RadControlScripts<RadTimePicker>() %>
<%= Html.RadControlScripts<RadDateTimePicker>() %>
<%= Html.RadControlCss<RadComboBox>() %>
<%= Html.RadControlScripts<RadComboBox>() %>
<%= Html.RenderRadDatePicker((rad) =>
{
rad.ID = "StartDate";
rad.SelectedDate = DateTime.Today;
}, "Forest") %>
<%= Html.RenderRadTimePicker((rad) =>
{
rad.ID = "StartTime";
rad.SelectedDate = DateTime.Now;
}, "Forest") %>
Is this the cause of anything?
Thanks.