Hello
I have a radgrid with a NestedViewTemplate. Inside this are 3 fieldsets with either lablels or LIs. All are bound on the dataitembound event. When I export to pdf, the labels & LIs (as text only) are present, but the fieldsets are not, so the horizontal organization of the data is lost... the labels export in a vertical stack.
I have tried replacing the fieldsets with spans to manage placement (I have seen a number of articles regarding div and width... so none of that).
I also tried to various "manipulations" the grid_PreRender. I note the fieldset is present as text of a LiteralControl and the actual Labels are Labels. The LiteralControls have \r\n\ & up to 24 spaces (this matches the html layout in VS). I have stripped all this out, tried creating new Panels and adding the Label controls to these, creating tables and adding the control text to the cells... and so on... but nothing seems to reformat this export.
here is my MasterTableView with NestedViewTemplate
<telerik:RadGrid ID="gvServiceItems" runat="server" DataKeyNames="ID" OnNeedDataSource="gvServiceItems_NeedDataSource"
OnItemCommand="gvServiceItems_OnItemCommand" OnItemDataBound="gvServiceItems_OnItemDataBound" OnPreRender="gvServiceItems_PreRender"
ShowGroupPanel="true" EnableHierarchyExpandAll="true">
<ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true">
</ExportSettings>
<ClientSettings AllowDragToGroup="true">
</ClientSettings>
<GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
<MasterTableView DataKeyNames="ID" Name="EstimateRequests">
<NestedViewTemplate>
<span style="float: left; width: 30%; margin: 10px;">
<fieldset style="float: left; width: 96%; text-align: left; min-height: 124px;">
<legend>
<asp:Label ID="lblInfo" runat="server" Text="lblInfo" SkinID="LabelSeperatorTitle"></asp:Label>
</legend>
<p>
<asp:Label ID="lblDescription" runat="server" Text="lblDescription" SkinID="LabelRadSilk"></asp:Label><br />
<asp:Label ID="lblDescriptionData" runat="server" Text="lblDescriptionData" SkinID="LabelData"></asp:Label>
</p>
<p>
<asp:Label ID="lblRequestNotes" runat="server" Text="lblRequestNotes" SkinID="LabelRadSilk"></asp:Label><br />
<asp:Label ID="lblRequestNotesData" runat="server" Text="lblRequestNotesData" SkinID="LabelData"></asp:Label>
</p>
</fieldset>
</span>
<span style="float: left; width: 30%; margin: 10px;">
<fieldset style="float: left; width: 96%; text-align: left; min-height: 124px;">
<legend>
<asp:Label ID="lblEquipment" runat="server" Text="lblEquipment" SkinID="LabelSeperatorTitle"></asp:Label>
</legend>
<asp:Label ID="lblEquipmentData" runat="server" Text="lblEquipmentData"></asp:Label>
</fieldset>
</span>
<span style="float: left; width: 30%; margin: 10px;">
<fieldset style="float: left; width: 96%; text-align: left; min-height: 124px;">
<legend>
<asp:Label ID="lblParts" runat="server" Text="lblParts" SkinID="LabelSeperatorTitle"></asp:Label>
</legend>
<asp:Label ID="lblPartsData" runat="server" Text="lblPartsData"></asp:Label>
</fieldset>
</span>
</NestedViewTemplate>
<Columns>
</Columns>
My grid_PreRender
protected void gvServiceItems_PreRender(object sender, EventArgs e)
{
if (IsExport)
{
foreach (GridHeaderItem header in gvServiceItems.MasterTableView.GetItems(GridItemType.Header))
{
foreach (TableCell cell in header.Cells)
{
cell.Style["font-family"] = "Arial Unicode MS";
cell.Style["font-size"] = "11px";
cell.Style["color"] = "black";
cell.Style["font-weight"] = "bold";
cell.Style["padding"] = "10px 0 4px 0";
cell.Style["margin"] = "0 4px";
cell.Style["text-align"] = "left";
cell.Style["background-color"] = "#ebf0f6";
}
}
int rowNumber = 0;
foreach (GridDataItem item in gvServiceItems.MasterTableView.Items)
{
foreach (TableCell cell in item.Cells)
{
cell.Style["font-family"] = "Arial Unicode MS";
cell.Style["font-size"] = "9px";
cell.Style["color"] = "black";
if (rowNumber.IsEven())
cell.Style["background-color"] = "#fff";
else
cell.Style["background-color"] = "#f3f6f9";
}
rowNumber++;
item.Expanded = true;
if (item.HasChildItems)
Any direction would be appreciated.
I have the fileexplorer on a screen but when I right click and the context menu pops up Open is missing from the context list. Double click does work and I have EnableOpenFile="true" but I would like Open to show in the context menu.
Also is there a way to add an open file button to the menu on the top. There are people who are tring to use the site on tablets amd the double click does not work and a press hold does not seem to provide the right click menu.

The width of StandardButtons (ButtonType="StandardButton"), SkinnedButtons (ButtonType="SkinnedButton") and LinkButtons (ButtonType="LinkButton") in the Classic render mode of RadButton is unified in the Q2 2015 release of UI for ASP.NET AJAX. As a result, the following changes in the width of the button control will be observed:
I have a combination of RadDropDownLists and RadComboBox's on a page, the last RadComboBox is losing it's selection(s) on PostBack. All other RadDropDownLists and RadComboBox's keep their selections on PostBack. What do I need to do to ensure the selections are not lost. I have tried enabling ViewState and several other suggestions found online, but none resolve the issue. Please advise.
ASPX:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CobraStatusTemplate1.aspx.cs" Inherits="CobraStatus.aspx.CobraStatusTemplate1" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <br /> <telerik:RadDropDownList ID="rdlProject" runat="server" DefaultMessage="Select Project" OnSelectedIndexChanged="rdlProject_SelectedIndexChanged" AutoPostBack="true" Skin="Office2010Black" Enabled="true"> </telerik:RadDropDownList> <telerik:RadDropDownList ID="rdlAnalyst" runat="server" DefaultMessage="Select Analyst" OnSelectedIndexChanged="rdlAnalyst_SelectedIndexChanged" AutoPostBack="true" Skin="Office2010Black" Enabled="false"> </telerik:RadDropDownList> <telerik:RadComboBox ID="rcbControlAccount" runat="server" Text="Select Control Account" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" OnSelectedIndexChanged="rcbControlAccount_SelectedIndexChanged" AutoPostBack="true" Skin="Office2010Black" Enabled="false"> </telerik:RadComboBox> <telerik:RadComboBox ID="rcbEVT" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" AutoPostBack="true" Skin="Office2010Black" Enabled="false" OnSelectedIndexChanged="rcbEVT_SelectedIndexChanged"> </telerik:RadComboBox> <br /> <br /> <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" GroupPanelPosition="Top" OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender" OnBatchEditCommand="RadGrid1_BatchEditCommand" Width="100%" Skin="Office2010Black"> <MasterTableView AutoGenerateColumns="False" EditMode="Batch" CommandItemDisplay="Top" Width="100%"> <CommandItemSettings ShowAddNewRecordButton="False" ShowSaveChangesButton="True" ShowCancelChangesButton="True"></CommandItemSettings> <Columns> <telerik:GridBoundColumn DataField="Project" HeaderText="Project" SortExpression="Project" UniqueName="Project" FilterControlAltText="Filter Project column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Ca1" HeaderText="Control Account" SortExpression="Ca1" UniqueName="Ca1" FilterControlAltText="Filter Ca1 column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Wp" HeaderText="Work Package" SortExpression="Wp" UniqueName="Wp" FilterControlAltText="Filter Wp column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Descrip" HeaderText="Description" SortExpression="Descrip" UniqueName="Descrip" FilterControlAltText="Filter Descrip column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Description" HeaderText="EV Technique" SortExpression="Pmt" UniqueName="Pmt" FilterControlAltText="Filter Pmt column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FullName" HeaderText="Analyst" SortExpression="C5" UniqueName="C5" FilterControlAltText="Filter C5 column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PcComp" HeaderText="% Complete" SortExpression="PcComp" UniqueName="PcComp" DataType="System.Decimal" FilterControlAltText="Filter PcComp column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Ssd" HeaderText="Baseline Start Date" SortExpression="Ssd" UniqueName="Ssd" DataType="System.DateTime" FilterControlAltText="Filter Ssd column" DataFormatString="{0:MM/dd/yyyy}" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Sfd" HeaderText="Baseline Finish Date" SortExpression="Sfd" UniqueName="Sfd" DataType="System.DateTime" FilterControlAltText="Filter Sfd column" DataFormatString="{0:MM/dd/yyyy}" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn DataField="Asd" HeaderText="Actual Start Date" SortExpression="Asd" UniqueName="Asd" DataType="System.DateTime" FilterControlAltText="Filter Asd column" DataFormatString="{0:MM/dd/yyyy}" ReadOnly="false" HeaderStyle-Width="165px" HeaderStyle-ForeColor="#0000cc"> </telerik:GridDateTimeColumn> <telerik:GridBoundColumn DataField="Afd" HeaderText="Actual Finish Date" SortExpression="Afd" UniqueName="Afd" DataType="System.DateTime" FilterControlAltText="Filter Afd column" DataFormatString="{0:MM/dd/yyyy}" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="UpdPcComp" HeaderText="Updated % Comp" SortExpression="UpdPcComp" UniqueName="UpdPcComp" DataType="System.Decimal" FilterControlAltText="Filter UpdPcComp column" ReadOnly="false" HeaderStyle-ForeColor="#0000cc"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="UpdBy" HeaderText="Updated By" SortExpression="UpdBy" UniqueName="UpdBy" FilterControlAltText="Filter UpdBy column" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="UpdDate" HeaderText="Last Updated" SortExpression="UpdDate" UniqueName="UpdDate" DataType="System.DateTime" FilterControlAltText="Filter UpdDate column" DataFormatString="{0:MM/dd/yyyy}" ReadOnly="true"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid></asp:Content>C#:
using System;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;namespace CobraStatus.aspx{ public partial class CobraStatusTemplate1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { projects(); } private void projects() { DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["FinanceSystemsApplicationsConnectionString"].ConnectionString)) { con.Open(); SqlCommand cmd = new SqlCommand("SELECT ProgramId FROM csProgram ORDER BY ProgramId", con); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dt); } rdlProject.DataSource = dt; rdlProject.DataTextField = "ProgramId"; rdlProject.DataValueField = "ProgramId"; rdlProject.DataBind(); } private void analysts() { string project = rdlProject.SelectedValue; DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["FinanceSystemsApplicationsConnectionString"].ConnectionString)) { con.Open(); SqlCommand cmd = new SqlCommand("SELECT DISTINCT csCawp.C5, csAnalysts.EmployeeId, csAnalysts.FullName FROM csCawp INNER JOIN " + "csAnalysts ON csCawp.C5 = csAnalysts.EmployeeId WHERE Project = '" + project + "'", con); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dt); } rdlAnalyst.DataSource = dt; rdlAnalyst.DataTextField = "FullName"; rdlAnalyst.DataValueField = "EmployeeId"; rdlAnalyst.DataBind(); } private void controlAccount() { string project = rdlProject.SelectedValue; string analyst = rdlAnalyst.SelectedValue; DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["FinanceSystemsApplicationsConnectionString"].ConnectionString)) { con.Open(); SqlCommand cmd = new SqlCommand("SELECT DISTINCT Ca1 FROM CsCAWP WHERE Project = '" + project + "' AND C5 = " + analyst + "", con); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dt); } rcbControlAccount.DataSource = dt; rcbControlAccount.DataTextField = "Ca1"; rcbControlAccount.DataValueField = "Ca1"; rcbControlAccount.DataBind(); } private void evt() { string project = rdlProject.SelectedValue; string analyst = rdlAnalyst.SelectedValue; DataTable dt = new DataTable(); using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["FinanceSystemsApplicationsConnectionString"].ConnectionString)) { string controlAccount = string.Empty; for (int i = 0; i < rcbControlAccount.CheckedItems.Count; i++) { if (i < rcbControlAccount.CheckedItems.Count - 1) { controlAccount += rcbControlAccount.CheckedItems[i].Value; controlAccount += "'"; controlAccount += ","; controlAccount += "'"; } else { controlAccount += rcbControlAccount.CheckedItems[i].Value; } } conn.Open(); SqlCommand cmnd = new SqlCommand("SELECT DISTINCT csEVT.Code, csEVT.Description FROM csCawp INNER JOIN csEVT ON csCawp.Pmt = csEVT.Code " + "WHERE csCawp.Project = '" + project + "' AND csCawp.C5 = '" + analyst + "' AND csCawp.Ca1 IN ('" + controlAccount + "')", conn); SqlDataAdapter adp = new SqlDataAdapter(cmnd); adp.Fill(dt); } rcbEVT.DataSource = dt; rcbEVT.DataTextField = "Description"; rcbEVT.DataValueField = "Code"; rcbEVT.DataBind(); } protected void rdlProject_SelectedIndexChanged(object sender, Telerik.Web.UI.DropDownListEventArgs e) { analysts(); rdlAnalyst.Enabled = true; } protected void rdlAnalyst_SelectedIndexChanged(object sender, Telerik.Web.UI.DropDownListEventArgs e) { controlAccount(); rcbControlAccount.Enabled = true; } protected void rcbControlAccount_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { evt(); rcbEVT.Enabled = true; } protected void rcbEVT_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { RadGrid1.Rebind(); } public DataTable GetDataTable(string query) { String ConnString = ConfigurationManager.ConnectionStrings["FinanceSystemsApplicationsConnectionString"].ConnectionString; SqlConnection conn = new SqlConnection(ConnString); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand(query, conn); DataTable myDataTable = new DataTable(); conn.Open(); try { adapter.Fill(myDataTable); } finally { conn.Close(); } return myDataTable; } protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { int rcbCA = rcbControlAccount.CheckedItems.Count; int rcbEvt = rcbEVT.CheckedItems.Count; if (rdlProject.SelectedValue != "" && rdlAnalyst.SelectedValue != "" && rcbCA > 0 && rcbEvt > 0) { string project = rdlProject.SelectedValue; string analyst = rdlAnalyst.SelectedValue; string controlAccount = string.Empty; for (int i = 0; i < rcbControlAccount.CheckedItems.Count; i++) { if (i < rcbControlAccount.CheckedItems.Count - 1) { controlAccount += rcbControlAccount.CheckedItems[i].Value; controlAccount += "'"; controlAccount += ","; controlAccount += "'"; } else { controlAccount += rcbControlAccount.CheckedItems[i].Value; } } string evt = string.Empty; for (int i = 0; i < rcbEVT.CheckedItems.Count; i++) { if (i < rcbEVT.CheckedItems.Count - 1) { evt += rcbEVT.CheckedItems[i].Value; evt += "'"; evt += ","; evt += "'"; } else { evt += rcbEVT.CheckedItems[i].Value; } } RadGrid1.DataSource = GetDataTable("SELECT csCawp.Project, csCawp.Ca1, csCawp.Wp, csCawp.Descrip, csEVT.Description, csAnalysts.FullName, csCawp.PcComp," + "csCawp.Ssd, csCawp.Sfd, csCawp.Asd, csCawp.Afd, csCawp.UpdPcComp, csCawp.UpdDate, csCawp.UpdBy FROM csCawp INNER JOIN csEVT ON csCawp.Pmt = csEVT.Code INNER JOIN " + "csAnalysts ON CsCawp.C5 = csAnalysts.EmployeeId " + " WHERE PROJECT = '" + project + "' AND Ca1 IN ('" + controlAccount + "') AND Pmt IN ('" + evt + "')"); } } protected void Button1_Click(object sender, EventArgs e) { } protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; if (item["PcComp"].Text == "0.000000") item.ForeColor = Color.Red; } } protected void RadGrid1_PreRender(object sender, EventArgs e) { } protected void RadGrid1_BatchEditCommand(object sender, GridBatchEditingEventArgs e) { } }}
Thanks in advance,
Josh

