Hello, is there a way to limit how many checkbox buttons can be selected at one time by the client/enduser? We have a page that displays more than 10 buttons at a time (all brought in server side). The buttons are set up as Telerik RadButtons ButtonType="StandardButton" ToggleType="Checkbox". When the buttons are clicked they open up videos that get displayed at the top of the page and get put into a div. We have 5 spaces for the videos to display at the top of the page. I used CheckBox because of the selected/notselected (on/off) functionality. I want to limit the user to only selecting 5 buttons at a time. If the user has 5 buttons selected and tries to click the 6th one, a message should appear that tells them only 5 can be selected at a time. They can "turn off" unselect one of the buttons if they want to select another one. I'm having trouble figuring out how to approach this. Client side or code behind? Any help is appreciated, thanks!
<ItemTemplate>
<div class="itemWrapper">
<telerik:RadButton
RenderMode="Lightweight"
runat="server"
OnCommand="videoClicked"
CommandArgument='<%# Eval("videoId") %>'
ButtonType="StandardButton"
ToggleType="CheckBox"
ID="RadToggleButton1"
AutoPostBack="true">
<ToggleStates>
<telerik:RadButtonToggleState SecondaryIconCssClass="rbOk" Text="Selected" Value="selectedButton"></telerik:RadButtonToggleState>
<telerik:RadButtonToggleState Text="Not Selected" Value="notSelectedButton"></telerik:RadButtonToggleState>
</ToggleStates>
</telerik:RadButton>
ButtonType="StandardButton" ToggleType="CheckBox"
Current state:
What I need the button to do:
My example code below shows what I have so far. I don't know if this should be done client side or code behind? Any suggestions are welcomed.
aspx code:
<ItemTemplate>
<div class="itemWrapper">
<telerik:RadButton
RenderMode="Lightweight"
runat="server"
OnCommand="videoClicked"
CommandArgument='<%# Eval("videoId") %>'
ButtonType="StandardButton"
ToggleType="CheckBox"
ID="RadToggleButton1"
AutoPostBack="true">
<ToggleStates>
<telerik:RadButtonToggleState SecondaryIconCssClass="rbOk" Text="Selected" Value="selectedButton"></telerik:RadButtonToggleState>
<telerik:RadButtonToggleState Text="Not Selected" Value="notSelectedButton"></telerik:RadButtonToggleState>
</ToggleStates>
</telerik:RadButton>
</div>
</ItemTemplate>
Hi, has anybody come across an issue with the RadEditor causing an entire Ajax update panel to fail on an async postback?
This only happens if the RadEditor has been generated dynamically, if I have it on a user control, it' snot a problem. Unfortunately the large legacy code base I'm working with generates a rad editor in a server control.
And has only started happening since Safari V14, it works fine on other browsers.
This can be created using a very simple form.
I'm currently using VB in visual studio 2019 , targeting framework 4.7
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:Label ID="Label2" runat="server" Text="Outside The Panel"></asp:Label>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
<asp:Label ID="Label1" runat="server" Text="Inside the Panel"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2"/>
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Sync"/>
<asp:Button ID="Button2" runat="server" Text="ASync"/>
</div>
</form>
with a very simple code behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
function PendingRowSelected(row) {
var guid = $find("<%=PendingRadGrid.ClientID%>").get_masterTableView().get_selectedItems()[0].getDataKeyValue("Guid");
var radWindow = Quest.Utilities.WindowUtil.openRADWindow("PendingEditWindow", "Portlets/ConnectData/PendingEdit.aspx?id=" +guid); //radWindow value as undefined
radWindow.Restore();
var close = document.getElementById("CloseButton" + radWindow.Id);
close.onclick = CloseRadWindow;
}
Can anyone please help to resolve?
Attacted File : Problem1.png, Problem.png
ASP.NET Web, Radgrid
Is the grammar below correct?
string sProductCode;
sProductCode = gvDetail.Items[8].FindControl("D_11").ToString();
please help me
<ClientSettings EnablePostBackOnRowClick = "true">
<Selecting CellSelectionMode="MultiCell" />
<ClientEvents OnCellSelected="cellSelected" />
function cellSelected(sender, args) {
protected void gv_ItemConmmand(object source, GridCommandEventArgs e)
I have just downloaded and installed the demo for ASP .NET/AJAX.
When I try to run it gives me three errors (and seven warnings):
What do I need to do to get this demo working on my PC using Visual Studio 2017?
hi sir,
i have dynamically creted a dountchart radhtmlchart in code behind , now i want to wrap the text. I the data length is too large then the chart go smaller example is show below, otherwise is normal.
I need solution ASAP
the sample code:
Dim chart As New RadHtmlChart
chart.ID = "chart"
chart.PlotArea.XAxis.LabelsAppearance.RotationAngle = 75
chart.PlotArea.XAxis.DataLabelsField = _ChartSeriesFieldTitlexaxis
chart.PlotArea.Series.Clear()
Dim series As New DonutSeries
series.NameField = _ChartSeriesFieldTitlexaxis
series.DataFieldY = _ChartDataFieldTitle
chart.PlotArea.Series.Add(series)
chart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "d"
chart.PlotArea.XAxis.BaseUnit = DateTimeBaseUnit.Days
chart.PlotArea.XAxis.TitleAppearance.Text = _ChartSeriesFieldTitlexaxis
chart.PlotArea.YAxis.TitleAppearance.Text = _ChartDataFieldTitle
chart.DataSource = firstTable
chart.DataBind()
Hello.
I need help.
I need the coordinates of Column + Row of the selected cell in Radgrid.
Is the syntax of the source I attached correct?
please reply.
keep waiting for your reply
I want to communicate with client side and server side.
In Server Side(ASP.NET),
<ClientSettings>
<Selecting CellSelectionMode="MultiCell" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>
In JavaScript,
function cellSelected(sender, args)
{
var selectedRow = args.get_row();
var selectedColumn = args.get_column();
var dataItem = args.get_gridDataItem();
var tableView = args.get_tableView();
var cellIndex = args.get_cellIndexHierarchical();
var output = String.format("The selected cell is located in column with name: " + selectedColumn.get_uniqueName() + " and in row with index: " + dataItem.get_itemIndexHierarchical() + ". This cell has index " + cellIndex + " and it is part from " + tableView.get_name() + ".");
sender.get_masterTableView().fireCommand("cellSelected", ????????????? );
}
Is the syntax of the source I attached correct?
To get the Selected Column&Row Coordinate
Client Side (aspx.cs)
protected void gv_ItemConmmand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "cellSelected")
{
var clickedColumnName = e.CommandArgument.ToString();
// Label1.Text = clickedColumnName;
}
}
Do you have any other code from this source?
In Server Side
<ClientSettings>
<Selecting CellSelectionMode="MultiCell" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>
In Client Side
protected voidRadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "CellClick")
{
var selectedColumn = e.Item.selectedColumn.get_uniqueName();
var selectedRow = e.Item.get_row();
}
}
Is the syntax of the source I attached correct?
Hello,
I have a scenario where I would like to create columns dynamically and have filters on that grid. So far, when I set the AllowFilteringByColumn to true and create the column dynamically at the OnNeedDataSource event. I receive an error when I try to filter "Expression Expected".
If I take that same column and declare it aspx page, I can filter no problem.
<telerik:RadGrid ID="rgPortfolio" runat="server"
AllowFilteringByColumn="true" MasterTableView-AllowPaging="true" PagerStyle-AlwaysVisible="true"
AllowSorting="true" AllowPaging="true" AutoGenerateColumns="false"
OnNeedDataSource="rgPortfolio_NeedDataSource"
OnColumnCreated="rgPortfolio_ColumnCreated">
<MasterTableView AllowFilteringByColumn="true" DataKeyNames="Id">
<Columns>
<%--<telerik:GridBoundColumn UniqueName="Cusip" DataField="Cusip"></telerik:GridBoundColumn>--%>
</Columns>
</MasterTableView>
</telerik:RadGrid>
private void BuildGridColumns()
{
rgPortfolio.Columns.Clear();
var col = new GridBoundColumn();
col.UniqueName = "cusip";
col.HeaderText = "cusip";
col.DataField = "cusip";
rgPortfolio.MasterTableView.Columns.Add(col);
}
protected void rgPortfolio_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
BuildGridColumns();
rgPortfolio.DataSource = Reporting.Investor.GetActivePortfolioItems();
}