Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
179 views
I have a RadGrid where the columns are autogenerated based on the DataSet.  I need to check if one of the columns exists, I would like to make that column filtered by a combobox or a dropdown.I have a RadGrid where the columns are autogenerated based on the DataSet.  I need to check if one of the columns exists, I would like to make that column filtered by a combobox or a dropdown.I have a RadGrid where the columns are autogenerated based on the DataSet.  I need to check if one of the columns exists, I would like to make that column filtered by a combobox or a dropdown.

ASPX
<telerik:RadGrid ID="rgApplications" runat="server" AllowSorting="True" AutoGenerateColumns="False" AllowPaging="True" GridLines="None" Width="100%" CellSpacing="0">
    <MasterTableView DataKeyNames="ExecutedDocumentId,TemplateId,ParentId" ClientDataKeyNames="ExecutedDocumentId,TemplateId,ParentId" AutoGenerateColumns="true" AllowFilteringByColumn="true">
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="EditColumn">
            </EditColumn>
            <FormTemplate>
                <div style="padding-bottom: 5px; padding-top: 5px; padding-left: 20px;">
                    <b><%# (Container is GridEditFormInsertItem) ? GetResource("Add") : GetResource("Edit") %></b>
                    <table border="0" cellpadding="2" width="100%">
                        <tr>
                            <td nowrap>
                                <asp:Label ID="lblType" runat="server" resourcekey="Type" AssociatedControlID="ddlType" />:
                            </td>
                            <td nowrap align="left" style="padding-left: 5px">
                                <asp:DropDownList ID="ddlType" Width="340px" MaxLength="120" runat="server" />
                                <span style="color: Red; padding-left: 2px; padding-right: 3px; font-size: larger">*</span>
                                <asp:RequiredFieldValidator ID="rfvType" ControlToValidate="ddlType" InitialValue="0"
                                    ValidationGroup="UpdateApplications" runat="server" ErrorMessage="Required" ForeColor="Red" />
                            </td>
                        </tr>
                    </table>
                    <p>
                        <asp:ImageButton ID="btnSaveApplications" runat="server" ValidationGroup="UpdateApplications" resourcekey="Save" CommandName="SaveApplication" />
                          
                        <asp:ImageButton ID="btnCancelApplications" runat="server" resourcekey="Cancel" CommandName="Cancel" />
                    </p>
                </div>
            </FormTemplate>
        </EditFormSettings>
        <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="true" />
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="SelectApplication" HeaderTooltip="Select All" />
            <telerik:GridButtonColumn UniqueName="DeleteDocument" CommandName="DeleteDocument" ButtonType="ImageButton" ShowFilterIcon="false" />
            <telerik:GridButtonColumn UniqueName="ViewDocument" CommandName="ViewDocument" ButtonType="ImageButton" ShowFilterIcon="false" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


Code Behind
void rgApplications_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
    // Make Document Status Filter A DropDown
    if (e.Column.UniqueName == "DocumentStatus")
    {
        GridBoundColumn bCol = e.Column as GridBoundColumn;
        if (bCol != null)
        {
            Data.TaxonomyFilteringTemplate template = new MyFilteringTemplate(e.Column.UniqueName, "Document Status", rgApplications);
            bCol.FilterTemplate = template;
            bCol.CurrentFilterFunction = GridKnownFunction.EqualTo;
        }
    }
}

MyFilterTemplate
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace MyTestProgram
{
    public class MyFilteringTemplate : ITemplate
    {
        protected DropDownList combo;
        private string colname;
        private string lookupName;
        RadGrid radgrid;
 
        public TaxonomyFilteringTemplate(string cName, string lookup, RadGrid grid)
        {
            colname = cName;
            lookupName = lookup;
            radgrid = grid;
        }
 
        public void InstantiateIn(Control container)
        {
            combo = new DropDownList();
            combo.ID = "RadComboBoxControl";
            container.Controls.Add(combo);
            combo.AutoPostBack = true;
            //combo.EnableViewState = false;
            combo.SelectedIndexChanged += combo_SelectedIndexChanged;
 
            combo.Items.Add(new ListItem("Please Select"));
 
            var dt = MyController.GetLookupList(this.lookupName);
            var dvOptions = new DataView(dt);
            dvOptions.Sort = "Name";
             
 
            foreach (DataRow dr in dvOptions.ToTable().Rows)
            {
                combo.Items.Add(new ListItem(dr["Name"].ToString()));
            }
 
        }
 
        void combo_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList ddl = sender as DropDownList;
            string filterExpression = string.Empty;
            if (ddl.Text != "")
                filterExpression = "([" + colname + "] = '" + ddl.Text + "')";
            radgrid.MasterTableView.FilterExpression = filterExpression;
            radgrid.MasterTableView.Rebind();
        }
    }
}


The problem I am having is that I am getting an exception:

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.

Any suggestion on how to solve this?
Eyup
Telerik team
 answered on 14 Aug 2015
12 answers
478 views
How can I get a radeditor to fill out the full content area of a radpane? I've tried setting the radeditor's width and height properties to 100% but this does not work.

