Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
110 views
Hi,

 Iam using radscheduler version 2010 Q2, There is any possibilty to show Reminders for an appoientment even we are  not in scheduler page. i.e Display Reminder when we are in any page of Website  



Thanks 
Sanker 
Peter
Telerik team
 answered on 20 Jul 2011
4 answers
114 views
Hi Telerik,

Could you please clarify if this is expected behavior?

I am programatically setting the ForbiddenZones property of every dock on my page. I do so like this:

/// <summary>
/// Shows where docks can/can't be moved. Forbidden zones are all DockZone's with Docks.
/// </summary>
private void SynchForbiddenZones(RadDockLayout dockLayout)
{
    Logger.Info("Synching forbidden zones");
    IEnumerable<CormantRadDock> docks = dockLayout.RegisteredDocks.OfType<CormantRadDock>();
 
    foreach (CormantRadDock dock in docks)
    {
        List<string> forbiddenZones = new List<string>();
        foreach (CormantRadDock otherDock in docks.Where(otherDock => otherDock != dock && !otherDock.GetState().Closed))
        {
            forbiddenZones.Add(otherDock.DockZoneID);
            forbiddenZones.Add(otherDock.DockZoneID.Replace("RadDockZone_", "")); //Why is this necessary?
        }
        dock.ForbiddenZones = forbiddenZones.ToArray();
    }
}

I have found that there is a discrepancy between how Telerik's Client and Server code interpret ForbiddenZones. 

If I leave my forbidden zones as just "DockZoneID" then this code works fine:

function OnClientDragStart(dock) {
    var forbiddenZones = dock.get_forbiddenZones();
    for (var zoneId in forbiddenZones) {
        var zone = $find(forbiddenZones[zoneId]);
        if (zone != null) {
            var zoneElement = zone.get_element();
            Sys.UI.DomElement.addCssClass(zoneElement, "zoneDropNotOk");
        }
    }
}
 
function OnClientDragEnd(dock) {
    var forbiddenZones = dock.get_forbiddenZones();
 
    for (var zoneId in forbiddenZones) {
        var zone = $find(forbiddenZones[zoneId]);
        if (zone != null) {
            var zoneElement = zone.get_element();
            Sys.UI.DomElement.removeCssClass(zoneElement, "zoneDropNotOk");
        }
    }
}

but when I drag a dock onto an already populated dock zone, even though the zone glows red, I am still able to drop the dock onto the dock zone.

Yet, observe that if I strip of the "RadDockZone_" header -- thus making it the DockZone's UniqueName -- now the dock is unable to dock onto the dockzone in question. 

Yet, observe that if I only add the DockZone's UniqueName property to the dock's ForbiddenZone array that the above JavaScript stops functioning.

The client side appears to care about the ID of the zone, the server side cares about the UniqueName. If this is intended, why? It is a hassle to comment why I am storing two values when only one is necessary to determine uniqueness.
Pero
Telerik team
 answered on 20 Jul 2011
5 answers
210 views

Requirements

RadControls 2010.3.1317.35version

.NET version 3.5

Visual Studio version 2010

programming language C#

browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
This project demonstrates how to handle ASP.NET Form Validation with the RadAjaxManager when fired from the onkeypress event from a textbox and perform an async postback if the validation succeeded.

