Hi I have a radlistbox with SelectionMode="Multiselect". I want to get the count of checked items of listbox on button click. I tried to get the count by finding control on button click event but i am not able to find the control.
HTML Code:
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
<div>
<asp:Table>
<asp:TableRow>
<asp:TableHeaderCell>
<telerik:RadLabel ID="RadLabel_abc" runat="server" Text="ABC"></telerik:RadLabel>
</asp:TableHeaderCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<telerik:RadListBox ID="rlbAbc" runat="server"
Height="100px"
Width="480px"
AllowTransfer="false"
AllowTransferOnDoubleClick="false"
TransferToID="rlbChosen"
EnableDragAndDrop="true"
OnClientTransferring="rlbAbc_OnClientTransferring"
CheckBoxes="true"
ButtonSettings-ShowTransferAll="false"
EnableViewState="false"
SelectionMode="Multiple"/>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</telerik:RadAjaxPanel>
.VB File
Protected Sub RadButton_AddToList_Click(sender As Object, e As EventArgs)
GetSelectedItemText("rlbABC")
End Sub
Public Function GetSelectedItemText(ByVal controlID As String) As String
Dim theListbox As RadListBox = CType(FindControl(controlID), RadListBox)
For idx As Integer = 0 To theListbox.Items.Count - 1
Dim li As RadListBoxItem = theListbox.Items(idx)
If theListbox.Items(idx).Selected = True Then
Return theListbox.Items(idx).Text
End If
Next
Return Nothing
End Function
But I am not able to find control. Can anyone suggest a better way to do this. My main objective is to get count of checked items of list box on button click
We need to disable embedded JQuery used in latest Telerik UI for ASP.NET AJAX 2017.3.913 library since it is using old jQuery version (version 1.11.1) and we have been advised to refer to disabling the embedded jQuery to do it (Ticket ID:1143165).
Unfortunately disabling it through web.config Telerik.ScriptManager.EnableEmbeddedjQuery key doesnt work. The application still loads old jQuery file.
We cannot use following suggestion to disable embedded jQuery since existing application is heavily depend on <asp:ScriptManager> and changing it to <telerik:RadScriptManager> breaks the existing code.
Disable the built-in jQuery on a concrete page.
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
EnableEmbeddedjQuery
=
"false"
><
Scripts
><
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/><
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryExternal.js"
/><
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryPlugins.js"
/></
Scripts
></
telerik:RadScriptManager
>
Appreciate if you could help us with this.
Thanks
Lak
Hi
How to Solve Export To PDF Using RadClientExportManager For RadHtmlChart
not support Persian Characters in Export PDF Using "RadClientExportManager"
As pictured below :
Attached file
Is there another way : Client Side OR Server Side
RadInput: Understanding the Single Rendering HTML Output and CSS Styling
Updated almost the whole content.
RadPivotGrid: Range Grouping in RadPivotGrid
Added ShowGroupsWhenNoData property.
RadListBox
Added code examples in the following articles:
RadAsyncUpload
Added code examples in the following articles:
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement)
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
I have a base page that opens a RadWindow (here called WINDOW1) with this code, and with this close event attached:
private btnAddFarmacoClick(): void {
window.DeskDataEditing(
true
);
var
url = `${
this
.schedaRicFarmaGestFarmacoUrl}?IdItem=-1&IdFarmaco=-1`;
let oBrowserWnd = window.GetRadWindow();
setTimeout(() => {
let oWnd: t.RadWindow = oBrowserWnd ? oBrowserWnd.BrowserWindow.radopen(url,
"wSchedaRicGestFarm"
) : window.radopen(url,
"wSchedaRicGestFarm"
);
oWnd.moveTo(10, 10);
oWnd.set_height(400);
oWnd.set_width(700);
oWnd.set_modal(
true
);
oWnd.set_title(
"Titolo"
);
oWnd.set_visibleTitlebar(
true
);
oWnd.set_visibleStatusbar(
false
);
oWnd.set_behaviors(t.WindowBehaviors.Move | t.WindowBehaviors.Close);
oWnd.remove_close(
this
.farmacoRiconciliazioneClose$dlg);
oWnd.add_close(
this
.farmacoRiconciliazioneClose$dlg);
//oWnd.set_destroyOnClose(true);
}, 0);
}
private farmacoRiconciliazioneClose(oWnd: any, args: any): void {
oWnd.remove_close(
this
.farmacoRiconciliazioneClose$dlg);
var
arg = args.get_argument();
if
(arg !=
null
) {
//DO THINGS
}
}
Then, in WINDOW1, i open another rad window (WINDOW2) with this script and event attached:
private ricercaFarmacoClick(): void {
let url = `${
this
.ricercaFarmaciUrl}?Close1Step=1&idTest=-1`;
let oBrowserWnd = window.GetRadWindow();
setTimeout(() => {
let oWnd: t.RadWindow = oBrowserWnd ? oBrowserWnd.BrowserWindow.radopen(url,
"wSchedaRicFarmRicercaFarmaco"
) : window.radopen(url,
"wSchedaRicFarmRicercaFarmaco"
);
oWnd.moveTo(10, 10);
oWnd.set_height(570);
oWnd.set_width(800);
oWnd.set_modal(
true
);
oWnd.set_visibleStatusbar(
false
);
oWnd.set_behaviors(t.WindowBehaviors.Move | t.WindowBehaviors.Close);
oWnd.remove_close(
this
.ricercaFarmacoClose$dlg);
oWnd.add_close(
this
.ricercaFarmacoClose$dlg);
//oWnd.set_destroyOnClose(true);
}, 0);
}
private ricercaFarmacoClose(oWnd, args): void {
oWnd.remove_close(
this
.ricercaFarmacoClose$dlg);
let arg = args.get_argument();
if
(arg !=
null
) {
//DO THINGS
}
}
In WINDOW2 i open a third rad window (WINDOW3) with no event attached:
private dettaglioFarmacoClick(sender: any) {
if
(sender && sender.currentTarget) {
let idFarmaco = sender.currentTarget.getAttribute(
"data-id-farm"
);
let url = `${
this
.dettaglioFarmacoUrl}?IdFarmaco=${idFarmaco}`;
let oBrowserWnd = window.GetRadWindow();
setTimeout(() => {
let oWnd = oBrowserWnd ? oBrowserWnd.BrowserWindow.radopen(url,
"wRicercaFarmaciDettaglioFarmaco"
) : window.radopen(url,
"wRicercaFarmaciDettaglioFarmaco"
);
oWnd.moveTo(10, 10);
oWnd.set_height(600);
oWnd.set_width(800);
oWnd.set_modal(
true
);
oWnd.set_visibleStatusbar(
false
);
oWnd.set_behaviors(t.WindowBehaviors.Move | t.WindowBehaviors.Close);
oWnd.set_destroyOnClose(
true
);
}, 0);
}
}
WINDOW3 has nothing special: some readonly data, and can be closed by the X of the rad window itself and from a button that does this:
function
CloseModal() {
setTimeout(
function
() {
GetRadWindow().close();
}, 0);
}
The problem occurs whem i close WINDOW3:
i expect nothing to happen, instead the ricercaFarmacoClose of WINDOW1 is called. Obviously this beahviour causes all the chain of events to break.
I tried adding and removing all the destroyonclose without success. It's been 4 days of debugging, trying and failing at solving this problem.
Is there something i am missing?
Tanks in advance
Hi,
We are using RadHtmlChart - BarSeries for one of our requirements. We would like to show a custom tool tip when user mouser overs on y-axis but not on the bar chart.
Please see the attached image. When user moves the cursor on circled area on y-axis on the graph, we would like to show some custom tool tip.
Kindly help on this.
We are referring the following below link:
https://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/barchart/defaultcs.aspx
Thanks,
Srinivas Merugu