Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
145 views
Good Afternoon,

I would like to know if it is possible to change a RadAutoCompleteBox's border colour though javascript. Also, is it possible to achieve the same validation failure styling as in a RadTextBox ?

var registerUser_Username = $find("<%= RegisterUser_Username.ClientID %>");
 
registerUser_Username._invalid = true;
registerUser_Username.updateCssClass();

Ivo
Top achievements
Rank 1
 answered on 17 Jul 2013
1 answer
160 views

Hi,

I want to show parent child hierarchy or self hierarchy but I don't know Levels of Hierarchy.  Next Hierarchy Table should be shown on based of some decision from code. I have seen one example http://www.telerik.com/help/aspnet-ajax/grid-self-referencing-hierarchy.html But It didn't allow any CRUD operations.

I want to do this by Coding and How can I add more GridTableView in Existing GridTableView? Below is Grid Code

<telerik:RadGrid ID="BicCodeGrid" runat="server" AutoGenerateColumns="false" OnNeedDataSource="BicCodeGrid_NeedDataSource"
                    Skin="Silk" OnItemCommand="BicCodeGrid_ItemCommand" OnDetailTableDataBind="BicCodeGrid_DetailTableDataBind"
                    OnItemDataBound="BicCodeGrid_ItemDataBound" >
                    <MasterTableView Width="100%" DataKeyNames="BICCodeID" ClientDataKeyNames="BICCodeID"
                        HorizontalAlign="NotSet" AutoGenerateColumns="False">
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="Kode" DataField="BICCode" UniqueName="BICCode"
                                ReadOnly="true" ItemStyle-Width="50px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="OmrÃ¥de" DataField="DanishDescription" UniqueName="DanishDescription"
                                ReadOnly="true" ItemStyle-Width="400px">
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn ButtonType="PushButton" Text=" + " CommandName="AddBicCode">
                            </telerik:GridButtonColumn>
                        </Columns>
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="BICCodeID" Name="DetailsTable" Width="100%" on>
                                <ParentTableRelation>
                                    <telerik:GridRelationFields MasterKeyField="BICCodeID" DetailKeyField="ParentID" />
                                </ParentTableRelation>
                                <Columns>
                                    <telerik:GridBoundColumn HeaderText="Kode" DataField="BICCode" UniqueName="BICCode"
                                        ReadOnly="true" ItemStyle-Width="50px">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderText="OmrÃ¥de" DataField="DanishDescription" UniqueName="DanishDescription"
                                        ReadOnly="true" ItemStyle-Width="300px">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn ButtonType="PushButton" Text=" + " CommandName="AddBicCode">
                                    </telerik:GridButtonColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>
                    <ClientSettings>
                        <ClientEvents OnCommand="RaiseCommand" />
                    </ClientSettings>
                </telerik:RadGrid>

 

 

 

Maria Ilieva
Telerik team
 answered on 17 Jul 2013
8 answers
146 views
I am populating the RadScheduler w/ some test data for the first time.  I have the following data in a table tied to the RadScheduler via a SQL Query. 

DataKeyField = 1
DataStartField = 2009-08-21 00:00:00.000
DataEndField = 2009-08-21 23:59:59.997
DataRecurrenceField = Daily
DataSubjectField = Test
DataRecurrenceParentKeyField = ??

A.  What is a "Recurrence Parent"?  How does this relate to Recurrence?
B.  DataStart is populated with a DateTime in SQL.  How does this affect recurrence (August 21 set to reoccur daily)?


Boyan Dimitrov
Telerik team
 answered on 17 Jul 2013
1 answer
98 views


In 1.1 I would have to set these properties in the code behind.

editor1.StripAbsoluteAnchorPaths = False

editor1.StripAbsoluteImagesPaths = False

editor1.ShowSubmitCancelButtons = False




How would I do that in 2013.2.611.40? I can't find the info anywhere. I looked through documentation but I must be missing it.

thanks j
Ianko
Telerik team
 answered on 17 Jul 2013
9 answers
197 views
Hi All,
I have a nested grid where I would like to export all items in the Master grid, but only those child grids that contain data.
Using this example (http://www.telerik.com/help/aspnet-ajax/grid-hide-expand-collapse-images-when-no-records.html) I thought I had the solution, but it's not working.
I'm probably doing the part in the if statement wrong (..Expanded = true/false) - what's the correct way to do this?

Thx in advance!
M.

Code in Grid_OnItemCommand:
if (e.CommandName.Contains("Export"))
        {
            //this expands everything
            // RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
 
            GridItem[] nestedViewItems = RadGrid1.MasterTableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    if (nestedView.Items.Count == 0)
                    {
                        RadGrid1.MasterTableView.Items[nestedViewItem.ItemIndex].Expanded = false;
                    }
                    else { RadGrid1.MasterTableView.Items[nestedViewItem.ItemIndex].Expanded = true; }
                }
            }
        }
