Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
53 views
how can i change the event of telerik shcedular from double click to mouse down,mouse drag and mouse leave to load the rad dock.
vivak
Top achievements
Rank 1
 asked on 09 Mar 2011
1 answer
764 views
Hi,
I need to redirect to another aspx page when the user clicks the Telerik Grid Add button.  How is the best way to do this?  I can't seem to find an Add button click event to trap and do a redirect.
I'm using RadControls for ASP.Net AJAX Q2010 SP2.

Below is the code from my applicationUC.aspx page.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ApplicationsUC.ascx.cs" Inherits="SunSmart.Web.Common.UserControls.ApplicationsUC" %>



<%@ Import Namespace="SunSmart.BusinessEntities.Enums" %>

<style type="text/css">
    .RadGrid .rgCommandTable
    {
        border:0;
    }
    
    .RadGrid .rgRow td , .RadGrid .rgAltRow td, .RadGrid .rgHeader
    {
        border:0;/*-right: solid 1px #DEEBF7; */
        border-right: solid 1px #000000;
    }
 
    .RadGrid .rgHeader
    {
        border-bottom: solid 1px #000000;
    }
</style>

<telerik:RadGrid ID="applicationsGrid" runat="server" AutoGenerateColumns="false" Skin="Office2007"
    OnInsertCommand="applicationsGrid_InsertCommand"
    OnItemDataBound="applicationsGrid_OnItemDataBound" AllowPaging="true" PageSize="5">

    <PagerStyle Mode="NextPrevAndNumeric" />

    <MasterTableView ShowHeadersWhenNoRecords="true" EnableNoRecordsTemplate="true" AllowSorting="true"
        AutoGenerateColumns="false" CommandItemDisplay="Top"
        AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowAutomaticUpdates="false"
        CommandItemSettings-AddNewRecordText="Create New Sunsmart Application" DataKeyNames="SunsmartApplicationId">

        <NoRecordsTemplate>
            No sunsmart applications found.
        </NoRecordsTemplate>

        <Columns>
            <telerik:GridBoundColumn HeaderText="Address Id" DataField="SunsmartApplicationId" ReadOnly="true"
                UniqueName="SunsmartApplicationId" SortExpression="SunsmartApplicationId" Visible="false" />

            <telerik:GridHyperLinkColumn HeaderText="Program" DataTextField="Program.ProgramDesc" NavigateUrl="#"
                Visible="true" UniqueName="Program" SortExpression="Program.ProgramDesc" />

            <telerik:GridBoundColumn HeaderText="Status" DataField="SunsmartApplicationStatu.SunsmartApplicationStatusDesc" UniqueName="SunsmartApplicationStatusDesc"
                SortExpression="SunsmartApplicationStatu.SunsmartApplicationStatusDesc" Visible="true" />

            <telerik:GridBoundColumn HeaderText="Appl Date" DataField="ApplicationDate" UniqueName="ApplicationDate"
                SortExpression="ApplicationDate" Visible="true" />

           <telerik:GridBoundColumn HeaderText="Application Form Status" DataField="ApplicationFormStatu.ApplicationFormStatusDesc "
               UniqueName="ApplicationFormStatusDesc" SortExpression="ApplicationFormStatu.ApplicationFormStatusDesc " />

           <telerik:GridBoundColumn HeaderText="Agreement Status" DataField="AgreementStatu.AgreementStatusDesc"
               UniqueName="AgreementStatusDesc" SortExpression="AgreementStatu.AgreementStatusDesc" />


        </Columns>
        
    </MasterTableView>

</telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 09 Mar 2011
3 answers
149 views
Hi all,
           In radgrid i have a column called Employee names in this i will get the value as Employee1|Employee2|Employee3. I need the color change for the value Employee1 should be red color and Employee2 should be Green color and Employee3 should be Blue in color. Please Help me out.

Can you help me figure out what I have to do in radgrid?

Thank you,
Kingsleen Solomon Doss.J
Shinu
Top achievements
Rank 2
 answered on 09 Mar 2011
2 answers
88 views

