I can reference ButtonType="LinkButton" in the ItemDataBound method but not a ButtonType="PushButton"? I can't seem to locate the correct reference for PushButton?
This works but only for LinkButton
Dim ditem As GridDataItem = CType(e.Item, GridDataItem)
Dim ReserveButton As LinkButton = CType(ditem("gbtc_Reserve").Controls(0), LinkButton)
This triggers and error:
Dim ditem As GridDataItem = CType(e.Item, GridDataItem)
Dim ReserveButton As RadPushButton = CType(ditem("gbtc_Reserve").Controls(0), RadPushButton)
Cheers, Rob.
I have a RadGrid and a button.
In the RadGrid, one column is a GridClientSelectColumn.
I have tried to have a javascript function to enable/disable the button depending on whether one or more rows are selected.
It will however fail to find the button, because $find will return null. Why?
aspx:
<telerik:RadGrid ID="grdActivitiesToCopy" Skin="Metro" AutoGenerateColumns="False" AllowMultiRowSelection="True" runat="server"> <MasterTableView DataKeyNames="id" ClientDataKeyNames="id"> <Columns> <telerik:GridClientSelectColumn UniqueName="DetailCheckColumn" /> </Columns> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="true" /> <ClientEvents OnGridCreated="on_grid_created()"></ClientEvents> </ClientSettings> </telerik:RadGrid><div style="padding-top: 14px"> <telerik:RadButton Text="Copy" ID="btnCopy" runat="server"/></div>javascript:
var btnCopyId = "<%=btnCopy.ClientID %>";function on_grid_created(){ $(":checkbox").on('change', function () { update(); }); update(); function update() { var enabled = $(":checkbox:checked").length > 0; $find(btnCopyId).set_enabled(enabled); }}
I have created radwizardsteps dynamically, which is in a user control, onstep change i am creating another rad wizard with 4 steps dynamically and every step contains a dynamic table. Now the problem is if i make a another ajax request the controls in the 2nd wizard getting destroyed, how can i maintain this controls can someone help out to resolve this.
Thanks.
Usercontrol.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WizardUCDemo.ascx.cs" Inherits="WebUIFrameWork.UITemplate.WizardUCDemo" %><telerik:RadCodeBlock runat="server" ID="RadCodeBlock1"><script type="text/javascript"> function OnWizardstepChange() { var radManager = null; var stepIndex = $find("<%= wizardControl.ClientID %>").get_activeIndex(); radManager = $find('<%=RadAjaxManager.GetCurrent(this.Page).ClientID%>'); radManager.ajaxRequest("StepChange&"+stepIndex); }</script></telerik:RadCodeBlock><telerik:RadWizard runat="server" RenderMode="Lightweight" ID="wizardControl" OnClientButtonClicked="OnWizardstepChange" DisplayProgressBar="false" ProgressBarPosition="Right" NavigationBarPosition="Right" NavigationButtonsPosition="Bottom" DisplayNavigationButtons="false"></telerik:RadWizard>
Usercontrol.ascx.cs:
public void GenerateSteps(){ for (int i = 1; i < 5; i++) { Step = new RadWizardStep(); Step.ID = "Step_" + i.ToString(); Step.ClientIDMode = ClientIDMode.Static; Table = new Table(); Table.ID = "Table" + i.ToString(); Table.ClientIDMode = ClientIDMode.Static; newStep.Controls.Add(newTable); UIControlsWizard.WizardSteps.Add(newStep); }aspx:
<telerik:RadCodeBlock runat="server"><script type="text/javascript"> function testMethod() { $find("<%= RadAjaxManager1.ClientID%>").ajaxRequest("demo") }</script></telerik:RadCodeBlock><telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="wizardControl"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="wizardControl" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager> <table> <tr> <td> <uc1:WizardUCDemo runat="server" ID="WizardUCDemo1" /> </td> <td> <telerik:RadWizard runat="server" RenderMode="Lightweight" ID="RadWizard1" DisplayProgressBar="false" ProgressBarPosition="Right" NavigationBarPosition="Right" NavigationButtonsPosition="Bottom" DisplayNavigationButtons="false"> </telerik:RadWizard> </td> </tr> </table>
aspx.cs:
Table newTable; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WizardUCDemo.GenerateSteps(); } }public void reProduceWizardSteps(){ RadWizardStep newStep; for (int i = 1; i < 5; i++) { newStep = new RadWizardStep(); newStep.ID = "newStep_" + i.ToString(); newStep.ClientIDMode = ClientIDMode.Static; newTable = new Table(); newTable.ID = "newTable" + i.ToString(); newTable.ClientIDMode = ClientIDMode.Static; TableRow tRow = new TableRow(); TableCell tCell = new TableCell(); RadTextBox rtxtBoxNew = new RadTextBox(); rtxtBoxNew.ID = "newTextBox_" + i.ToString(); rtxtBoxNew.ClientIDMode = ClientIDMode.Static; rtxtBoxNew.ClientEvents.OnKeyPress = "testMethod"; tCell.Controls.Add(rtxtBoxNew); tRow.Cells.Add(tCell); newTable.Controls.Add(tRow); newStep.Controls.Add(newTable); UIControlsWizard.WizardSteps.Add(newStep); }}protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e){ string commandText = e.Argument.ToString().Trim(); var commandData = commandText.Split('&'); commandText = commandData[0]; switch (commandText) { case "StepChange": if (Convert.ToInt32(commandData[1])==1) { reProduceWizardSteps(); } break; }}
I'm implementing a grid with a group footer, similar to what is illustrated in this telerik example:
Telerik Example
Everything works great, but users complain the grid's footer subtotals are confusing because "i can't tell which level the subtotal line applies to".
So, given the photo, is there an easy way to access the group expression to display it in the footer, i.e. on the "count 30" line add text along the lines of "Subtotals: Ernst Handel" and on the "Count 40" line add text reading "Subtotals: Austria"?
PharmacyLocationCollection pharmcol =new Select().From(Tables.PharmacyLocation).OrderAsc(PharmacyLocation.Columns.Location).ExecuteAsCollection<PharmacyLocationCollection>(); //ddlLocation.Items.Insert(0, new RadComboBoxItem("--select a location--", "0")); if (pharmcol.Count > 0) { int i = 0; foreach (PharmacyLocation p in pharmcol) { string loc = p.Location.ToString(); loc = loc.Replace("-", "\n"); ddlLocation.Items.Insert(i, new RadComboBoxItem(loc, p.RXPharmacyID.ToString())); i++; } ddlLocation.Enabled = true; }I have a radgrid with 2 Column of GridCheckBoxColumn View and Edit my whole project is ready only i want is that to add select all checkbox on header of radgrid. And I can not change GridCheckBoxColumn with GridTemplateColumn if I change then will face major problem.
My code is:
.aspx code
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true" GridLines="Vertical" OnBatchEditCommand="RadGrid1_BatchEditCommand" OnItemCreated="RadGrid1_ItemCreated" AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender" EnableEmbeddedSkins="false" Skin="Custom1"> <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings> <MasterTableView CommandItemDisplay="TopAndBottom" EditMode="Batch" DataKeyNames="FeatureID" CommandItemSettings-ShowSaveChangesButton="true" CommandItemStyle-CssClass="RadGrid_Custom1" ForeColor="#000066"> <RowIndicatorColumn Visible="False" > </RowIndicatorColumn> <ExpandCollapseColumn Created="True"> </ExpandCollapseColumn> <BatchEditingSettings Edittype="Cell" /> <CommandItemSettings ShowAddNewRecordButton="False" ShowSaveChangesButton="true"></CommandItemSettings> <Columns> <telerik:GridBoundColumn DataField="FeatureDesc" FilterControlAltText="Filter FeatureDesc column" ReadOnly="true" HeaderText="Feature" UniqueName="FeatureDesc" ItemStyle-HorizontalAlign="Left"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> <HeaderStyle HorizontalAlign="Center" Width="200px" /> <ItemStyle HorizontalAlign="Left" Width="200px"></ItemStyle> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" CancelImageUrl="Cancel.gif"></EditColumn> </EditFormSettings> <BatchEditingSettings OpenEditingEvent="MouseOver"></BatchEditingSettings> </MasterTableView> </telerik:RadGrid>Please help me as soon as possible with better solution.


