Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
623 views
Hi All,
Just wondering how can I update parent control from child user control?
Here's the structure of my Page
Master Page
    Parent Aspx with my radmenu
         User Control with button.

When I click on my button it updates my radmenu when theres postback,
but when its ajaxified my radmenu wont update.

Any code I could use to link child to update parent control with Ajax.

Thanks in advance,
RJ
RJ
Top achievements
Rank 1
 answered on 26 Mar 2015
1 answer
111 views
I have a radscheduler and the date that shows up in the header is very dark.  I have used other radschedulers in my application and did not have this problem, so I have to believe that it is something I did with this specific one.  I have attached a screenshot of the code for the radscheduler and a screenshot of the problem.  Any help is appreciated.
Kevin
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
214 views
Hai, i got a problem using RadDateTimePicker.
I'm using a css class to apply style on button globally
The CSS style is like this:

button, input[type="button"], input[type="submit"]
 {
 border:2px solid #DFDFDF; -webkit-border-radius: 6px; -moz-border-radius: 6px;
 font-size:11px;font-family:tahoma, verdana, arial, sans-serif; padding: 4px 12px 4px 12px; text-decoration:none; display:inline-block;font-weight:bold; color: #141414;
 background-color: #E6E6E6; background-image: -webkit-gradient(linear, left top, left bottom, from(#E6E6E6), to(#CCCCCC));
 background-image: -webkit-linear-gradient(top, #E6E6E6, #CCCCCC);
 background-image: -moz-linear-gradient(top, #E6E6E6, #CCCCCC);
 background-image: -ms-linear-gradient(top, #E6E6E6, #CCCCCC);
 background-image: -o-linear-gradient(top, #E6E6E6, #CCCCCC);
 cursor: pointer;
  }
   
button, input[type="button"], input[type="submit"]:hover
{
    cursor: pointer;
    color: #414141;
    background-color: #cdcdcd; background-image: linear-gradient(to bottom, #cdcdcd, #b3b3b3);
 }
   
button, input[type="button"], input[type="submit"]:disabled
{
    opacity: 0.65;
    cursor: not-allowed;
}

and it makes the button ("Today", "OK", "Cancel") inside Calendar in RadDateTimePicker (On Calendar, Click on month, and it shows the button) is looks like disabled, and the cursor is "not-allowed" when i hover on it.

How to override the style on the button?

I have attach the image, it looks like disabled and the cursor is "not-allowed" (the screenshot in windows doesn't shows cursor, but believe me it's changed) 
Konstantin Dikov
Telerik team
 answered on 25 Mar 2015
1 answer
64 views
I have a webpage that has 2 user controls on it. In one user control i have a RadMenu. In the other user control, underneath the first user control, a flash movie object is placed, When I am developing and I run the application on my machine using either IE or Firefox as my default, the RadMenu displays over the flash movie. I then deploy the code to my development server. When I run the application (development server) using the Firefox browser on my machine the RadMenu displays over the flash movie.

When I run the application (development server) using IE browser on my machine the RadMenu displays behind the flash movie. This is the same IE (version 8) that my machine uses when running it locally on my machine.

I have tried everything but cannot see what is wrong. Attached is the code being generated using FireFox (embed) and IE(object). In both cases the wmode is set to opaque.Any thoughts on why it is displaying behind the flash movie when running IE using the development server only?
Ivan Danchev
Telerik team
 answered on 25 Mar 2015
1 answer
169 views
Hello,

I have a tree with node templates that are added programmatically in the code-behind. The tree is set up to display checkboxes (Checkboxes="true") and the template includes a label and checkbox.  I want to set up the tree so that when checking the node's checkbox will also set the template's checkbox to the opposite value and viceversa (checking the template's checkbox will set the node's checkbox).  I have tried different approaches but I just can't get this to work.  Can anybody point me in the right direction.  Here's the code for the .aspx page:

<style type="text/css">
    .RedBoldFont
    {
        color: red;
        font-weight:bold;
    }
    .RedBoldItalicFont
    {
        color: red;
        font-weight:bold;
        font-style:italic;
    }
</style>

<telerik:RadTreeView ID="attributesTree2" runat="server" OnNodeDataBound="attributesTree2_NodeDataBound" CheckBoxes="true" TriStateCheckBoxes="true" OnNodeCheck="attributesTree2_NodeCheck">

</telerik:RadTreeView>


 and for the code-behind:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace DDW
{
    public partial class TestingForDAR : System.Web.UI.UserControl
    {


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                
                ///////////////////////////////

                attributesTree2.DataSource = GetAttributes();

                attributesTree2.DataFieldID = "ID";
                attributesTree2.DataFieldParentID = "ParentID";
                attributesTree2.DataBind();


            }

            TreeNodeTemplate template = new TreeNodeTemplate();

            foreach (RadTreeNode node in attributesTree2.GetAllNodes())
            {                
                template.InstantiateIn(node);
            }

            //attributesTree2.DataBind();


        }

        public List<Attribute> GetAttributes()
        {
            List<Attribute> attributesList = new List<Attribute>();

            attributesList.Add(new Attribute(1, null, "Attribute A", "Description for Attribute A", true, false, false));
            attributesList.Add(new Attribute(2, 1, "Attribute A1", "Description for Attribute A1", true, false, false));
            attributesList.Add(new Attribute(3, 1, "Attribute A2", "Description for Attribute A2", false, false, false));
            attributesList.Add(new Attribute(4, 1, "Attribute A3", "Description for Attribute A3", false, false, false));
            attributesList.Add(new Attribute(5, null, "Attribute B", "Description for Attribute B", true, false, true));
            attributesList.Add(new Attribute(6, 5, "Attribute B1", "Description for Attribute B1", true, false, true));
            attributesList.Add(new Attribute(7, 5, "Attribute B2", "Description for Attribute B2", false, false, false));
            attributesList.Add(new Attribute(8, null, "Attribute C", "Description for Attribute C", false, false, false));
            attributesList.Add(new Attribute(9, 8, "Attribute C1", "Description for Attribute C1", false, false, false));
            attributesList.Add(new Attribute(10, 8, "Attribute C2", "Description for Attribute C2", false, false, false));

            //attributesList.Add(new Attribute(11, 10, "Attribute C21", "Description for Attribute C21", false, false, false));
            //attributesList.Add(new Attribute(12, 10, "Attribute C22", "Description for Attribute C22", false, false, false));
            //attributesList.Add(new Attribute(13, 12, "Attribute C22a", "Description for Attribute C22a", false, false, false));
            //attributesList.Add(new Attribute(14, 12, "Attribute C22b", "Description for Attribute C22b", false, false, false));
            //attributesList.Add(new Attribute(15, 12, "Attribute C22b", "Description for Attribute C22c", false, false, false));



            return attributesList;

        }

        protected void attributesTree2_NodeDataBound(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
        {
            Attribute nodeData = (Attribute)e.Node.DataItem;

            if (nodeData.Default)
            {
                //e.Node.ForeColor = Color.Red;
                e.Node.CssClass = "RedBoldFont";
                if (nodeData.Exclude)
                {
                    e.Node.CssClass = "RedBoldItalicFont";
                }

            }

            e.Node.Attributes.Add("Name", nodeData.Name);
            string exclude = nodeData.Exclude ? "true" : "false";
            e.Node.Attributes.Add("Exclude", exclude);
            e.Node.Attributes.Add("Description", nodeData.Description);


        }

        protected void attributesTree2_NodeCheck(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
        {
            e.Node.Attributes["Exclude"] = e.Node.Checked ? "false" : "true";

            attributesTree2.DataBind();
        }

    }


    public class Attribute
    {
        public int ID { get; set; }
        public int? ParentID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public bool Include { get; set; }
        public bool Exclude { get; set; }
        public bool Default { get; set; }

        public Attribute()
        {

        }

        public Attribute(int id, int? parentID, string name, string description, bool def, bool include, bool exclude)
        {
            ID = id;
            ParentID = parentID;
            Name = name;
            Description = description;
            Default = def;
            Include = include;
            Exclude = exclude;
        }

    }

    ////////////////////////////////////////////////////////////////////////////////////////////////

    class TreeNodeTemplate : ITemplate
    {

        public event CommandEventHandler Command;

        private void OnCommand(CommandEventArgs e)
        {

            if (Command != null)
            {
                Command(this, e);
            }
        }

        public void InstantiateIn(Control container)
        {
            //...  

            Label lblAttrName = new Label();
            lblAttrName.ID = "lblAttrName";
            lblAttrName.DataBinding += new EventHandler(lblAttrName_DataBinding);
            container.Controls.Add(lblAttrName);

            CheckBox chkExclude = new CheckBox();
            chkExclude.ID = "ckExclude";
            chkExclude.AutoPostBack = true;
            chkExclude.DataBinding += new EventHandler(chkExclude_DataBinding);
            chkExclude.CheckedChanged += new EventHandler(chkExclude_CheckedChanged);
            container.Controls.Add(chkExclude);

            //Button saveButton = new Button();
            //saveButton.ID = "saveButton1";
            //saveButton.Text = "save";

            ////set properties  
            //saveButton.Command += saveButton_Command;
            ////data binding event handler  
            ////add to controls collection  
            //container.Controls.Add(saveButton);
            //...  
        }

        private void lblAttrName_DataBinding(object sender, EventArgs e)
        {
            Label target = (Label)sender;
            RadTreeNode node = (RadTreeNode)target.BindingContainer;

            target.Text = node.Attributes["Name"];
            target.ToolTip = node.Attributes["Description"];
        }

        private void chkExclude_DataBinding(object sender, EventArgs e)
        {
            CheckBox chkExclude = (CheckBox)sender; 
            RadTreeNode node = (RadTreeNode)chkExclude.BindingContainer;

            chkExclude.Checked = Convert.ToBoolean(node.Attributes["Exclude"]);
            node.Checked = !chkExclude.Checked;


        }

        private void chkExclude_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox target = (CheckBox)sender;
            RadTreeNode node = (RadTreeNode)target.Parent;

            Attribute data = (Attribute)node.DataItem;
            node.Checked = !data.Exclude;

        }

    }




}


 
Plamen
Telerik team
 answered on 25 Mar 2015
1 answer
90 views
Hi Admin, I want to export a  excel report file. It include infomation customer( radgrid on usercontrol), oder(radgrid on usercontrol), order detail (Radgird on mainpage). I dont know how to combie data on many control-> a report.
Please show me how to solve it!
Thanks
David Tran

<div id="uxPOContainer" runat="server" class="POContainer">
        <asp:HiddenField runat="server" ID="hdfOrderId" />
        <uc:CustomerInfo ID="uxCustomerInfo" runat="server"></uc:CustomerInfo>
        <uc:OrderInfo ID="uxOrderInfo" runat="server"/>        
        <div class="myborder" ></div>
        <asp:Button ID="uxEditOrd" runat="server" Text ="Edit Order" OnClick="uxEditOrd_Click" CssClass="ButtonType1" Visible="false"  />
        <asp:PlaceHolder ID="phDetail" runat="server">
            <ext:RadListView runat="server" ID="rlvOrderDetail" ItemPlaceholderID="plhDetail" OnItemDataBound="rlvOrderDetail_ItemDataBound"
                OnNeedDataSource="rlvOrderDetail_NeedDataSource" OnItemCreated="rlvOrderDetail_ItemCreated" BorderWidth="1" >
                <LayoutTemplate>
                    <table class="FixTableOD TablePaddingTD TableWithInputFocus" border="1">
                        <colgroup>
                            <col class="w5" />
                            <col class="w25" />
                            <col class="w15" />
                            <col class="w10" />
                            <col class="w10" />
                            <col class="w15" />
                            <col class="w10" />
                            <col class="w10" />
                        </colgroup>

                        <thead class="TableHeader">
                            <tr>
                                <th></th>
                                <th class="FormatString"><%# Resources.LocalizedStrings.FieldName_ProductName %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_Quantity %></th>
                                <th class="FormatCode"><%# Resources.LocalizedStrings.Products_Grid_ProductUnit %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_UnitPrice %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_Amount %></th>
                                <th class="FormatDate"><%# Resources.LocalizedStrings.FieldName_ExpectDeliveryDate %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_CBM %></th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:PlaceHolder ID="plhDetail" runat="server"></asp:PlaceHolder>

                        </tbody>
                        <tfoot class="OrderDetailFooter inlineTableBg">
                            <tr>
                                <td colspan="2" >
                                    <asp:Label ID="Label1" runat="server" Text="<%$ Resources: LocalizedStrings,FieldName_Total %>"> </asp:Label>

                                </td>
                                <td class="FormatNumber" >
                                    <asp:Literal runat="server" ID="ltrTotalQuantity"></asp:Literal>
                                      <p class="totalQty">
                                    <asp:Literal runat="server" ID="ltrTotalQtyByCarton">
                                    </asp:Literal>
                                    <br />
                                    <asp:Literal runat="server" ID="ltrTotalQtyByPcs">
                                    </asp:Literal>
                                </p>
                                </td>
                                <td></td>
                                <td></td>
                                <td class="FormatNumber">
                                    <asp:Literal runat="server" ID="ltrTotalAmount"></asp:Literal>

                                </td>
                                <td></td>
                                <td class="FormatNumber">
                                    <asp:Literal runat="server" ID="ltrTotalCBM"></asp:Literal>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </LayoutTemplate>

                <ItemTemplate>
                    <div id="uxCalc">
                        <tr>
                            <td class="FormatNumber">
                                <%# Container.DataItemIndex + 1 %>
                            </td>
                            <td title='<%# Eval("ProductId") %>'>
                                <asp:HiddenField ID="ItemIndex" Value="<%# Container.DataItemIndex %>" runat="server" />
                                <%# Eval("ProductName") %>
                            </td>

                            <td class="FormatNumber">
                                <asp:Label  ID="uxQuantity" runat="server"><%# (int.Parse( Eval("Quantity").ToString())).ToString("#,##0") %></asp:Label>
                              

                            </td>
                            <td class="FormatCode">
                                <asp:Label ID="uxUOM" runat="server" Visible="false"  ><%#  Eval("UOM").ToString() %> </asp:Label>
                                <asp:Label ID="uxUOMName" runat="server" ></asp:Label> 
                            </td>
                            <td class="FormatNumber">
                                 <asp:Label ID="uxUnitPrice" runat="server"><%# (double.Parse( Eval("UnitPrice").ToString())).ToString("#,##0.00") %></asp:Label>
                            </td>
                            <td class="FormatNumber">
                                 <asp:Label ID="uxAmount" runat="server"><%# (double.Parse( Eval("Amount").ToString())).ToString("#,##0.00")  %></asp:Label>
                            </td>

                            <td class="FormatDate">
                                <asp:Label ID="uxExpectDeliveryDate" runat="server"><%# Eval("ExpectDeliveryDate").ToString() %></asp:Label>
                            </td>
                            <td class="FormatNumber">
                                 <asp:Label ID="uxCBM" runat="server"><%# double.Parse( Eval("CBM").ToString()) %></asp:Label>
                                
                            </td>
                        </tr>
                    </div>
                </ItemTemplate>


            </ext:RadListView>
        </asp:PlaceHolder>
    </div>
Kostadin
Telerik team
 answered on 25 Mar 2015
3 answers
169 views
Hello, 
I tried to Disable the Radtooltip,
<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID ="myTarget"  Position ="TopCenter"  AutoCloseDelay ="0"  Enabled ="false">


but the Tooltip is still active... 

I want to disable / enable the tooltip with Javascript, 
but set_visible(true / false) don't work.

I Use the RadControls Q1 2009 

any Idea ?           
Marin Bratanov
Telerik team
 answered on 25 Mar 2015
3 answers
289 views
Hello,

We are working on a very important project for our company.
Our project uses Telerik’s RadGrid control.
We are showing the DetailTable, when the user expands a The Master Table View.

We are 100% SURE that this issue was not present before an upgrade of Telerik’s Controls!
It doesn't work now and we don’t know why.

This is extremely important for us the we solve this issue as soon as possible, as we need to demonstrate the project to our clients soon!

The user can request different information through various reports.
Each time the user requests a report, new information is shown in the RadGrid.
However, the TableDetailView always retains the same columns, as the first request of details!? 

Please see this video: http://youtu.be/6dFA2mqep_U

How can I fix that?  

Thanks,
Daniel.
.NET Programmer at
ISR Corp.
Daniel
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
112 views
I have a telrik Grid with a FormTemplate, Inside of that I have a Multiline text box and two DropDownList controls. Because the Multiline text box takes up so much space the other controls appear to be aligning to the bottom and I want them to align to the top within the template. I haven't been able to figure out how or where to apply something like the ItemStyle-VerticalAlign="Top" and actually get it to work. I would appreciate any thoughts anyone might have.

Below is my current code:


<EditFormSettings EditFormType="Template">
    <FormTemplate>                           
        <
div class="editGridSubGoal">>                     
            <
asp:Label ID="lblSubGoalText" runat="server" Text="Sub-Goal:"  AssociatedControlID="tbSubGoalText"  Visible="false"  /> 
            <asp:TextBox ID="tbSubGoalText" runat="Server" TextAlign="Right" TextMode="MultiLine" Rows="5" Columns="55"
                 Text='<%# Eval("SubgoalText") %>' MaxLength="255" style=" overflow:auto;"  
                 onkeydown="if (this.value.length > 255) this.value = this.value.substring(0, 255);"
                 onkeyup="if (this.value.length > 255) this.value = this.value.substring(0, 255);"/>
            <asp:RequiredFieldValidator ID="tbSubGoalText_RequiredFieldValidator" runat="server" ErrorMessage="* Required" CssClass="validator" ControlToValidate="tbSubGoalText" Display="Dynamic" />
            <asp:Label ID="lblEditSubGoalStatus" runat="server" Text="Status:" AssociatedControlID="ddlSubGoalStatus" Visible="false" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:DropDownList ID="ddlSubGoalStatus" runat="server" SelectedValue='<%# Bind("StatusTypeCode") %>'>                              <asp:ListItem Value="INPROGRESS" Text="In Progress" />
            <asp:ListItem Value="MET" Text="Met" />
            <asp:ListItem Value="UNMET" Text="Un-Met" />
            </asp:DropDownList>
            <asp:LinkButton ID="btnCancelSubGoal" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:LinkButton>
            <asp:LinkButton ID="btnSaveSubGoal" runat="server"  CssClass="silverLinkButton"  CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' ><span>Save</span></asp:LinkButton>
        </div>
   </FormTemplate>


Viktor Tachev
Telerik team
 answered on 25 Mar 2015
1 answer
124 views
Hello,

I'm new to this forum, spending my last few hours searching for information/help, but with no results I decided to join and ask. Hope it's correct place, if not then please move it to more appropriate section.

I have moderate knowledge of C# and Java but was tasked with creating simple(at first glance) Chrome Extension. I wasn't familiar at all with all of quirks and small things that JS comes with, but was doing ok until I got to a point, where I have no idea what to do.

I'm using latest Chrome(41.0.2272.89.m as I'm writing this), with Windows 7 Enterprise.

The problem is that when user fills out one NumericBox and leaves focus(with TAB or clicking something else) onblur() is invoked and some other fields are updated with entered data. But I need to fill these boxes with extension that parses user provided string. And here is root of my problem.

In Chrome developer console, elements pane, when I locate element in question and look at event listeners I can see handler at blur event. Same goes for console:
var element=InputFormOnPageSampleNameForExamplePurposesOnly
element._events.blur[0].handler()  //<-this actually executes and updates what I need!

But, when I look at:
element.blur
//returns
function blur() { [native code] }
 
element.blur()
//returns
undefined

In my extension, to update them all I put element IDs in an array, then foreach it with function that I would like to call blur() handler on each of these elements, but I can't manage to do this and after around 4 hours of research I'm feeling stuck.When debugging with breakpoint inside loop I can see that current processed element has all regular properties except these written in ALL_CAPS and _events 
Is it even possible to fire this event from Chrome extension? Everything else so far works ok, but without this continuing this extension will be pointless as user will need to click each field at least once in order to update it.

And I have tried also trying to get those field select()-ed or click()-ed and even simulate keypresses, but nothing helped.
Abdiasz
Top achievements
Rank 1
 answered on 25 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?