I have the following code and I'm trying to add a confirmation dialog to the delete button. No matter what I tried I couldn't manage to get the dialog to fire. The latest method I used is this one which I found in a, admittedly, very old thread from this forum. Any ideas?
.aspx file
<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="CompNotesSqlDataSource" >
<ItemTemplate>
<ul>
<li>
<asp:Label ID="TimeLabel" runat="server" Text="Date/Time:"></asp:Label>
<asp:Label ID="TimeText" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoteDate","") %>'></asp:Label> <br />
<asp:Label ID="Label19" runat="server" Text="Company:"></asp:Label>
<asp:Label ID="FullNameLabel" runat="server" Text='<%# Eval("Description") %>' />
<br />
<asp:Label ID="Label20" runat="server" Text="Notes:"></asp:Label>
<asp:Label ID="RankLevelLabel" runat="server" Text='<%# Eval("Comments") %>' />
<br />
</li>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="updatePanel1">
<ContentTemplate>
<%--<telerik:RadButton ID="btndelete" CommandArgument='<%# Eval("Id")%>' OnCommand="btndelete_Command" runat="server" Text="Delete"></telerik:RadButton>--%>
<telerik:RadButton ID="btndelete" OnClientClick='<%# confirmDelete( Eval("Id").ToString() ) %>' CommandArgument='<%# Eval("Id")%>' OnCommand="btndelete_Command" runat="server" Text="Delete"></telerik:RadButton>
<telerik:RadButton id="btnedit" CommandArgument='<%# Eval("Id")%>' OnCommand="btnedit_Command" runat="server" text="Edit"></telerik:RadButton>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btndelete" EventName="Command" />
<asp:AsyncPostBackTrigger ControlID="btnedit" EventName="Command" />
</Triggers>
</asp:UpdatePanel>
</ul>
</ItemTemplate>
</telerik:RadListView>
----------------------------------
.cs file
public string confirmDelete(string Name)
{
return @"javascript:if(!confirm('This action will delete the "
+ Name
+ @". Are you sure?')){return false;}";
}
We are having a strange layout behavior happening with the Recurrence Editor. The internal controls are overlapping (please see attached imaged).
Does anyone know how I can fix this?
-Ben
I don't know why this would be happening but when I use a PivotGrid, it interrupts or distorts the RadMenu CSS (see images attached). Below is the mark up for the page. This is in IE11, Telerik v.2015.2.729.45.
Please do not advise that I upgrade, I do not have the funds, but I would appreciate a work-around.
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Summary.aspx.cs" Inherits="bccwfm.REACH.Summary" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_Main" runat="server">
<table border="0" class="label" style="margin:5px;border-collapse:separate;border-spacing:5px;padding-top:5px">
<tr>
<td> Start Date</td>
<td>
<telerik:RadDatePicker ID="RDP_StartDate" runat="server" ShowPopupOnFocus="true" ToolTip="Select a start date" Culture="en-US" TabIndex="1" AutoPostBack="true" Width="110px" CssClass="hvr-glow">
<Calendar ID="Calendar2" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" ShowRowHeaders="false"></Calendar>
<DateInput ID="DateInput2" runat="server" TabIndex="1" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" AutoPostBack="True" LabelWidth=""></DateInput>
<DatePopupButton TabIndex="1"></DatePopupButton>
</telerik:RadDatePicker>
</td>
<td>End Date</td>
<td>
<telerik:RadDatePicker ID="RDP_EndDate" runat="server" ShowPopupOnFocus="true" ToolTip="Select a end date" Culture="en-US" TabIndex="2" AutoPostBack="true" Width="110px" CssClass="hvr-glow">
<Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" ShowRowHeaders="false"></Calendar>
<DateInput ID="DateInput1" runat="server" TabIndex="1" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" AutoPostBack="True" LabelWidth=""></DateInput>
<DatePopupButton TabIndex="2"></DatePopupButton>
</telerik:RadDatePicker>
</td>
<td>
<telerik:RadButton ID="RB_Export" runat="server" Text="Export" OnClick="RB_Export_Click" CssClass="hvr-glow"/>
</td>
</tr>
</table>
<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" EmptyValue="0" EnableZoneContextMenu="true" AllowFiltering="true" ClientSettings-EnableFieldsDragDrop="true" Width="99%" style="margin:10px" PageSize="50" >
<ExportSettings FileName="REACH Summary" UseItemStyles="true">
<Excel Format="Xlsx" />
</ExportSettings>
<Fields>
<telerik:PivotGridRowField DataField="Dot4Desc" Caption="Franchise"/>
<telerik:PivotGridRowField DataField="CreatedBy" Caption="Created By"/>
<telerik:PivotGridRowField DataField="Decision" Caption="Decision"/>
<telerik:PivotGridColumnField DataField="ReasonDesc" Caption="Reason"/>
<telerik:PivotGridColumnField DataField="PositionDesc" Caption="Position"/>
<telerik:PivotGridColumnField DataField="StatusDesc" Caption="Status"/>
<telerik:PivotGridAggregateField DataField="ReqID" Caption="Requests" Aggregate="Count" TotalFormat-GroupName="Requests"/>
</Fields>
</telerik:RadPivotGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CWFMO %>" SelectCommand="REACH_GetSummary" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="RDP_StartDate" DbType="Date" Name="startdate" PropertyName="SelectedDate" />
<asp:ControlParameter ControlID="RDP_EndDate" DbType="Date" Name="enddate" PropertyName="SelectedDate" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>
I'm trying to use the new print button on my rad grid but it is not showing, what am I missing. I'm using VS2013 and I upgraded the Telerik.Web.UI dll to version 2016.2.607.45. below is the example code I put together. The Add New record and the Refresh buttons do show, but not the print
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadGrid ID="RadGrid1" RenderMode="Lightweight" runat="server" DataSourceID="SqlDataSource2" GridLines="Both" AutoGenerateColumns="true">
<MasterTableView DataSourceID="SqlDataSource2" CommandItemDisplay="Top">
<CommandItemSettings ShowPrintButton="true" ShowRefreshButton="true" />
</MasterTableView>
</telerik:RadGrid>
</div>
</form>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Northwind %>"
SelectCommand="SELECT top 20 * FROM Customers" >
</asp:SqlDataSource>
</body>
</html>
Hi,
I am using treelist to show heirachical data.
Both parent and child are stored in same table
Sample tables:
SampleTable
When I am creating a child, the parent category id needs to be shown on edit form template
and when a new parent is being created it should allow user to select the value.
I am using hybrid approach of automatic CRUD operation and using formtemplate
Can this be done?
Regards,
Swapnil
Hi,
The screenshot attached doesn't show the mouse location, but I am hovering over the Acrobat PDF icon in the grid and the tooltip shows "Export to Excel". Clicking it exports to Excel.
Hovering over the CSV icon shows the tooltip "Export to PDF" and clicking exports to PDF.
Hovering over the Excel icon shows the tooltip "Export to Word" and clicking exports to Word.
This doesn't happen when using the Metro theme; only Bootstrap...maybe others, but I'm only using these 2 themes.
<
telerik:GridDropDownColumn
UniqueName
=
"AddressCountry"
ListDataMember
=
"AddressCountry"
ColumnEditorID
=
"AddressCountryColumnEditor"
HeaderStyle-Width
=
"200"
SortExpression
=
"Id"
ListTextField
=
"Name"
ListValueField
=
"Id"
HeaderText
=
"Country"
DataField
=
"CountryId"
/>
<
telerik:GridDropDownColumn
UniqueName
=
"AddressProvinceState"
ListDataMember
=
"AddressProvinceState"
ColumnEditorID
=
"AddressProvinceStateColumnEditor"
HeaderStyle-Width
=
"200"
SortExpression
=
"Id"
ListTextField
=
"Name"
ListValueField
=
"Id"
HeaderText
=
"Province/State"
DataField
=
"ProvinceStateId"
/>
<
telerik:GridDropDownColumn
UniqueName
=
"AddressCity"
ListDataMember
=
"AddressCity"
ColumnEditorID
=
"AddressCityColumnEditor"
HeaderStyle-Width
=
"200"
SortExpression
=
"Id"
ListTextField
=
"Name"
ListValueField
=
"Id"
HeaderText
=
"City"
DataField
=
"CityId"
/>
protected void grid_GridItemCreated(object sender, GridItemEventArgs e)
{
if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
{
GridEditableItem edititem = (GridEditableItem)e.Item;
int LocationId = Convert.ToInt32(edititem.GetDataKeyValue("LocationId"));
DataSet dsAddress = somefunction(LocationId);
list1.DataSource = dsAddress.Tables["AddressProvinceState"];
list1.DataTextField = "Name";
list1.DataValueField = "Id";
list1.DataBind();
RadComboBox list2 = (RadComboBox)edititem["AddressCity"].Controls[0];
list2.DataSource = dsAddress.Tables["AddressCity"];
list2.DataTextField = "Name";
list2.DataValueField = "Id";
list2.DataBind();
list.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list_SelectedIndexChanged);
list.AutoPostBack = true;
list1.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list1_SelectedIndexChanged);
list1.AutoPostBack = true;
}
}
private void list_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
RadComboBox list = (RadComboBox)sender;
GridDataItem editItem = (GridDataItem)list.NamingContainer;
GridEditManager editMan = editItem.EditManager;
GridDropDownListColumnEditor editor1 = editMan.GetColumnEditor("AddressProvinceState") as GridDropDownListColumnEditor;
GridDropDownListColumnEditor editor2 = editMan.GetColumnEditor("AddressCity") as GridDropDownListColumnEditor;
DataTable dtProvinceState = ProvinceForCountry(Convert.ToInt32(list.SelectedValue));
DataTable dtCity = CityForProvince(Convert.ToInt32(dtProvinceState.Rows[0]["Id"]));
editor1.DataSource = dtProvinceState;
editor1.DataTextField = "Name";
editor1.DataValueField = "Id";
editor1.DataBind();
editor2.DataSource = dtCity;
editor2.DataTextField = "Name";
editor2.DataValueField = "Id";
editor2.DataBind();
}
private void list1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
RadComboBox list = (RadComboBox)sender;
GridEditFormItem editItem = (GridEditFormItem)list.NamingContainer;
GridEditManager editMan = editItem.EditManager;
GridDropDownListColumnEditor editor = editMan.GetColumnEditor("AddressCity") as GridDropDownListColumnEditor;
DataTable dtCity = CityForProvince (Convert.ToInt32(list.SelectedValue));
editor.DataSource = dtCity;
editor.DataTextField = "Name";
editor.DataValueField = "Id";
editor.DataBind();
}
I am missing the document manager button from my radeditor, hyperlink manager menu.
how do i enable it?
i have attached how my link manager look like and assembly information for Telerik.Web.UI.dll
ToolsFile.xml
<
root
>
<
modules
>
<
module
name
=
"RadEditorDomInspector"
/>
</
modules
>
<
tools
>
<
tool
name
=
"Cut"
shortcut
=
"CTRL+X"
/>
<
tool
name
=
"Copy"
shortcut
=
"CTRL+C"
/>
<
tool
name
=
"Paste"
shortcut
=
"CTRL+V"
/>
<
tool
name
=
"Undo"
shortcut
=
"CTRL+Z"
/>
<
tool
name
=
"Redo"
shortcut
=
"CTRL+Y"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"FontName"
/>
<
tool
name
=
"FontSize"
/>
<
tool
name
=
"Bold"
shortcut
=
"CTRL+B"
/>
<
tool
name
=
"Italic"
shortcut
=
"CTRL+I"
/>
<
tool
name
=
"Underline"
shortcut
=
"CTRL+U"
/>
<
tool
name
=
"StrikeThrough"
/>
<
tool
name
=
"Subscript"
/>
<
tool
name
=
"Superscript"
/>
<
tool
name
=
"BackColor"
/>
<
tool
name
=
"ForeColor"
/>
<
tool
name
=
"FormatStripper"
/>
</
tools
>
<
tools
>
<
tool
name
=
"InsertUnorderedList"
/>
<
tool
name
=
"InsertOrderedList"
/>
<
tool
name
=
"Outdent"
/>
<
tool
name
=
"Indent"
/>
<
tool
name
=
"JustifyLeft"
/>
<
tool
name
=
"JustifyCenter"
/>
<
tool
name
=
"JustifyRight"
/>
<
tool
name
=
"JustifyFull"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"ApplyClass"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"AjaxSpellCheck"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"FormatBlock"
/>
<
tool
name
=
"InsertHorizontalRule"
/>
</
tools
>
<
tools
>
<
tool
name
=
"InsertTable"
/>
<
tool
name
=
"ToggleTableBorder"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"InsertImage"
/>
<
tool
name
=
"InsertLink"
/>
<
tool
name
=
"Unlink"
/>
<
tool
separator
=
"true"
/>
<
tool
name
=
"Help"
/>
</
tools
>
<
contextMenus
>
<
contextMenu
forElement
=
"*"
>
<
tool
name
=
"Cut"
/>
<
tool
name
=
"Copy"
/>
<
tool
name
=
"Paste"
/>
</
contextMenu
>
</
contextMenus
>
<
classes
>
<
class
name
=
"Clear Class"
value
=
""
/>
<
class
name
=
"Normal"
value
=
".ms-rteStyle-Normal"
/>
<
class
name
=
"Highlight"
value
=
".ms-rteStyle-Highlight"
/>
<
class
name
=
"By Line"
value
=
".ms-rteStyle-Byline"
/>
<
class
name
=
"Tag Line"
value
=
".rteStyle-Tagline"
/>
<
class
name
=
"Comment"
value
=
".ms-rteStyle-Comment"
/>
<
class
name
=
"References"
value
=
".ms-rteStyle-References"
/>
<
class
name
=
"Caption"
value
=
".ms-rteStyle-Caption"
/>
</
classes
>
</
root
>
aspx file
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
></
asp:ScriptManager
>
<
telerik:RadEditor
ID
=
"radEmail"
runat
=
"server"
ToolsFile
=
"/editor/ToolsFile.xml"
>
</
telerik:RadEditor
>