We have wrapped the .Net TreeList control for our application. Once the ASP page is loaded and starts execution, we get on error stating that the ClientSettings.ClientEvents handlers are undefined. We have tried declaring the event handlers in the TreeList declaration of the TreeList in the .ascx file and setting the event handlers at run time in the .ascx.vb file.
We tried registering the client scripts which I don’t like having to place an entire function in a string. We have placed the reference function in the .ascx file and in a separate file which is then included in the outer .aspx file.
We have just upgraded to the latest version last week. I’m not sure what version. From Visual Studio, the Telerik About menu doesn’t display version information, just an advertisement.
What is the proper method of creating a user control with client side event handlers? We found several similar questions posted, but none of the answers appear to work for this version.
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below. |
<telerik:RadGrid ID="radgrid1" AutoGenerateColumns="False" runat="server" GridLines="None" Skin="Office2007" CellSpacing="0" DataSourceID="radgrid1DataSource" OnItemInserted="radgrid1_ItemInserted" AllowAutomaticInserts="true" OnItemDataBound="radgrid1_ItemDataBound" OnItemCommand="radgrid1_ItemCommand" AllowAutomaticDeletes="true" ValidationSettings-EnableValidation="false"> <MasterTableView DataKeyNames="KeyID" EditMode="InPlace" AllowAutomaticInserts="true" AllowAutomaticDeletes="true"> <Columns> <telerik:GridBoundColumn DataField="KeyID" Visible="false" UniqueName="KeyID" HeaderText="<%$ Resources:GlobalResources, KeyID %>" /> <telerik:GridBoundColumn DataField="ProjectID" Visible="false" UniqueName="ProjectID" HeaderText="<%$ Resources:GlobalResources, ProjectID %>" /> <telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="<%$ Resources:GlobalResources, Name%>" /> <telerik:GridNumericColumn DataField="InitialAmount" NumericType="Number" DataFormatString="{0:N}" DecimalDigits="2" UniqueName="InitialAmount" HeaderText="<%$ Resources:GlobalResources, InitialAmount%>" /> <telerik:GridTemplateColumn UniqueName="CurrencyCode" ItemStyle-Width="260px" HeaderText="<%$ Resources:GlobalResources, CurrencyCode %>"> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "CurrencyCode") %> </ItemTemplate> <EditItemTemplate> <cc:CurrencyDropDownList ID="ddlCurrency" runat="server" IsAlertsVisible="false" IsLockVisible="false" IsHistoryVisible="false" IsFieldLabelVisible="false" IsReadOnly="false" IncludeNullValue="false" MyDropDownList-SelectedValue='<%# Bind("CurrencyCode") %>' /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridCheckBoxColumn DataField="ToDelete" UniqueName="ToDelete" HeaderText="Delete" /> <telerik:GridEditCommandColumn ButtonType="PushButton" InsertText="Confirm" EditText="Edit" CancelText="Cancel" UniqueName="EditCommandColumn" /> </Columns> <NoRecordsTemplate> No Records Found. </NoRecordsTemplate> <CommandItemTemplate> <table cellpadding="5" style="width: 100%"> <tr> <td align="left"> <asp:LinkButton ID="btnAddNewRecord" runat="server" CommandName="InitInsert"> <img style="border:0px" alt="" src="../Images/add.png" />Add New Record </asp:LinkButton> </td> <td align="right"> <asp:LinkButton ID="btnDeleteSelected" runat="server" CommandName="DeleteSelected" OnClientClick="javascript:return confirm('Delete all selected records?')"> <img src="../Images/delete.png" alt="" style="border:0px" />Delete Selected </asp:LinkButton> </td> </tr> </table> </CommandItemTemplate> </MasterTableView></telerik:RadGrid>protected void Page_Load(object sender, EventArgs e) { if (this.IsInEditMode) { for (int i = 0; i < this.radgrid1.PageSize; i++) { this.radgrid1.EditIndexes.Add(i); } this.radgrid1.Columns.FindByUniqueName("ToDelete").Visible = true; this.radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Bottom; } else { this.radgrid1.Columns.FindByUniqueName("ToDelete").Visible = false; this.radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; } }protected void radgrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e != null) { if (e.Item is GridDataItem && !e.Item.IsInEditMode) { GridDataItem item = e.Item as GridDataItem; Button editButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0]; editButton.Visible = false; } else if (e.Item is GridDataInsertItem && e.Item.IsInEditMode) { GridDataInsertItem item = e.Item as GridDataInsertItem; Button insertButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0]; Button cancelButton = (Button)item.Controls[item.Controls.Count - 1].Controls[2]; insertButton.Visible = true; cancelButton.Visible = true; } else if (e.Item is GridDataItem && e.Item.IsInEditMode) { GridEditableItem item = e.Item as GridEditableItem; Button editButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0]; Button cancelButton = (Button)item.Controls[item.Controls.Count - 1].Controls[2]; editButton.Visible = false; cancelButton.Visible = false; } } }<telerik:GridHyperLinkColumn .... UniqueName="CustomerNumber" Groupable="False"> <FilterTemplate> <vtx:GridFilter ID="CustNumFilter" Field="CustomerNumber" runat="server"/> </FilterTemplate></tlk:GridHyperLinkColumn>| <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="monthschedule.ascx.cs" Inherits="com.epam.epm3ie.uc.artist.MonthSchedule" %> | |
| <%@ Reference Control="tooltip.ascx" %> | |
| <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional" > | |
| <ContentTemplate> | |
| <telerik:RadScheduler runat="server" ID="radScheduler" Width="750px" DayStartTime="09:00:00" DayEndTime="22:00:00" | |
| DataKeyField="UniqueID" DataSubjectField="eventName" DataStartField="startTime" DataEndField="endTime" | |
| MonthView-VisibleAppointmentsPerDay="10" Culture="<%# UserCulture %>" FirstDayOfWeek="<%# UserFirstDayOfWeek %>" | |
| SelectedView="MonthView" AllowDelete="false" MonthView-AdaptiveRowHeight="true" MonthView-HeaderDateFormat="MMMM yyyy" | |
| OverflowBehavior="Expand" OnAppointmentDataBound="radScheduler_AppointmentDataBound" | |
| StartEditingInAdvancedForm="false" OnClientAppointmentInserting="OnClientAppointmentInserting" | |
| OnClientAppointmentEditing="OnClientAppointmentEditing" OnNavigationComplete="radScheduler_NavigationComplete" | |
| OnAppointmentCreated="radScheduler_AppointmentCreated" OnDataBound="radScheduler_DataBound"> | |
| <Localization AdvancedAllDayEvent="All day"></Localization> | |
| <AdvancedForm Modal="true" /> | |
| <TimelineView UserSelectable="false" /> | |
| </telerik:RadScheduler> | |
| <telerik:RadToolTipManager runat="server" ID="radToolTipManager" Width="320" Height="170" | |
| Animation="None" HideEvent="LeaveToolTip" Text="Loading..." | |
| OnAjaxUpdate="radToolTipManager_AjaxUpdate" OnClientBeforeShow="clientBeforeShow" /> | |
| </ContentTemplate> | |
| </asp:UpdatePanel> |
Hi
I'd like some guidance on the best approach to solve a problem with a rad dropdown field in a rad grid.
I have an aspx page in which there is a rad tabstrip with two radtabs.
The contents of the selected rad tab is a radgrid that is programmatically generated ON THE SERVER SIDE, in the code behind.
Each row in the grid can be edited. The editing feature is implemented by a button in the grids command panel labeled Edit.
When pressed, an ItemDataBound event is fired on the server side, it then seeks the column to be converted to a dropdown, in the currently selected row and modifies it into a radcombobox. I'm new to telerik so I'm not certain if the radcombox has a text mode for display and a dropdown for edit. It does not appear that the specific cell has a unique name, it is identified by selected row and column name only.
My issue is that often, the width of the column is less than the width of the GridDropDown control resulting in the drown down button on the right of the control to not appear unless the width of the column is increased. The documentation suggests that the way to correct this is to issue a repaint() of the client side control.
I have several questions:
Since this conversion of the display from text to dropdown is done on the server side, how do obtain the client side control to issue a repaint()?
Is there jquery selector that will just find all the raddropdown controls on the page and refresh them all (sort of like selecting all div tags)? What is the syntax? and how do I fire it after the server side has made the change to edit mode?
Thanks. I really appreciate all suggestions.
Dim fId As New GridGroupByField fId.FieldName = "ID" fId.Aggregate = GridAggregateFunction.Count fId.FormatString = "({0})" fId.HeaderValueSeparator = " " fId.HeaderText = " "Dim expr As New GridGroupByExpressionDim fState As New GridGroupByFieldfState.FieldAlias = "State"fState.FieldName = "GroupState"fState.FormatString = "{0}"expr.SelectFields.Add(fState)expr.SelectFields.Add(fId)Dim fGroupState As New GridGroupByFieldfGroupState.FieldName = "GroupState"expr.GroupByFields.Add(fGroupState)MyGrid.MasterTableView.GroupByExpressions.Add(expr)