<head runat="server">
    <title></title>
    <telerik:RadCodeBlock runat="server" ID="radCodeBlock">
        <script type="text/javascript">
            function CheckEnterKey(sender, args) {
                var keyCode = args.get_keyCode();
                if (keyCode == 13) {
                    Page_ClientValidate("Search");
                    if (Page_IsValid) {
                        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                        ajaxManager.ajaxRequestWithTarget('<%= btnSearch.UniqueID %>', '');
                    }
                }
            }
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="radScriptMgr">
    </telerik:RadScriptManager>
    <telerik:RadInputManager ID="RadInputManager1"  runat="server">       
        <telerik:RegExpTextBoxSetting BehaviorID="Setting3" EmptyMessage="Enter Zip Code" ClientEvents-OnKeyPress="CheckEnterKey"
            ValidationExpression="\d{5}(-\d{4})?" ErrorMessage="Invalid Zip Code" Validation-IsRequired="true" Validation-ValidationGroup="Search">
                <TargetControls>
                    <telerik:TargetInput ControlID="txtZipCode" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting
    </telerik:RadInputManager>
    <telerik:RadAjaxLoadingPanel Skin="Default" runat="server" ID="pnlLoadingPanel">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlSearch" LoadingPanelID="pnlLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div style="text-align: center; margin: 0 auto;">
     <asp:TextBox ID="txtZipCode" ValidationGroup="Search" runat="server" MaxLength="5" Width="133px" Height="20px"></asp:TextBox>
      <telerik:RadButton runat="server" ID="btnSearch" Text="Search" ValidationGroup="Search">
       <Icon PrimaryIconCssClass="rbSearch" PrimaryIconLeft="4" PrimaryIconTop="4" />
      </telerik:RadButton>      
        <br /><br />
        <asp:Panel ID="pnlSearch" Height="100%" DefaultButton="btnSearch" Width="100%" runat="server">
            <asp:Literal ID="litTimeOfSearch" runat="server"></asp:Literal><br /><br /><br /><br />
        </asp:Panel>
    </div>
    </form>
</body>
</html>

After this you can use some event handling to perform the necessary action postback.

protected void Page_Load(object sender, EventArgs e)
 {
 
     this.btnSearch.Click += new EventHandler(btnSearch_Click);
 
 }
 
 void btnSearch_Click(object sender, EventArgs e)
 {
     Thread.Sleep(2000);
     litTimeOfSearch.Text = string.Format("<b>Last Search Executed at</b>: {0} <br/> <b>Zip code </b> : {1}",  DateTime.Now.ToShortTimeString()
         ,txtZipCode.Text);
 }
Iana Tsolova
Telerik team
 answered on 20 Jul 2011
2 answers
107 views
I have sql table like below.I want to show it in tree view


id   parentid     name
1     NULL       outlook
2     1      overcast
3     1       rainy
4     1       sunny
5     2        yes
6     3        wind
7     4      humidity
8     6       strong
9     6        weak
10    7        high
11    8         no
12    9         yes
13   10          no
14   15         yes
15   7        normal
please help me if any one knows.....
dhanya
Top achievements
Rank 1
 answered on 20 Jul 2011
0 answers
89 views
Hello,

I have a radgrid that i want to display images inside one of its columns

the XML file looks like this where home.jpg and home1.jpg are stored in a folder and they represent the name of the image
<?xml version="1.0" encoding="utf-8" ?>
<Files>
    <item ID="1">
        <filename>home.jpg</filename>
    </item>
  
  <item ID="2">
    <filename>home1.jpg</filename>
  </item>
  
</Files>

Thanks a lot for your help
Mike
Mike_T
Top achievements
Rank 1
 asked on 20 Jul 2011
0 answers
194 views
Hi,

I'm testing RadGrid filters and I have problems with template filters.

I want to have a template filter for a column binded to a datetime datafield, for filtering between two dates. The template has these controls:
    - a Date picker for start date.
    - a Date picker for end date.
    - a button to apply/clear the filter.

These are pieces of the code I'm using:

- ASPX:
...
    <telerik:GridBoundColumn DataField="DateTimeFieldDB"
        DataType="System.DateTime"
        FilterControlAltText="Filter DateTimeFieldDB column"
        HeaderText="Date/Time" SortExpression="DateTimeFieldDB"
        UniqueName="DateTimeCol" HeaderButtonType="LinkButton">
        <HeaderStyle Width="150px" />
                    <FilterTemplate>
                        <telerik:RadDatePicker ID="FromDT" runat="server" Width="70px"/>
                        <telerik:RadDatePicker ID="ToDT" runat="server" Width="70px"/>
                        <telerik:RadButton ID="btnFilterDT" runat="server" Text="Filter" CommandName="cmdFilterDT">
                        </telerik:RadButton>
                    </FilterTemplate>
    </telerik:GridBoundColumn>
...