Kostadin
Telerik team
 answered on 17 Jul 2013
1 answer
96 views
in the demo http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx
using IE10 the shipped date column is two dates side by side. if you use compatibility mode they show in two lines.

How do I make IE10 show in two lines like compatibility mode?

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 17 Jul 2013
3 answers
82 views
Hi,

I have a problem with the RadDatePicker width in IE 7, and you can notice this problem in your demo. Check the attachement
The width does not behave the same in IE7 as oppose to IE8 and above and Firefox

How shoud I handle that ?

I am running the Telerik last version Q1 2013
thanks
J-Francois
Milena
Telerik team
 answered on 17 Jul 2013
31 answers
2.0K+ views
k, I am having a terrible time with making the splitter take up 100% of the height (full page).

I can make it work easily without using master pages.  I simply follow the example that you guys have provided and it works wonderfully.  However, if I take the exact same example and apply it to my web app that is using a master page, I cannot get it to work at all.  Has anyone been able to have the splitter take up the full page using a master pages?  If so, can I see an example of how it was done?

Thanks,
Tad
Steve
Top achievements
Rank 1
 answered on 17 Jul 2013
11 answers
241 views
I have some NumericTextBox in a EditTemplate of a RadGrid. There is a strange behaviour with my NumericTextBox... When I mouse over the TextBox, the width lengthens for about 5-10 pixels.

What is the cause ?
Milena
Telerik team
 answered on 17 Jul 2013
5 answers
129 views
Adding anchor control to the titlebarcontainer of the dock does not display expand/collapse and close buttons in IE9 & IE10. It works perfectly in Firefox and Chrome.

I am attaching all the code and the screenshots related to this issue. Please let me know what I am missing. It was working fine with the trial version.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Dashboard1.ascx.cs" Inherits="Desktop_Controls_Dashboard1" %><br><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><br><%@ Reference VirtualPath="~/Desktop/Controls/Widgets/MonthlyMachineChart.ascx" %><br><br><telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Metro" <br>     OnSaveDockLayout="RadDockLayout1_SaveDockLayout" ><br>    <table><br>        <tr><br>            <%--<td style="width:20px">&nbsp;&nbsp;</td>--%><br>            <td style="vertical-align: top">                <br>                <telerik:RadDockZone ID="RadDockZone0" runat="server" Orientation="Vertical" Width="420px" <br>                    MinHeight="400px" Style="float: left; margin-right: 20px;"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>            <td style="vertical-align: top"><br>                <telerik:RadDockZone ID="RadDockZone1" runat="server" Orientation="Vertical" Width="420px"<br>                    MinHeight="400px" Style="float: left; margin-right: 20px;"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>            <td style="vertical-align: top"><br>                <telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Width="420px"<br>                    MinHeight="400px"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>        </tr><br>    </table><br></telerik:RadDockLayout>