The radeditor does not have any modules defined and has just a basic set of tools.
Adam
Top achievements
Rank 1
 answered on 14 Aug 2015
4 answers
324 views
Hi,
I was checking Telerik UI for ASP.NET AJAX Q1 2014 trial version.
I need custom paging with sorting and filtering using Stored Procedure.

i found that RadGrid filters already filtered data on its own. if custom paging is used, obviously sorting and filtering done in Stored Procedure.

is there any way to stop Radgrid to filter data on its own somthing like FilterMode="Custom" ?
Mick
Top achievements
Rank 1
 answered on 14 Aug 2015
3 answers
155 views

Hello Support,

​We are experiencing very sluggish rendering behavior when using Rad Editor Control in Rad Window when browsed from IE browser.
Please find few image screenshots to explain the issue.

Test environment:
Telerik version: 2015.1.401.45
Chrome: 44.0.2403.130
IE: 11.0.9600.17905

It seems that page CSS files are being retrieved multiple times from the server in all browsers but in IE, files are retrieved twice or more than twice. Hence slows down the whole page in IE browser.


Brief information about existing application (I don’t think it is related to Kentico environment which we are using):

  • user control (deployed as Kentico webpart) which is added to Kentico Page
  • has RadGrid for listing items.
  • editing item from the grid, pop-ups Rad Window.
  • Rad Window has editable form fields along with 7 Rad Editors

 

Investigation so far:

  • Remove rad Editors from the rad window – No duplication of the CSS files
  • Specified “EditorCssFile” as well as “CssClasses” – Still retrieves CSS files

Need your help to fix the rendering/retrieving difference between browsers as well as any workaround to stop retrieving CSS files multiple times.

Please let me know if you need any other information.

 

Thanks.

 

Isolated page code:

.aspx 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadEditor_RadWindow_PageStyle.Default" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <link href="Content/Site.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="scmScriptManager" runat="server"></asp:ScriptManager>
 
                <asp:Button ID="btnOpen" runat="server" Text="Open" OnClick="btnOpen_Click" />
 
                <telerik:RadWindow ID="radWindow" runat="server" Modal="true" Behaviors="Close" AutoSize="true"
                    Title="radWindow1">
                    <ContentTemplate>
                        <p>Rad Editor 1</p>
                            <telerik:RadEditor ID="RadEditor1" runat="server" Width="600px" Height="300px"
                                EditModes="Design" Visible="false">
                                 
                            </telerik:RadEditor>
                        <p>Rad Editor 2</p>
                        <telerik:RadEditor ID="RadEditor2" runat="server" Width="600px" Height="300px"
                                EditModes="Design" Visible="false">
                            </telerik:RadEditor>
                    </ContentTemplate>
                </telerik:RadWindow>
        </div>
    </form>
</body>
</html>

 .aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace RadEditor_RadWindow_PageStyle
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
        protected void btnOpen_Click(object sender, EventArgs e)
        {
            radWindow.VisibleOnPageLoad = true;
        }
    }
} 

chintan
Top achievements
Rank 1
 answered on 13 Aug 2015
4 answers
276 views
Hi Telerik Team, I have this gauge

<telerik:RadRadialGauge runat="server" ID="RadRadialGauge1" Width="300px" Height="300px">
     <Pointer Value="10">
          <Cap Size="0.1" />
     </Pointer>
     <Scale Min="0" Max="100" MajorUnit="10"/>
</telerik:RadRadialGauge>

I'm changing the pointer value in the code behind with this command:
RadRadialGauge1.Pointer.Value = 50;

The initial value of the pointer is 10, but when I call the command to set the value to 50, the pointer goes to zero and than after goes to 50.
I want that the pointer begin in 10 and go immediately to 50.

Thanks,
Gustavo

Rafael
Top achievements
Rank 1
 answered on 13 Aug 2015
7 answers
255 views

Using the Telerik skin throughout our site but using the Black skin for our Tabstrips.  Have the requirement to change the color of non-selected tabs.  Is it possible to still utilize the skin but change just this one element?  In the image attached, need to lighten the background color of the "Dates" tab.

 

 

Ryan
Top achievements
Rank 1
 answered on 13 Aug 2015
3 answers
90 views

I am running an older version of the controls and have an issue where our internal intranet servers default IE behavior to run in Compatibility mode.

Telerik Version: 2012.3.1308.40 

This is breaking the alignment of my grids headers. The left most header has a empty column name. The rest of the columns headers are populated. 

 In the Screen shot you'll see how the "Plan" column header text is pushed to the left overlapping the top of my row headers. If I go into tools -> Compatibility View Settings and uncheck the option to run the browser in compatibility mode for all intranet sites the columns render just fine.

 

Any ideas on what this might be?

 

 

 

 

 

Pavlina
Telerik team
 answered on 13 Aug 2015
2 answers
285 views

Hi