I have a RadScheduler  with a RadSchedulerContextMenu that shows when the user right clicks an appointment. Inside that RadSchedulerContextMenu, I have several RadMenuItems, some of which are disabled. One of the RadMenuItems is Text="Edit" Value="CommandEdit" Enabled="False", however, it is NOT disabled. The other items are disabled when I set Enabled="false", but not the Edit item.

<telerik:RadSchedulerContextMenu runat="server" ID="ContextMenuNone" Skin="Vista" >  
<Items>    
<telerik:RadMenuItem Text="Edit" Value="CommandEdit" ImageUrl="~/edit.png" Enabled="false" />    
...
</Items>
</telerik:RadSchedulerContextMenu>

 
How can I disable the CommandEdit RadMenuItem?

Robert Helm
Top achievements
Rank 1
 answered on 08 Mar 2011
2 answers
109 views
I have the calendar set to allow multiple selection. Each selected day is going to be stored in the db. The issue I am having is determining what date was unselected from e.SelectedDates. I have found no other function/property to detemine this value.

My goal is simular to this. but even this does not allow me to know what the unselected date was.
http://www.telerik.com/community/forums/aspnet-ajax/calendar/toggle-function.aspx

I am using VS2005 telerik version 2008.1.619.20. I cannot upgrade.

Thanks
Dan
Top achievements
Rank 1
 answered on 08 Mar 2011
6 answers
391 views
Hi,

Am I missing something? The $find is not working for a RadPanelBar, here is the code:

... 
<body topmargin="0" leftmargin="0"
    <form id="form1" runat="server"
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadPanelBar ID="rpbNavigation" runat="server" style="width:100%" Skin="Outlook" EnableViewState="false"
        </telerik:RadPanelBar> 
    </div> 
    </form> 
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"
        <script type="text/javascript"
            checkMain(); 
            function checkMain() { 
                var panelBar = $find("<%= rpbNavigation.ClientID %>"); 
 
                var item = panelBar.findItemByText(Main.selectedModule); 
            } 
        </script> 
    </telerik:RadCodeBlock> 
</body> 
... 

I tried to put the script block on the header tag and in the body tag. If I replace by $get, it works, but then I can't access the findItemByText function. The funny thing is that I use a very similar code on other page and it works, the difference is that I use a RadMenu instead a RadPanelBar.

On, the call to checkMain() would be on the onload event of the body, I tried to move around to see if there was something to do with the timing of this call, but no luck.

Any help is appreciated.

Thanks,
Eduardo
Lorenzo
Top achievements
Rank 1
 answered on 08 Mar 2011
0 answers
147 views
If you change your example page to have the following code-up front code.  When you expand the hierarchical item "About us" the child group height setting goes out the window (see attached img).  Is there anyway around this?

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" >
    <Items>
        <telerik:RadPanelItem Expanded="True" Text="Corporate" ChildGroupHeight="50">
            <Items>
                <telerik:RadPanelItem Text="About us">
                    <Items>
                        <telerik:RadPanelItem Text="News"></telerik:RadPanelItem>
                        <telerik:RadPanelItem Text="Team"></telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Careers"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Careers1"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Careers2"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Careers3"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Careers4"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Careers5"></telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelItem>
        <telerik:RadPanelItem Text="Services" ChildGroupHeight="50">
            <Items>
                <telerik:RadPanelItem Text="Products"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Solutions"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Certifications"></telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelItem>
        <telerik:RadPanelItem Text="Work" ChildGroupHeight="50" >
            <Items>
                <telerik:RadPanelItem Text="Clients"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Testimonials"></telerik:RadPanelItem>
                <telerik:RadPanelItem Text="FAQ"></telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelItem>
    </Items>
    <ExpandAnimation Type="None"></ExpandAnimation>
</telerik:RadPanelBar>
Rob
Top achievements
Rank 1
 asked on 08 Mar 2011
3 answers
119 views
Hello Telerik Team,

I have a grid that I bind on the client side.