using System;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Web;<br>using System.Web.UI;<br>using System.Web.UI.WebControls;<br>using System.Web.UI.HtmlControls;<br>using AzimaDLI;<br>using AzimaDLI.Users;<br>using Telerik.Web.UI;<br>using System.Text;<br><br>public partial class Desktop_Controls_Dashboard1 : BaseControl<br>{<br>    public int selectedPlantId = 0;<br>    private string connString = string.Empty;<br>    User thisUser = null;<br><br>    //Store the info about the added docks in the session.<br>    private List<DockState> CurrentDockStates<br>    {<br>        get<br>        {<br>            List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStates"];<br>            if (Object.Equals(_currentDockStates, null))<br>            {<br>                _currentDockStates = new List<DockState>();<br>                Session["CurrentDockStates"] = _currentDockStates;<br>            }<br>            return _currentDockStates;<br>        }<br>        set<br>        {<br>            Session["CurrentDockStates"] = value;<br>        }<br>    }<br><br>    protected void Page_Init(object sender, EventArgs e)<br>    {     <br>        if (Session != null)<br>        {<br>            connString = Session["ConnString"].ToString();<br>            thisUser = ((User)Session["User"]);<br>            selectedPlantId = Convert.ToInt32(Session["SelectedPlantId"]);<br>        }<br><br>        LoadWidgets();<br>        //if (Page.IsPostBack)<br>        //{<br>        //    //UpdateLayoutState();<br>        //    //Recreate the docks in order to ensure their proper operation<br>        //    for (int i = 0; i < CurrentDockStates.Count; i++)<br>        //    {<br><br>        //        RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);<br>        //        //We will just add the RadDock control to the RadDockLayout.<br>        //        // You could use any other control for that purpose, just ensure<br>        //        // that it is inside the RadDockLayout control.<br>        //        // The RadDockLayout control will automatically move the RadDock<br>        //        // controls to their corresponding zone in the LoadDockLayout<br>        //        // event (see below).<br>        //        RadDockLayout1.Controls.Add(dock);<br>        //        //We want to save the dock state every time a dock is moved.<br>        //        CreateSaveStateTrigger(dock);<br>        //        //Load the selected widget<br>        //        if (string.IsNullOrEmpty(dock.Tag) || dock.Closed)<br>        //        {<br>        //            return;<br>        //        }<br>        //        Control widget = LoadControl(dock.Tag);<br>        //        dock.ContentContainer.Controls.Add(widget);<br><br>        //        if (CurrentDockStates[i].Closed == true)<br>        //        {<br>        //            dock.Visible = false;<br>        //        }<br>        //    }<br>        //}<br>        //else<br>        //{<br>        //    LoadWidgets();<br>        //}<br>    }<br><br>    protected void Page_Load(object sender, EventArgs e)<br>    {<br>        <br>    }<br><br>    private void LoadWidgets()<br>    {<br>        //get the list of widgets that the user has<br>        List<WidgetUser> widgetList = WidgetUser.GetWidgetsByPortalUserId(thisUser.PortalUserId, connString);<br>        string title = string.Empty;<br>        string tag = string.Empty;<br>        string onclick = string.Empty;<br>        string href = string.Empty;<br>        HtmlAnchor anchor = new HtmlAnchor();<br>        <br>        //loop through the widgetList<br>        foreach (WidgetUser item in widgetList)<br>        {<br>            switch (item.WidgetId)<br>            {<br>                // customer widget<br>                case 1:<br>                    tag = "~/Desktop/Controls/Widgets/CustomerInfo.ascx";<br>                    title = Session["CID"].ToString();<br>                    CreateWidget(item, tag, title, null);                    <br>                    break;<br>                case 2:<br>                    tag = "~/Desktop/Controls/Widgets/WatchList.ascx";<br>                    anchor = GetAnchor("plus", "goToWatchList();", item.WidgetName, "javascript:void(0)");<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 3:<br>                    tag = "~/Desktop/Controls/Widgets/ManualCollection.ascx";<br>                    href = string.Format("~/Desktop/Reports/MachinesBySeverity.aspx?PlantId={0}&AreaId=0&MachType=manual", selectedPlantId);<br>                    anchor = GetAnchor("collect", onclick, item.WidgetName, href);<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 4:<br>                    tag = "~/Desktop/Controls/Widgets/OnlineCollection.ascx";<br>                    href = string.Format("~/Desktop/Reports/MachinesBySeverity.aspx?PlantId={0}&AreaId=0&MachType=online", selectedPlantId);<br>                    anchor = GetAnchor("collect", onclick, item.WidgetName, href);<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 5:<br>                    tag = "~/Desktop/Controls/Widgets/DataCollection.ascx";<br>                    href = string.Format("~/Desktop/Reports/OverdueMachines.aspx?PlantId={0}&AreaId=0", selectedPlantId);<br>                    anchor = GetAnchor("collect", onclick, item.WidgetName, href);<br>                    CreateWidget(item, tag, "", anchor);<br>                    break;<br>                case 6:<br>                    tag = "~/Desktop/Controls/Widgets/MonthlyMachineChart.ascx";<br>                    CreateMonthlyMachWidget(item, tag, "", "sevtrend");<br>                    break;<br>                case 7:<br>                    tag = "~/Desktop/Controls/Widgets/MonthlyMachineChart.ascx";<br>                    CreateMonthlyMachWidget(item, tag, "", "nofaults");<br>                    break;<br>            }            <br>        }<br>    }<br><br>    private HtmlAnchor GetAnchor(string cssclass, string onclick, string text, string href)<br>    {<br>        HtmlAnchor anch = new HtmlAnchor();<br>        anch.Attributes.Add("class", cssclass);<br>        if (onclick != string.Empty)<br>        {<br>            anch.Attributes.Add("onclick", onclick);<br>        }<br>        anch.InnerHtml = text;<br>        anch.HRef = href;<br>        return anch;<br>    }<br><br>    private void CreateMonthlyMachWidget(WidgetUser item, string tag, string title, string chartType)<br>    {<br>        //string id = string.Format("Raddock{0}", item.WidgetId);<br>        RadDock dock = CreateRadDock(title, 425, item, tag);<br><br>        MonthlyMachineChart chartControl = (MonthlyMachineChart) LoadControl(dock.Tag);<br>        chartControl.ChartType = chartType;<br>        chartControl.CurrentUser = thisUser;<br>        string href = chartControl.TitleLink;<br>        dock.ContentContainer.Controls.Add(chartControl);<br><br>        //string href = string.Empty; // chartControl.GetTitleLink();<br>        HtmlAnchor anchor = GetAnchor("collect", "", item.WidgetName, href);<br>        //titlebarContainer<br>        if (anchor != null)<br>        {<br>            dock.TitlebarContainer.Controls.Add(anchor);<br>        }<br>        AddDocktoZone(item.Column, dock);<br><br>        CreateSaveStateTrigger(dock);<br>    }<br><br>    private void CreateWidget(WidgetUser item, string tag, string title, HtmlAnchor anchor)<br>    {<br>        //string id = string.Format("Raddock{0}", item.WidgetId);<br>        RadDock dock = CreateRadDock(title, 420, item, tag);<br>        <br>        // content<br>        Control widget = LoadControl(dock.Tag);<br>        dock.ContentContainer.Controls.Add(widget);<br><br>        //titlebarContainer<br>        if (anchor != null)<br>        {<br>            dock.TitlebarContainer.Controls.Add(anchor);<br>        }<br>        AddDocktoZone(item.Column, dock);<br><br>        CreateSaveStateTrigger(dock);<br>    }<br><br>    private void AddDocktoZone(int column, RadDock dock)<br>    {<br>        if (column == 0)<br>        {<br>            RadDockZone0.Controls.Add(dock);<br>        }<br>        else if (column == 1)<br>        {<br>            RadDockZone1.Controls.Add(dock);<br>        }<br>        else if (column == 2)<br>        {<br>            RadDockZone2.Controls.Add(dock);<br>        }<br>    }<br><br>    private void CreateSaveStateTrigger(RadDock dock)<br>    {<br>        //Ensure that the RadDock control will initiate postback<br>        // when its position changes on the client or any of the commands is clicked.<br>        //Using the trigger we will "ajaxify" that postback.<br>        dock.AutoPostBack = true;<br>        dock.CommandsAutoPostBack = true;<br>    }<br><br>    private RadDock CreateRadDock(string title, int width, WidgetUser item, string tag)<br>    {<br>        RadDock dock = new RadDock();<br>        dock.DockMode = DockMode.Docked;<br>        dock.UniqueName = item.WidgetUserId.ToString();<br>        dock.ID = string.Format("RadDock{0}", dock.UniqueName);<br>        dock.Title = title;<br>        dock.Index = item.Row;<br>        dock.Closed = !item.IsActive;<br>        dock.Collapsed = item.Collapsed;<br>        dock.Width = Unit.Pixel(width);<br>        dock.Tag = tag;<br>        dock.EnableAnimation = true;<br>                <br>        dock.Commands.Add(new DockCloseCommand());<br>        dock.Commands.Add(new DockExpandCollapseCommand());<br><br>        return dock;<br>    }<br>    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)<br>    {<br>        //Populate the event args with the state information. The RadDockLayout control<br>        // will automatically move the docks according that information.<br>        foreach (DockState state in CurrentDockStates)<br>        {<br>            e.Positions[state.UniqueName] = state.DockZoneID;<br>            e.Indices[state.UniqueName] = state.Index;<br>        }<br>    }<br>    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)<br>    {<br>        CurrentDockStates = RadDockLayout1.GetRegisteredDocksState();<br><br>        //save the layout to the database<br>        for (int i = 0; i < CurrentDockStates.Count; i++)<br>        {<br>            int index = CurrentDockStates[i].DockZoneID.Length-1;<br>            int column = Convert.ToInt32(CurrentDockStates[i].DockZoneID.Substring(index, 1));<br>            bool isActive = !CurrentDockStates[i].Closed;<br>            bool collapsed = CurrentDockStates[i].Collapsed;<br>            int widgetUserId = Convert.ToInt32(CurrentDockStates[i].UniqueName);<br>            WidgetUser.Update(widgetUserId, column, CurrentDockStates[i].Index, isActive, collapsed, connString);<br>        }<br><br>        if (Page.IsPostBack)<br>        {<br>            //LoadWidgets();<br>        }<br>    }<br><br>    private RadDock CreateRadDockFromState(DockState state)<br>    {<br>        RadDock dock = new RadDock();<br>        dock.DockMode = DockMode.Docked;<br>        dock.ID = string.Format("RadDock{0}", state.UniqueName);<br>        dock.ApplyState(state);<br>        dock.Commands.Add(new DockCloseCommand());<br>        dock.Commands.Add(new DockExpandCollapseCommand());<br><br>        return dock;<br>    }<br>}

a.collect<br>{<br>    color: #FFFFFF;<br>    display: inline-block;<br>    height: 15px;<br>    margin: 5px 3px;<br>    text-decoration: none;<br>    width: 226px;  <br>    font-weight:bold;<br>    font-size: 13px;<br>    white-space: nowrap;<br>    overflow: hidden;<br>}


Thanks,
Nagasree

Dobromir
Telerik team
 answered on 17 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?