I have been searching all over for a solution to this problem and have not found a thing. I have a horizontal RadMenu that I am manipulating via the Telerik Client Side API. The RadMenu is created server side. This menu is dynamic so it can have however many items the user defines it to have.

 What I would like to do is, take X Rad Menu Items after the 6th item and add them under a parent RadMenu Item using the Telerik Client Side API. It is very easy to add an item to the menu, but I have not found a solution to add a child item to a parent item. Here is my code.

<script> 

function AddMenuItems() {

            var menu = $find("<%= testMenu.ClientID %>")
            menu.trackChanges();

            var parentItem = new Telerik.Web.UI.RadMenuItem();

            parentItem.set_text("More...");
            menu.get_items().add(parentItem);

            var childItem = new Telerik.Web.UI.RadMenuItem();
            childItem.set_text("child");
    menu.get_items().insert((menu.get_allItems().length), childItem);
            menu.commitChanges();
        }

    </script>
    
    <AxnMenus:AxnMenu ID="testMenu" runat="server" OnClientLoad="AddMenuItems">
    <Items>
        <AxnMenus:AxnMenuItem Text="item 1" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 2" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 3" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 4" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 5" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 6" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 7" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 8" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 9" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 10" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 11" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 12" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 13" runat="server"/>
    </Items>
    </AxnMenus:AxnMenu>
    

</asp:content>

Joe
Top achievements
Rank 1
 answered on 13 Aug 2015
1 answer
176 views

Hi

 I have been using the Client Side API and also looking all over the internets for a solution to this problem and have not seen a thing.

 I have a RadMenu that is created dynamically server side. This menu can have as many menu items as the user defines. I would like to add a child menu item to a parent menu item via Telerik's Client Side API. 

The Add and Insert functions both seem to add the item to the menu as a parent instead of adding the child item inside of the parent menu item. Is there a way I can add the child item to the parent item, so that it displays within the parent items drop down? Ultimately, I would like to create a multilevel drop down.

 Here is some test code I have written, to see if this is possible.Thanks!

<script> 

    function AddMenuItems() {
            var menu = $find("<%= testMenu.ClientID %>")
            menu.trackChanges();

            var parentItem = new Telerik.Web.UI.RadMenuItem();

            parentItem.set_text("More...");
            menu.get_items().add(parentItem);

            var childItem = new Telerik.Web.UI.RadMenuItem();
            childItem.set_text("child");
            menu.get_items().insert((menu.get_allItems().length), childItem); <== Adds the item after the parent item instead of inside. 
            menu.commitChanges();
        }

    </script>
    
    <AxnMenus:AxnMenu ID="testMenu" runat="server" OnClientLoad="AddMenuItems">
    <Items>
        <AxnMenus:AxnMenuItem Text="item 1" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 2" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 3" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 4" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 5" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 6" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 7" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 8" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 9" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 10" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 11" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 12" runat="server"/>
        <AxnMenus:AxnMenuItem Text="item 13" runat="server"/>
    </Items>
    </AxnMenus:AxnMenu>
    

</asp:content>

Ivan Danchev
Telerik team
 answered on 13 Aug 2015
1 answer
126 views

Hello.

I'm currently experiencing issues with the Schedulers PDF-export function. It seems that i can not set the ShowHourColumn to invisible properly, making it render the hour column in the pdf export. I do not wish for it to do this. Also, the export creates some sort of mashed together rows at the top of every page (starting at page 2 and onwards). I'm attaching an image to better show the issues that I'm experiencing. 

 

#1 is the mashed-rows, they contain actual data that needs to be display.

 

#2 is the hour column, i want to hide it in the export.

 Here's the code for exporting it.

rdSchedular.ExportSettings.Pdf.PaperSize = SchedulerPaperSize.A4;
 
rdSchedular.ExportSettings.Pdf.PaperOrientation = SchedulerPaperOrientation.Portrait;
rdSchedular.ExportSettings.Pdf.PageTopMargin = Unit.Parse("20px");
rdSchedular.ExportSettings.Pdf.PageBottomMargin = Unit.Parse("20px");
rdSchedular.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("20px");
rdSchedular.ExportSettings.Pdf.PageRightMargin = Unit.Parse("20px");
 
rdSchedular.ExportSettings.FileName = "pdfDocument"
rdSchedular.ExportSettings.Pdf.Author = "me"
rdSchedular.ExportSettings.Pdf.Creator = "me"
rdSchedular.ExportSettings.Pdf.Title = "pdfDocument"
rdSchedular.ExportSettings.OpenInNewWindow = true;
 
rdSchedular.ExportSettings.Pdf.StyleSheets = new[] { ResolveClientUrl("~/Styles/TelSchedular.css") };
 
rdSchedular.ExportSettings.Pdf.AllowPaging = true;
rdSchedular.AgendaView.TimeColumnWidth = 1;
 
BindCalendar();
 
if (rdSchedular.SelectedView == SchedulerViewType.AgendaView)
{
    var contr = rdSchedular.ShowHoursColumn = false;
    rdSchedular.RowHeight = 200;
 
}
 
rdSchedular.ExportToPdf();

Ivan Danchev
Telerik team
 answered on 13 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?