I want to create a custom filtering column for my grid.  I have successfully derived from GridBoundColumn to create GridFilteringBoundColumn.  I override the SetupFilterControls method and all is well.

However, I also have a GridButtonColumn that I would like to be able to filter on.  If I derive from GridButtonColumn in the same exact way as above, the cells do not get rendered as hyperlinks and clicking on the text in the cell does nothing (I expect it to do a fireCommand with my command name that I assigned.

I have verified with a debugger that the CommandName property is set correctly but I can't figure out why the cells do not render properly. In the browser, when I use the Telerik GridButtonColumn, the cells all contain text of this form:

<a onclick="if(!$find('ctl00_WebPartManager_WorkAreaWebPart_MainControl_WorkAreaGrid_ctl00').fireCommand('DisplayDetails','0')) return false;" href="javascript:__doPostBack('ctl00$WebPartManager$WorkAreaWebPart$MainControl$WorkAreaGrid$ctl00$ctl04$ctl01','')">J1542A</a><br>

but with my derived Column, all I get is simpletext after the grid binds on the client side.

What am I missing?

Thanks
Bob

Marin
Telerik team
 answered on 08 Mar 2011
25 answers
508 views
Hi,

I have a web application with a virtual directory set up within IIS for my images. 

I place a rad editor on my aspx:
<telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>

Then in my codebehind:
string assetsRoot = "~/Assets112s/"//this is the name of my virtual directory 
RadEditor1.ImageManager.ViewPaths = new string[1] { assetsRoot + "Images" }; 
 

Within my Images folder (/assets112s/images) I have a series of folders and sub folders. 

When I load my aspx and select the image manager, it loads fine and shows the correct file path in the image manager address bar(/Assets/Images) and it shows me the top level of the folders within Images (and any image files as well). However when I select one of the sub folders the loading image apprears by then does nothing... ie I cannot navigate down through my folders Please see attached image... any ideas?

I'm using version: 2010.1.309.20 problems on all browsers
Rumen
Telerik team
 answered on 08 Mar 2011
4 answers
148 views

I need to create a combobox with variable number of columns.  Both the number of columns, and the column names would be determined only at run time.  Also, I need the combobox to be a multiselect combo, so I need to put in a checkbox in the item template.  So, I am creating the item template and header template at runtime. 

When I run the code, I am getting the error "Multiple controls with the same ID 'chkSourceElementValue' were found. FindControl requires that controls have unique IDs."  where chkSourceElementValue is the ID of the checkbox thats created in the item template.  I am setting the item template, header template, data source at page_load and also data binding it at that point.  I have enclosed snippets of my code, as well as the error message stack below.  it looks like the error is originating from within RadComboBox. 

I am using the latest version of Telerik ASP.NET AJAX Controls (ASP.NET AJAX Q3 2010 NET 35)

Please advise at the earliest.  Thank you.

Page_Load:

 

 

this

 

.rcbSourceElement.ItemTemplate = new SourceElementValueDropDownTemplate(ListItemType.Item, iCountOfColumnsInDataset, mColumnNamesToDisplay);

 

 

 

this.rcbSourceElement.HeaderTemplate = new SourceElementValueDropDownTemplate(ListItemType.Header, iCountOfColumnsInDataset, mColumnNamesToDisplay);

 

 

 

this.rcbSourceElement.DataSource = dsSourceElementValuesForDisplay;

 

 

 

this.rcbSourceElement.DataBind();

 


Template Class

public class SourceElementValueDropDownTemplate : ITemplate
{
    PlaceHolder ph = new PlaceHolder();
    private ListItemType CurrentTemplateType { get; set; }
    private int CountOfColumns { get; set; }
    private string[] ColumnHeaders { get; set; }

    public SourceElementValueDropDownTemplate(ListItemType type, int countOfColumnsInDropDown, string[] columnHeaders)
    {
        CurrentTemplateType = type;
        CountOfColumns = countOfColumnsInDropDown;
        ColumnHeaders = columnHeaders;
    }

    void  ITemplate.InstantiateIn(Control container)
    {
        CheckBox chkSourceElementValue;
        Label lblSourceElementValue;
        switch(CurrentTemplateType)
        {
            case ListItemType.Header:
                ph.Controls.Add(new LiteralControl("<ul>"));
                foreach(string mColName in ColumnHeaders)
                {
                    ph.Controls.Add(new LiteralControl("<li class='rcbColumn'>"));
                    ph.Controls.Add(new LiteralControl(mColName));
                    ph.Controls.Add(new LiteralControl("</li>"));
                }
                ph.Controls.Add(new LiteralControl("</ul>"));
                container.Controls.Add(ph);
               
                break;
            case ListItemType.Item:
                ph.Controls.Add(new LiteralControl("<ul>"));
                for (int iRCbColCtr = 1; iRCbColCtr < CountOfColumns ; iRCbColCtr++) /* First column of the dataset is expected to be the ELEMENT_VALUE_KEY.  No need to show that in a column */
                {
                    ph.Controls.Add(new LiteralControl("<li class='rcbColumn'>"));

                    if (iRCbColCtr == 1) // This is the first column - must appear as a checkbox
                    {
                        chkSourceElementValue = new CheckBox();
                        chkSourceElementValue.ID = "chkSourceElementValue";
                        chkSourceElementValue.Attributes.Add("ColIndex", iRCbColCtr.ToString());
                        chkSourceElementValue.DataBinding += new EventHandler(chkSourceElementValue_DataBinding);

                        //chkSourceElementValue.CheckedChanged += new EventHandler(chkSourceElementValue_CheckedChanged);
                        ph.Controls.Add(chkSourceElementValue);
                    }
                    else
                    {
                        lblSourceElementValue = new Label();
                        lblSourceElementValue.ID = "lblSourceElementValue"; 
                        lblSourceElementValue.Attributes.Add("ColIndex", iRCbColCtr.ToString());
                        lblSourceElementValue.DataBinding += new EventHandler(lblSourceElementValue_DataBinding);
                        ph.Controls.Add(lblSourceElementValue);
                    }
                   
                    ph.Controls.Add(new LiteralControl("</li>"));
                }
                ph.Controls.Add(new LiteralControl("</ul>"));
                //ph.DataBinding += new EventHandler(ph_DataBinding);

                container.Controls.Add(ph);
                break;
        }
    }

    void chkSourceElementValue_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox chkSourceElementValue = sender as CheckBox;
        RadComboBox rcbParentCombo = chkSourceElementValue.Parent as RadComboBox;

    }

    void lblSourceElementValue_DataBinding(object sender, EventArgs e)
    {
        Label lblSourceElementValue = (sender) as Label;
        int iColIndex = Convert.ToInt16(lblSourceElementValue.Attributes["ColIndex"]);

        RadComboBoxItem container = (RadComboBoxItem)lblSourceElementValue.NamingContainer;
        lblSourceElementValue.Text = ((DataRowView)(container.DataItem))[iColIndex].ToString();
    }

    void chkSourceElementValue_DataBinding(object sender, EventArgs e)
    {
        CheckBox chkSourceElementValue = (sender) as CheckBox;
        int iColIndex = Convert.ToInt16(chkSourceElementValue.Attributes["ColIndex"]);

        RadComboBoxItem container = (RadComboBoxItem)chkSourceElementValue.NamingContainer;

        chkSourceElementValue.Text = ((DataRowView)(container.DataItem))[iColIndex].ToString();
    }
}


Error Received :


[HttpException (0x80004005): Multiple controls with the same ID 'chkSourceElementValue' were found. FindControl requires that controls have unique IDs.]
   System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +273
   System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +320
   System.Web.UI.Control.EnsureNamedControlsTable() +61
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +222
   System.Web.UI.Control.FindControl(String id) +12
   Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +182
   Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +227
   Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +227
   Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +227
   Telerik.Web.ChildControlHelper.FindControlRecursive(Control searcher, String ID) +186
   Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e) +1031
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +8687734
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint
 
Ashwin Kumar
Top achievements
Rank 1
 answered on 08 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?