I am trying to achieve this:
1. I have a master page (this has an AjaxManager)
2. I have a content page (this has an AjaxManager Proxy)
3. I have a RadGrid (GrdEnquiries) on the content page with a button labelled "Add Viewing" (BtnAddViewing). This grid contains details of people enquiring about leasing real estate properties.
4. The Add Viewing Button has a command argument matching the row ID of the grid (GrdEnquiries)
I want to be able to click the Add Viewing button and load a scheduler with an Advanced Form open in Insert Mode. The form is populated using a look up from the database to get the ID of the record passed from the command argument. When the INSERT button on the form is clicked I want the viewing to be added to the Appointments Table in the database, the window to close, and code executed in the grid to refresh the grid so that I can hide btnAddViewing and replace it with another button allowing me to display the appointment details in a Popup.
I have tried several examples both the demos for RadGrid and RadScheduler but I cannot work out how to do it. I have the code for:
1. Adding the command argument.
2. Opening a rad window and displaying the command argument.
3. Adding my scheduler form.
I cannot find an event that fires when the INSERT button is clicked so I am stuck. Can anyone provide me with the bit I am missing please?
This is my code for opening the page inside the window:
<telerik:RadCodeBlock ID="RadCodeBlock3" runat="server"> <script type="text/javascript"> function ShowInsertForm(id, rowIndex) { var grid = $find("<%=grdRightmove.ClientID%>"); var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element(); grid.get_masterTableView().selectItem(rowControl, true); window.radopen("viewing_arrange_popout.aspx?id=" + id, "UserListDialog2"); return false; } function refreshGrid(arg) { if (!arg) { find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindRightMove"); } else { find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigateRightMove"); } } </script></telerik:RadCodeBlock>
This is the Window Manager on the content page (I use UserListDialog2):
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Bootstrap"> <Windows> <telerik:RadWindow RenderMode="Classic" ID="UserListDialog" runat="server" Title="Interactions" Width="1000" height="800" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="False" Skin="Bootstrap" Animation="FlyIn" AutoSize="True" Behaviors="Close" AnimationDuration="600" AutoSizeBehaviors="Height"> </telerik:RadWindow> <telerik:RadWindow ID="UserListDialog2" runat="server" Title="Viewing" Height="800px" Width="800px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="False"> </telerik:RadWindow> </Windows></telerik:RadWindowManager>
My grid markup (I've removed some columns for clarity):
<telerik:RadGrid ID="grdRightmove" runat="server" AllowPaging="True" AllowSorting="True" Skin="Bootstrap" AutoGenerateColumns="False" Culture="en-GB" ShowFooter="True" MasterTableView-AllowMultiColumnSorting="True" PageSize="50" AllowFilteringByColumn="True" DataSourceID="SqlDataSourceEnquiries" EnableViewState="False" Width="100%" GroupingEnabled="False"> <ClientSettings> <Selecting AllowRowSelect="True"></Selecting> <Scrolling AllowScroll="False" UseStaticHeaders="True"/> <Resizing ResizeGridOnColumnResize="true" AllowResizeToFit="true" AllowColumnResize="True" AllowRowResize="True" EnableRealTimeResize="True"></Resizing> <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents> </ClientSettings> <MasterTableView DataKeyNames="Id, ApplicationID, ViewingBooked" CommandItemDisplay="Top" AllowMultiColumnSorting="True" AllowFilteringByColumn="True" AllowSorting="True" > <PagerStyle AlwaysVisible="True"/> <Columns> <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id" Visible="False" AllowFiltering="False" AllowSorting="False"/> <telerik:GridTemplateColumn DataField="Id" HeaderText="Viewing<br>Booked" SortExpression="Id" UniqueName="ViewingBooked" Groupable="False" AllowFiltering="False" AllowSorting="False"> <ItemTemplate> <asp:Label ID="lblViewingBooked" runat="server"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="Id" HeaderText="Actions" SortExpression="Id" UniqueName="ResendInvite" Groupable="False" AllowFiltering="False" AllowSorting="False"> <ItemTemplate> <telerik:RadButton ID="btnAddViewing" runat="server" Text="Add Viewing"/> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid>
Item Created looks like this:
If TypeOf e.Item Is GridDataItem Then dim theID as Integer=CType(e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Id"), Integer) dim theViewingBooked as Boolean=CType(e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("viewingBooked"), Boolean) Dim lblViewingBooked As Label = DirectCast(e.Item.FindControl("lblViewingBooked"), Label) if theViewingBooked=true then lblViewingBooked.Text="<i class='fas fa-check-circle 2x'></i>" else lblViewingBooked.Text="<i class='far fa-times-circle 2x'></i>" End If Dim thisDataItem as griddataitem=ctype(e.Item,griddataitem) dim theApplicationId as Integer=CType(thisDataItem.GetDataKeyValue("ApplicationID"), Integer) Dim btnAddViewing As Radbutton = DirectCast(e.Item.FindControl("btnAddViewing"), RadButton) btnAddViewing.Attributes("href") = "javascript:void(0);" btnAddViewing.Attributes("onclick") = [String].Format("return ShowInsertForm('{0}','{1}');", theApplicationId, e.Item.ItemIndex) End If
The page I am putting into the Radwindow is this:
<script type="text/javascript"> function CloseAndRebind(args) { GetRadWindow().BrowserWindow.refreshGrid(args); GetRadWindow().close(); } function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well) return oWindow; } function CancelEdit() { GetRadWindow().close(); } </script> <asp:Label ID="lblApplicationID" runat="server" Text=""></asp:Label> <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedDate="2012-04-16" Height="1000px" Width="1500px" DataSourceID="DADDataSource" DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End" OverflowBehavior="Auto" ShowAllDayRow="True" Skin="Bootstrap" StartInsertingInAdvancedForm="True" DayEndTime="21:00:00" DayView-DayEndTime="21:00:00" DayView-WorkDayEndTime="21:00:00" DayStartTime="07:00:00" DayView-DayStartTime="07:00" DayView-WorkDayStartTime="07:00" MultiDayView-DayEndTime="21:00" MultiDayView-DayStartTime="07:00" MultiDayView-WorkDayEndTime="21:00" MultiDayView-WorkDayStartTime="07:00" WeekView-DayEndTime="21:00" WeekView-DayStartTime="07:00" WeekView-WorkDayEndTime="21:00" WeekView-WorkDayStartTime="07:00" WorkDayEndTime="21:00:00" WorkDayStartTime="07:00:00" Culture="en-GB" TimelineView-StartTime="07:00" MinutesPerRow="15" HoursPanelTimeFormat="HH:mm tt" DataDescriptionField="Description" DataReminderField="Reminder" RowHeight="30px" EnableDescriptionField="True" RenderMode="Classic" ViewStateMode="Enabled" AdvancedForm-Modal="True" Reminders-Enabled="True" ExportSettings-FileName="TasksExport" Localization-AdvancedNewAppointment="New Task" Localization-AdvancedEditAppointment="Edit Task" Localization-AdvancedSubjectRequired="Please provide task subject" Localization-ConfirmDeleteText="Are you sure you want to delete this task?" EnableRecurrenceSupport="False" GroupBy="Date, Staff" GroupingDirection="Horizontal" TimelineView-UserSelectable="False" MultiDayView-UserSelectable="False"> <ExportSettings FileName="TasksExport" OpenInNewWindow="True" Pdf-PaperSize="A4" Pdf-AllowPrinting="True" Pdf-FontType="Embed"/> <AdvancedForm Modal="true"></AdvancedForm> <Reminders Enabled="true"></Reminders> <AgendaView UserSelectable="true" ResourceMarkerType="Block"/> <WeekView UserSelectable="true"/> <DayView UserSelectable="true"/> <MultiDayView UserSelectable="false"/> <Localization AdvancedEditAppointment="Edit Task" AdvancedNewAppointment="New Task" AdvancedSubjectRequired="Please provide task subject" ConfirmDeleteText="Are you sure you want to delete this task?"/> <TimelineView UserSelectable="false"/> <MonthView UserSelectable="true"/> <ResourceTypes> <telerik:ResourceType KeyField="ID" Name="Staff" TextField="Name" ForeignKeyField="UserID" DataSourceID="UsersDataSource"></telerik:ResourceType> <telerik:ResourceType KeyField="ID" Name="AssignedByID" TextField="Name" ForeignKeyField="AssignedByID" DataSourceID="AssignedByDataSource"></telerik:ResourceType> </ResourceTypes> <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings> <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings> </telerik:RadScheduler> <asp:SqlDataSource ID="DADDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:INTERPROPConnectionString %>" SelectCommand="SELECT * FROM [UserTasks]" InsertCommand="INSERT INTO [UserTasks] ([Subject], [Description], [Start], [End], [AssignedByID], [UserID], [Reminder], [Annotations]) VALUES (@Subject, @Description, @Start, @End, @AssignedByID, @UserID, @Reminder, @Annotations)" UpdateCommand="UPDATE [UserTasks] SET [Subject] = @Subject, [Description] = @Description, [Start] = @Start, [End] = @End, [AssignedByID] = @AssignedByID, [UserID] = @UserID, [Reminder] = @Reminder, [Annotations] = @Annotations WHERE [ID] = @ID" DeleteCommand="DELETE FROM [UserTasks] WHERE [ID] = @ID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32"></asp:Parameter> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Subject" Type="String"></asp:Parameter> <asp:Parameter Name="Description" Type="String"></asp:Parameter> <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter> <asp:Parameter Name="End" Type="DateTime"></asp:Parameter> <asp:Parameter Name="AssignedByID" Type="Int32"></asp:Parameter> <asp:Parameter Name="UserID" Type="Int32"></asp:Parameter> <asp:Parameter Name="Reminder" Type="String"/> <asp:Parameter Name="Annotations" Type="String"/> <asp:Parameter Name="ID" Type="Int32"/> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Subject" Type="String"></asp:Parameter> <asp:Parameter Name="Description" Type="String"></asp:Parameter> <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter> <asp:Parameter Name="End" Type="DateTime"></asp:Parameter> <asp:Parameter Name="AssignedByID" Type="Int32"></asp:Parameter> <asp:Parameter Name="UserID" Type="Int32"/> <asp:Parameter Name="Reminder" Type="String"/> <asp:Parameter Name="Annotations" Type="String"/> </InsertParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="UsersDataSource" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:INTERPROPConnectionString %>" SelectCommand="SELECT * FROM [Users] WHERE Active=1 AND UseDad=1 ORDER BY Name"> </asp:SqlDataSource> <asp:SqlDataSource ID="AssignedByDataSource" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:INTERPROPConnectionString %>" SelectCommand="SELECT * FROM [Users] WHERE Active=1 AND UseDad=1 ORDER BY Name"> </asp:SqlDataSource> <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
Code behind for pop up:
Private Sub ArrangeViewingPopoutWindowLoadEvent(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then ' Sanity check to make sure the ID is being passed through lblApplicationID.Text=request.QueryString("id") RadScheduler1.ShowAdvancedInsertForm(DateTime.Now) End If End Sub Private Sub RadScheduler1_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated If e.Container.Mode = SchedulerFormMode.AdvancedInsert Then ' This will read information from the enquiry record and populate the controls with (for example) name/address/phone number in description End If End Sub
The button code (which I don't really want as I want the insertion of the appointment to trigger a close/grid rebind) is:
Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click ' THIS BIT SHOULD CLOSE THE WINDOW AND REBIND THE ENQUIRIES GRID ' IDEALLY I WANT THIS TO HAPPEN AFTER THE INSERT (WHICH DOESN'T HAPPEN) SO THEY DON'T HAVE TO PRESS ANOTHER BUTTON! ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind(Rebind);", True) End SubI feel like this is ALMOST there but I am missing something obvious and I am now going bald pulling my hair out and my forehead is getting flatter from banging it on my desk.
Can anyone please help?
Screenshots to show flow if it helps are attached:
Thank you ...
Nick
Hi Team,
Drag & drop works in FileExplorer for files but not for directory,
So am using kendo for directory drag & drop.
But is there a way to merge kendo drag & drop in fileexplorer or make fileexplorer to accept directory drag & drop
