I am trying to use the toggleExpandCollapse client function and it seems to not work at all. I also am seeing console errors while trying settings to enable the toggleExpandCollapse function.
If I have a TreeList and set ExpandCollapseMode="combined" or "client" I get this error in the console as soon as I try to expand an item. The expanding does work, but collapsing does not, it gives the below error. On top of this if I set the ExpandCollapseMode to "client" the TreeList opens up with ALL items expanded out, but while in Server or Combined mode it does not. What am I doing wrong?
Uncaught TypeError: Cannot read property 'toggleExpandCollapse' of null
at HTMLButtonElement.onclick
Uncaught TypeError: Cannot read property 'Combined' of undefined
at Telerik.Web.UI.TreeListDataItem.initialize (Telerik.Web.UI.WebResource.axd
Here is the JS function I cam calling.
function collapseTree(radTreeListItemID) { debugger; var oTree = $find('<%= RadTreeList1.ClientID %>'); var keys = oTree.get_clientDataKeyNames(); oTree.get_dataItems().forEach(function (a) { var expanded = a.get_expanded(); var title = a.get_element().innerText; var id = a.get_dataKeyValue('ID'); // loop through all the items and locate the one with the matching input datakey. // set expanded to false.. doesnt seem to work.. setting visibility does. if (id == radTreeListItemID && expanded) { debugger; // Make invisible - works //a.set_visible(false); // this should just work but doesnt a.toggleExpandCollapse(); a.set_clientExpanded(false); // doesnt work.. however a work around may be to loop through the child items and make invisible. // onpostback, they are re-written to page anyway.. problem is user control seems to not go away, so youd have to // locate that control in the element and hide too. a.get_childItems().forEach(function (innerItem) { innerItem.set_visible(false); }); } }); };
We have many grids with a Footer with aggregates that work fine but this grid shows the footer but none of the aggregates display, in other words the footer is blank?
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
OnItemCreated="RadGrid1_ItemCreated"
OnItemDataBound="RadGrid1_ItemDataBound"
ShowFooter="true"
Width="1101px" AllowPaging="True" AllowSorting="True" AllowCustomPaging="True" PageSize="20">
<ClientSettings EnableRowHoverStyle="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" CommandItemSettings-ShowPrintButton="true" CommandItemSettings-ShowRefreshButton="true" CommandItemSettings-ShowExportToExcelButton="true">
<CommandItemSettings ShowAddNewRecordButton="False" ShowExportToCsvButton="true" ShowExportToExcelButton="true" ShowPrintButton="true" />
<Columns>
<telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" HeaderText="ID" SortExpression="ID" UniqueName="ID" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ClientID" FilterControlAltText="Filter ClientID column" HeaderText="ClientID" SortExpression="ClientID" UniqueName="ClientID" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="PractitionerID" FilterControlAltText="Filter PractitionerID column" HeaderText="PractitionerID" SortExpression="PractitionerID" UniqueName="PractitionerID" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Start" UniqueName="apptDT" Display="false">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Date" DataField="Start" UniqueName="AppointmentEdit" Visible="true" SortExpression="Start">
<ItemTemplate>
<asp:HyperLink ID="lnkStart" Text='<%# String.Format("{0:g}", DataBinder.Eval(Container.DataItem, "Start")) %>' runat="server"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="250px" HorizontalAlign="Center" Font-Size="9" />
<HeaderStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="lname" UniqueName="lname" Display="true" HeaderText="Practitioner">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="DESCRIPTION" UniqueName="DESCRIPTION" HeaderText="Services" Display="true">
<ItemStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Units" DataType="System.Int16" UniqueName="Units" HeaderText="Units" Display="true" Aggregate="Sum" FooterAggregateFormatString="{0:c}">
<ItemStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Status column" HeaderText="Status" SortExpression="Status" UniqueName="Status" Display="true">
<ItemStyle Width="100px" HorizontalAlign="Center" />
<HeaderStyle Width="100px" HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Tests" HeaderText="Tests" UniqueName="Tests" Display="true">
<ItemStyle Width="500px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="InvoiceIDX" UniqueName="InvoiceIDX" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="InvoiceAmount" HeaderText="Invoice Amount" SortExpression="InvoiceAmount" UniqueName="InvoiceAmount" DataFormatString="{0:c}" Aggregate="Sum" FooterText="$">
<ItemStyle Width="40px" HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="InvoiceAmountPaid" HeaderText="Amount Paid" SortExpression="InvoiceAmountPaid" UniqueName="InvoiceAmountPaid" DataFormatString="{0:c}" Aggregate="Sum" FooterText="$">
<ItemStyle Width="40px" HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" FilterControlAltText="Filter UnitPrice column" HeaderText="Unit Price" SortExpression="UnitPrice" UniqueName="UnitPrice" DataFormatString="{0:$#,##0.00}">
<ItemStyle Width="40px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Billable" DataType="System.Decimal" FilterControlAltText="Filter Billable column" HeaderText="Billable" SortExpression="Billable" UniqueName="Billable" DataFormatString="{0:$#,##0.00}" Aggregate="Sum" FooterText="$">
<ItemStyle Width="40px" />
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
sorry eng not good. i took telerik valuation project from developer, new to telerik.
radsplitter on usercontrol and doesnt resize to screen width at 100% when loaded. once screen resizes from user mouse then radsplitter shows and adjusts to 100%. please see code to duplicate your bug. please advise workaround
page with control
<asp:Content ID="Content1" ContentPlaceHolderID="ChildContent" runat="server"> <div style="width: 600px; height: 600px;"> <div id="divtest" style="display: block"> <telerik:RadButton runat="server" ButtonType="ToggleButton" ToggleType="Radio" Text="test 1" AutoPostBack="false" Font-Size="Medium" OnClientCheckedChanged="OnClientCheckedChanged" Height="16px" GroupName="test" /> <telerik:RadButton runat="server" ButtonType="ToggleButton" ToggleType="Radio" Text="test 2" AutoPostBack="false" Font-Size="Medium" OnClientCheckedChanged="OnClientCheckedChanged" Height="16px" GroupName="test" /> </div> <div id="div-safeharborContrib" style="display: none; background-color: lightgreen;"> <ucPSWTest:ucTest ID="ucTest" runat="server" /> </div> </div><telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> //![CDATA[ function OnClientCheckedChanged(sender, args) { $("#divtest").fadeOut("slow", function () { $("#div-safeharborContrib").fadeIn("slow", function () { }); }); } //]]> </script></telerik:RadScriptBlock>
control uctest
<telerik:RadSplitter runat="server" ResizeMode="Proportional" Orientation="Vertical" Width="100%" Height="650px" VisibleDuringInit="false"> <telerik:RadPane runat="server" Width="25%" /> <telerik:RadSplitBar runat="server" CollapseMode="Forward" /> <telerik:RadPane runat="server" BorderStyle="None" BorderWidth="0" Width="75%"> <div>test</div> </telerik:RadPane> <telerik:RadSplitBar runat="server" CollapseMode="Backward" /> <telerik:RadPane runat="server" Width="25%" Height="100%" BackColor="#fffed0" /> </telerik:RadSplitter>


Hi,
I get errors when the control is created in design View modus.
In the web.config-file is the following:
<add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
I have attached a screenshot, that shows the problem.
What is the problem?

I went thru the sample here: https://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxloadingpanel/how-to/show-ajaxloadingpanel-on-initial-page-load
... on how to get a "Loading Panel" to show on a Page_Load ... problem is the sample code doesn't work primarily because the AjaxRequest doesn't fire until AFTER the Page_Load completes making it useless for my needs.
In my Page_Load event I load some complex data from a SQL server and then bind to a grid, however the loading of the complex data can take anywhere from 3-5 seconds. I need to present the user with a "Loading..." message "as the page loads".
I suppose I could move my long process into the AjaxRequest routine but is that the intended use?
Cheers, Rob.
Hello,
I've created a new GridColumn that inherits the Gridboudcolumn.
This new column contains a HtmlGenericControl (containing the text) and an image with some javascript on the client click event. Everything works fine excepts when I want to export the datas in Excel. The value is always empty.
As a workaround, I put an image with 0px height and 0px with as the first control of the cell and set the AlternateText property of this image, that does the trick but this is not a valid solution for us.
How can I do this in the good way ?
Best regards
Alexandre Stoppani
This is the code of my class:
using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace Ch.Ne.Ceg.Library.Web.WebControls.Sfwk.SFWKGrid
{
public class MailReadOnlyColumn : GridBoundColumn
{
#region Events
public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem)
{
if (inItem is GridDataItem item)
{
if (cell != null && cell.Controls.Count > 0)
{
cell.Controls.Clear();
}
if (cell != null)
cell.Text = "";
var alienSpan = new HtmlGenericControl();
var nobr = new HtmlGenericControl("nobr");
nobr.Attributes["class"] = "MailReadOnlyColumnNoBold";
var imageHiddenForExport = new ImageButton
{
Visible = true,
Height = new Unit(0),
Width = new Unit(0),
CommandName = "RowClick",
CommandArgument = item.ItemIndex.ToString(),
ImageAlign = ImageAlign.Middle,
ImageUrl = cell?.Page.ClientScript.GetWebResourceUrl(GetType(), "Ch.Ne.Ceg.Library.Web.WebControls.Images.milieu.png")
};
var image = new ImageButton
{
Visible = true,
Height = new Unit(0),
Width = new Unit(0),
CommandName = "RowClick",
CommandArgument = item.ItemIndex.ToString(),
ImageAlign = ImageAlign.Middle
};
image.Style.Add(HtmlTextWriterStyle.PaddingLeft, "6px");
image.Style.Add(HtmlTextWriterStyle.Height, "9px");
image.Style.Add(HtmlTextWriterStyle.Width, "14px");
image.Style.Add(HtmlTextWriterStyle.PaddingTop, "8px");
image.Style.Add(HtmlTextWriterStyle.Cursor, "default");
nobr.Controls.Add(alienSpan);
nobr.Controls.Add(image);
if (cell != null)
{
cell.DataBinding += cell_DataBinding;
cell.Controls.Add(imageHiddenForExport);
cell.Controls.Add(nobr);
}
}
else
{
base.InitializeCell(cell, columnIndex, inItem);
}
}
void cell_DataBinding(object sender, EventArgs e)
{
if (!(sender is TableCell cell))
return;
var parent = cell.NamingContainer as GridDataItem;
var imageHiddenForExport = cell.Controls[0] as ImageButton;
var lbl = cell.Controls[1].Controls[0] as HtmlGenericControl;
var imgButton = cell.Controls[1].Controls[1] as ImageButton;
if (parent == null)
return;
var t = parent.DataItem.GetType();
var p = t.GetProperty(DataField);
if (p == null)
return;
var value = (string)p.GetValue(parent.DataItem, null);
if (lbl != null)
lbl.InnerText = string.IsNullOrEmpty(value) ? "-" : value;
if (imageHiddenForExport != null)
imageHiddenForExport.AlternateText = value;
if (imgButton != null)
{
if (string.IsNullOrEmpty(value))
{
imgButton.ImageUrl = null;
imgButton.Enabled = false;
imgButton.Visible = false;
}
else
{
imgButton.ImageUrl = ((TableCell)sender).Page.ClientScript.GetWebResourceUrl(GetType(), "Ch.Ne.Ceg.Library.Web.WebControls.Images.enveloppe.png");
imgButton.AlternateText = value;
imgButton.OnClientClick = "mywindow=window.open('mailto:" + value + "'); if(mywindow != null) mywindow.close(); return false;";
imgButton.Visible = true;
imgButton.Enabled = true;
}
}
}
#endregion
}
}

I have a that lists fax numbers and have it formatted to look like a table. I would like when they click on the delete.png it would delete out of the database they clicked on. Should it be done via code behind or via the SQL connection? Not sure of how to go about this.
<telerik:RadComboBox runat="server" ID="_Phone1" Height="100px" Width="450px" DataTextField="FaxNum" DataValueField="FaxNum" DataSourceID="DataSource1" EnableLoadOnDemand="false" DropDownCssClass="exampleRadComboBox" AllowCustomText="true" OnClientLoad="attachPaste" ValidationGroup="Group1" Filter="StartsWith" EmptyMessage="Enter fax number or search favorites"> <HeaderTemplate> <ul> <li class="col1">Description</li> <li class="col2">Fax #</li> <li class="col3">Last Sent</li> </ul> </HeaderTemplate> <ItemTemplate> <ul> <li class="col1"> <%# DataBinder.Eval(Container.DataItem, "Description") %></li> <li class="col2"> <%# DataBinder.Eval(Container.DataItem, "FaxNum") %></li> <li class="col3"> <%# DataBinder.Eval(Container.DataItem, "LastSent") %></li> <li class="col4"><img runat="server" src="~/images/Delete.png" /> <%# DataBinder.Eval(Container.DataItem, "FaxFavID") %></li> </ul> </ItemTemplate> </telerik:RadComboBox><asp:SqlDataSource ID="DataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FMS_Conn %>" SelectCommandType="StoredProcedure" SelectCommand="Modules.sp_getFaxFav"> <SelectParameters> <asp:SessionParameter Name="iUser_Id" SessionField="user_id" Type="String" /> </SelectParameters></asp:SqlDataSource>I have ShowFooter property set to true and in code ShowFullTime= true
In UI bydefault its showing 24 hours format and on footer its showing Show Business hours. when clicked on ShowBusinessHours Its showing 12 hours format and on footer its showing button with label show 24 hours but ,when clicked on show 24 hours its not happening.Do I need to make any code change to show 24 hours.
One more help.In Left side ruler I want show time 24 hours like 12:00pm,01:00pm now its showing 12pm,1pm how to make changes for ASP.net webapplication.
When searched on forum i got we need to make change using RulerPrimitive and FormatStrings But this is for Windows forms how i can i make change for asp.net ajax