Regards

Hi,
I am using the radcombobox on web pages throughout my application. If I select an item, then highlight the selected text and press the delete button, the text comes back when I click away.
When I submit the page, it results in the radcombobox having a text value, but the selectedindex is -1 and there is no selectedvalue.
If anyone has experienced this issue and has any advice it would be very appreciated.
Thanks.
Hi,
I'm sure that answer already exists, but I searched through the forum and couldn't find a solution.
I have a batch mode grid that invokes a web service, during the OnBatchEditCommand event, when saving data. The service performs the update and returns a DataTable which identifies the results of the insert/update/delete actions. The results include a status, error message and datetime value for every row that was processed.
To help the user, we have a GridTemplateColumn (seen below), containing an image used to depict the results. If the status is "Ok", we want to display a green check mark. If the status is "Error", we want to display a red 'X'. As you can imagine, in order for the user to correct the error, we don't want to overwrite any data that they may have entered. As such, we don't want to reset the grids DataSource. (Note that we do validate the data prior to calling the web service, but need to be cautious.)
<telerik:GridTemplateColumn ItemStyle-Wrap="false" DataField="STATUS" FilterControlAltText="Filter STATUS column" HeaderText="Row Status" SortExpression="STATUS" UniqueName="STATUS">
<ItemTemplate>
<asp:Image runat="server" ID="RowStatus" ImageUrl='<%#"/_layouts/15/images/projname/MUE_" + Eval("STATUS") + ".png"%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
So, after obtaining the returned DataTable, we would like to loop through the grid's rows, setting the value of the GridTemplateColumn to the value provided in the DataTable (either "Ok" or "Error"). Doing so, will allow us to display the MUE_Ok.png or MUE_Error.png image. Obviously, we're open to other solutions that meet our user's requirements. Note that the initial call to retrieve data, performed during the NeedDataSource event, returns a DataTable that currently includes an "Ok" value (along with all of the other data values) for each row. As such, each row initially shows the green check mark.
Thanks.

Hello,
I'm working on a project that contains a RadTreeView.
When the user clicks on a node, it fires the JS event “OnClientClicking”.
Sometimes we need to set args.set_cancel(true), in order to prevent going to server side.
Therefore, the node that was clicked is not selected, nor is it highlighted.
How can I prevent the event from accessing the server side – yet select the node and highlight it?
Thanks,
Daniel.
Hello,
I'm working on a project that should contain a RadNumericTextBox.
The project requirements are that when the user clicks a button, a RadNumericTextBox will be created dynamically on the client side.
The RadNumericTextBox will contain a SpinButton and also validation of MinValue, MaxValue.
How to do this in Client-Side using JS?
Thanks,
Daniel