- CS:
protected void myGrid_ItemCommand(object sender, GridCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "cmdFilterDT":
             GridColumn column = myGrid.MasterTableView.GetColumnSafe("DateTimeCol");
 
             GridItem[] fItems = myGrid.MasterTableView.GetItems(GridItemType.FilteringItem);
             RadDatePicker dpFrom = (RadDatePicker)fItems[0].FindControl("FromDT");
             RadDatePicker dpTo = (RadDatePicker)fItems[0].FindControl("ToDT");
             string sDateFrom = string.Format("{0: dd/MM/yyyy}", dpFrom.SelectedDate);
             string sDateTo = string.Format("{0: dd/MM/yyyy}", dpTo.SelectedDate);
 
             if (dpFrom.SelectedDate.ToString() != string.Empty && dpTo.SelectedDate.ToString() != string.Empty)
             {
                 column.CurrentFilterFunction = GridKnownFunction.Between;
                 column.CurrentFilterValue = string.Format("{0} {1}", sDateFrom, sDateTo);
             }
             else
             {
                 column.CurrentFilterFunction = GridKnownFunction.NoFilter;
                 column.CurrentFilterValue = "";
             }
 
             myGrid.MasterTableView.Rebind();
             break;
     }
 }


When I click the filter button the command is fired and the code for 'cmdFilterDT' is executed, but no changes are displayed in the grid (I have a rule from myGrid to myGrid in an RadAjaxManager for refreshing the changes).

Anyone can help me? I've been reading the help and the grid forum but I don't find any solution to this method for using template filters.

Thanks in advance,
John.



john
Top achievements
Rank 1
 asked on 20 Jul 2011
5 answers
136 views
It would be nice to have context menu on the columns of the grid that define which columns display (like windows explorer does). 

Does the RadGrid support this or does anybody know a way this can be easily done?
Sebastian
Telerik team
 answered on 20 Jul 2011
0 answers
140 views
hi dear telerik team :
my 2 radcomboboxes codes is like below :

<telerik:RadComboBox ID="RadcbCustomersEmail" runat="server" DataSourceID="sdsCustomers"
    DataTextField="Email" DataValueField="ID" EnableEmbeddedSkins="false" Skin="VistaByMe"
    ValidationGroup="A" Width="244px" CausesValidation="False"
    MaxHeight="150px" AppendDataBoundItems="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_RadcbCustomersEmail">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="plz choose..."
            Value="-1" />
    </Items>
</telerik:RadComboBox>
 
 
<telerik:RadComboBox ID="RadcbCustomersMobile" runat="server" DataSourceID="sdsCustomers"
    DataTextField="Mobile" DataValueField="ID" EnableEmbeddedSkins="false" Skin="VistaByMe"
    ValidationGroup="A" Width="244px" CausesValidation="False"
    MaxHeight="150px" AppendDataBoundItems="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_RadcbCustomersMobile">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="plz choose..."
            Value="-1" />
    </Items>
</telerik:RadComboBox>

and javascript codes :

 
function OnClientSelectedIndexChanged_RadcbCustomersEmail(sender, eventArgs) {
    var MobileCombo = $find("<%= RadcbCustomersMobile.ClientID %>");
    var ComboItem = MobileCombo.findItemByValue(sender.get_selectedItem().get_value());
    MobileCombo.trackChanges();
    if (ComboItem != null)
        ComboItem.select();
    MobileCombo.commitChanges();
}
 
function OnClientSelectedIndexChanged_RadcbCustomersMobile(sender, eventArgs) {
    var EmailCombo = $find("<%= RadcbCustomersEmail.ClientID %>");
    var ComboItem = EmailCombo.findItemByValue(sender.get_selectedItem().get_value());
    EmailCombo.trackChanges();
    if (ComboItem != null)
        ComboItem.select();
    EmailCombo.commitChanges();
}


my syntax is ok , but i have a logical error about these codes / it seems there is a loop here / how can i prevent this loop?

thanks in advance
best regards
Majid Darab
Top achievements
Rank 1
 asked on 20 Jul 2011
4 answers
222 views
Hi,
I want to display percentage as float number with 2 digit for fraction and a % sign after that in radgrid. How to do it? Thanks.
Princy
Top achievements
Rank 2
 answered on 20 Jul 2011
1 answer
114 views
I was wondering if RadUpload control has a built-in "upload via url" feature. I know i can use HttpWebRequest/Response classes but would be nice if you just paste the image url to the radupload and let it take care about the rest.

Peter Filipov
Telerik team
 answered on 20 Jul 2011
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?