Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
266 views
Hello,

ASP.NET Ajax: 2012.1.215.40

I used a bounded RadDatePicker inside a DetailsView with the following parameters:
<telerik:RadDatePicker ID="Test" runat="server" SelectedDate='<%#Bind("Birthday") %>' SkipMinMaxDateValidationOnServer="true" MinDate="1900-01-01"></telerik:RadDatePicker>

Initially, the "Birthday" property from datasource is DateTime.MinValue. 

When I turn the DetailsView from ReadOnly to Edit mode, the RadDatePicker text box displays the value "01/01/0001 00:00:00" and its border becomes red with a warning triangle in the right.

I would like that when my "Birthday" property is set to DateTime.MinValue and the DetailsView is bound in Edit mode, the RadDatePicker empties its text box in place of displaying the red border. But when the user enters a date smaller than MinDate, the normal behaviour remains, ie red border is displayed.

How can I do this?

Thank you,
Alain

 
Maria Ilieva
Telerik team
 answered on 20 Apr 2012
4 answers
315 views
I am trying to make the nodes clickable so that I can do something when they are clicked. I am doing simple manual binding using a  list of objects. I am only binding one level at a time because of how deep our heirarchy can be. So when they click on the node I will bind the level below that person. I have a button inside an item template. After the nodes render, I click on the button and it does a post back but does not fire the button click event. If I click it a second time it does a postback and DOES fire the button click event. I have also tried to handle the GroupItemDataBound to use the FindControl you introduced in SP1 with the hopes of attaching the event there instead of the markup as I am doing below. How ever FindControl("LinkButtonNode") returned null. Please advise as I have not run into this before. Or if you know a better way to make the node clickable please advise.

Markup:

<telerik:RadOrgChart ID="RadOrgChartDirectReports1" EnableViewState="true" Skin="Office2010Silver"
           runat="server">
           <ItemTemplate>  
               <asp:Button CausesValidation = "false" OnClick="LinkButton_Click" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "EmployeeId")%>'
                   runat="server" Text = "Click" ID="LinkButtonNode"></asp:Button>
           </ItemTemplate>
           
       </telerik:RadOrgChart>


Code behind:

private void BindOrgChart2()
   {
       RadOrgChartDirectReports1.DataSource = DataAccess.GetNewHireList();         
       RadOrgChartDirectReports1.DataBind();
   }

public void LinkButton_Click(object sender, EventArgs e)
   {
       string test = "";
   }


DataAccess:

namespace RadControlsTestWebApp1
{
    public class DataAccess
    {
        public static List<HeirarchyBind> GetNewHireList()
        {
            var list = new List<NewHireNotification>();
            using (var client = new RadControlsTestWebApp1.EmployeeService.NewHireNotificationClient())
            {
                list = client.GetEmployeeNewHireNotifications(null);
            }
 
            var newlist = list.Select(x => new HeirarchyBind
            {
                Name = string.Format("{0} '{1}' {2}", x.HireInformation.FirstName, x.HireInformation.PreferredName, x.HireInformation.LastName),
                EmployeeId = x.HireInformation.EmployeeId,
            }).ToList();
 
            return newlist;
        }
    }
}


Peter Filipov
Telerik team
 answered on 20 Apr 2012
1 answer
107 views
Hi Team,

I have a rad combobox for which i am checking the check boxes on client side based on the text entered using the below code.

combo.get_items().getItem(i).set_checked(

 

true);

 but it did not show the text of all the items checked which matches the typed criteria, instead shows the text of only the first matching item. and after any event on the page the text chnages (to the correct text).

for example if i type a in the combo box, it cheks the items 'apple' and 'ant' but shows the text of the combox only as 'apple' instead of 'apple, ant' and once i click on any button it changes to 'apple, ant'

Tried to use combo.set_text("mytext"), but did not work

Thanks for any suggestions

Ivana
Telerik team
 answered on 20 Apr 2012
0 answers
82 views
<telerik:RadTabStrip ID="radTabIn" runat="server" Skin="Web20" SelectedIndex="0"  style="float:none" MultiPageID="radIPPage" Width="100%">
                           <Tabs>
                <telerik:RadTab Text="<span class='underline'>R</span>egistration Address" Width="22%" TabIndex="0" Selected="True" 
                                   AccessKey="R" ToolTip="Alt+r">
                </telerik:RadTab>
                <telerik:RadTab Text="<span class='underline'>P</span>atient Details" Width="22%" TabIndex="1" AccessKey="P" ToolTip="Alt+p">
                </telerik:RadTab>
                <telerik:RadTab  Text="<span class='underline'>W</span>ork Address" Width="21%" TabIndex="2" AccessKey="W" ToolTip="Alt+w">
                </telerik:RadTab>
                <telerik:RadTab IsBreak="true" Text="Past <span class='underline'>H</span>istroy" Width="25%" TabIndex="3" AccessKey="H" 
                                   ToolTip="Alt+h">
                </telerik:RadTab>
                <telerik:RadTab Text="Aller<span class='underline'>g</span>ies" Width="22%" TabIndex="4" AccessKey="G" ToolTip="Alt+g">
                </telerik:RadTab>
                <telerik:RadTab Text="Ha<span class='underline'>b</span>its-Immunisation" Width="22%" TabIndex="5" AccessKey="B" 
                                   ToolTip="Alt+m">
                </telerik:RadTab>
                <telerik:RadTab Text="D<span class='underline'>o</span>ctor Details" Width="21%" TabIndex="6" AccessKey="O" ToolTip="Alt+o">
                </telerik:RadTab>
                <telerik:RadTab Text="Roo<span class='underline'>m</span> Allotment" Width="25%" TabIndex="7" AccessKey="M" ToolTip="Alt+m">
                </telerik:RadTab>
            </Tabs>
                                </telerik:RadTabStrip>

Hi

This is Rathan . I palced one radmenu control inside the form ,its showing properly in IE7 ,But not properly align the
 IE8 version like below screenshot and tabcontrol  sourcecode. Please help me for rectify this problem .

Thank u in Advance.

Rathan
Top achievements
Rank 1
 asked on 20 Apr 2012
0 answers
174 views
Hi Support
I need a help for my RadGrid . In this Grid data are comming from data base and it has five hundred of records . So definetly we need paging with Page Size 20 . In this grid we also set Radio Button . In my page there is one telerik treeview control , suppose the one treeview node is select by User that corresponding row should be selected in RadGrid . See the below code , one thing We need not to think anything about of Treeview , because I hadrcoded one node number  which is QuestionNumber in the below code :

protected void SomeButton_Click(object sender, EventArgs e)
{
 int Questionnumber = 100// this number is actually pass through method parameter .

 RadGrid1.Allowpaging = false;
 RadGrid1.ReBind();
 foreach (GridDataItem item in grid1.Items)
 {
  RadioButton btn = (RadioButton)item.FindControl("radiobutton1");
  string value = item.GetDataKeyValue("Questionnumber").ToString(); 
    if( Convert.ToInt32(value) == Questionnumber)
          {
                 btn.checked = true; // see this is mandatory , because Question number is coming from a method which is related to a
// treeview selected node , and that node corresponding row should be selected in RadGrid , here in this button click have nothing to do with
//treeview , so we hard coded the QuestionNumber 100

RadGrid1.CuurentPageIndex = Questionnumber;// here I need to set something like that the selected RadioButton Corresponding
Row or Page should be load . suppose my selected Radio Button row relies in 315 Row number , so show datagrid in such a way that
corresponding page number I mean paging suppose it is 9 th page that page should come in grid rather than starting from page 1
and also radio button should selected with it
          }
 
}
RadGrid1.Allowpaging = true ;
 RadGrid1.PageSize = 20; // If I make this Size my selected Radio button is Not Showing in DataGrid
//and if I make it 100 or above then it is Showing .

RadGrid.ReBind(); //If I make it ReBind then it is my radio button is not showing  selected row in RadGrid .
 
}

This is very important , other wise my telerik control becomes unused. See in aspx page I don't set any
AllowPaging = true .
Pl give me any suggestion pl

One Solution may be , though the grid  may have thousands of records getting from database , so see the paging where the selected row is existing , suppose radiobutton.selected row is in page 5 so start paging and load grid data from 5th page and there is option previous and next paging...something like that , how can I do
DEBAL
Top achievements
Rank 1
 asked on 20 Apr 2012
3 answers
138 views
Here is the code I am trying.How to access datepicker in server validate?
<EditItemTemplate>
                            <telerik:RadDatePicker ID="StartDate" runat="server">
                            </telerik:RadDatePicker
<asp:CustomValidator ControlToValidate="StartDate" ID="CustomValidator2" runat="server"
ErrorMessage="Please select" OnServerValidate="CustomValidator2_ServerValidate"> </asp:CustomValidator>
<EditItemTemplate>
Princy
Top achievements
Rank 2
 answered on 20 Apr 2012
1 answer
83 views
Hello Community


So, in my hosting, when the page is open, many controls for example:


- RadComboBox
- RadMaskedTextField


not working, i need click the action button to working


But the problem not occurs in my  machine , just in the hosting...


I have to make any setting in my host?
Kate
Telerik team
 answered on 20 Apr 2012
3 answers
95 views
Hey,
We've run up against a problem with the LinkedIn button in the newest version of the RadControls that doesn't seem to have been present in previous versions. When viewing our page in IE8 using either Compatibility mode or IE7 mode, clicking the LinkedIn button throws the following error:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; BRI/2; InfoPath.2; .NET CLR 1.1.4322; .NET4.0E; MALC)
Timestamp: Mon, 16 Apr 2012 17:03:09 UTC
 
Message: Object doesn't support this property or method
Line: 1765
Char: 1
Code: 0

When viewing in IE8 mode, however, the button works as expected. It also works under FF 11 and Chrome 18; Opera 11 opens the pop-up but appears blank. Anyone have any ideas as to what might be going on? I've checked the LinkedIn developer site and haven't found the exact same problem echoed so far.
Marin Bratanov
Telerik team
 answered on 20 Apr 2012
4 answers
201 views
Hello,

For all of our RadComboBox controls, the properties are set as in the sample below (via a server control that derives from RadComboBox), and EmptyMessage is set to 'Select...'.  I noticed that whenever an item was bound to the RadComboBox that started with S that item was automatically selected when tabbing through it on the UI.  We are using Q2-2011 DLLs.

Here is a test page you can look at to recreate the problem.  There is nothing but a shell in the code behind file.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ComboBoxProblem.aspx.cs"
    Inherits="TestBed.ComboBoxProblem" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="rsmMain" runat="server">
        <Scripts>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadScriptBlock ID="rsbMain" runat="server">
    </telerik:RadScriptBlock>
    <div>
        <telerik:RadComboBox ID="rcbTest" runat="server" AllowCustomText="false" ChangeTextOnKeyBoardNavigation="false"
            EnableTextSelection="true" MarkFirstMatch="true" EmptyMessage="Select..." CloseDropDownOnBlur="true"
            CollapseAnimation-Type="None" ExpandAnimation-Type="None" MaxHeight="200px">
            <Items>
                <telerik:RadComboBoxItem Text="Apples" Value="1" />
                <telerik:RadComboBoxItem Text="Oranges" Value="2" />
                <telerik:RadComboBoxItem Text="Pears" Value="3" />
                <telerik:RadComboBoxItem Text="Strawberries" Value="4" />
                <telerik:RadComboBoxItem Text="Wild Cherries" Value="5" />
            </Items>
        </telerik:RadComboBox>
    </div>
    </form>
</body>
</html>

I tracked this down to the highlightMatches() function when called from _onKeyDown. 

The code basically does this:
 - Set Text value to  EmptyMessage  (Text = 'Select...')
 - Look for matches.  None found so
 - Set Text value to 'Select..', look for matches, none found...
 - Set Text value to 'Select.', look for matches, none found...
 - Set Text value to 'Select', look for matches, none found...
 - Set Text value to 'Selec', look for matches, none found...
 - Set Text value to 'Sele', look for matches, none found...
 - Set Text value to 'Sel', look for matches, none found...
 - Set Text value to 'Se', look for matches, none found...
 - Set Text value to 'S', look for matches, HEY!  I found a match, so highlight it!

Here is your code for those functions:
_onKeyDown: function (k) {
    var j = k.keyCode || k.which;
    if (j == a.Keys.Escape) {
        k.preventDefault();
    } if ($telerik.isIE && j != a.Keys.Down && j != a.Keys.Up) {
        this._updateFilterText = true;
    } if (!this._fireEvents || this._ajaxRequest) {
        return;
    } if ($telerik.isIE9 && (j == 8 || j == 127)) {
        this._compensateValuePropertyChangeEvent = true;
    } if (!k) {
        k = event;
    } this.raise_onClientKeyPressing(k);
    this._lastKeyCode = j;
    if (j == a.Keys.Escape && this.get_dropDownVisible()) {
        this._hideDropDown(k);
        return;
    } else {
        if (j === a.Keys.Enter) {
            if (this.get_dropDownVisible()) {
                this._hideDropDown(k);
            } var g = this.findItemByText(this.get_text());
            if (this.get_allowCustomText() && !this.get_markFirstMatch() && !g) {
                if (this.raise_selectedIndexChanging(null, k) == false) {
                    var f = this.get_selectedItem();
                    var m = this.get_highlightedItem();
                    if (f) {
                        f.set_selected(false);
                    } if (m) {
                        m.unHighlight();
                    } this.set_selectedItem(null);
                    this.set_selectedIndex(null);
                    this.set_highlightedItem(null);
                    this.raise_selectedIndexChanged(null, k);
                    var l = { Command: "Select", Index: -1 };
                    this.postback(l);
                }
            } else {
                this._performSelect(this.get_highlightedItem(), k);
            } if (this.get_markFirstMatch()) {
                var h = this.get_text().length;
                this.selectText(h, h);
            } k.returnValue = false;
            if (k.preventDefault) {
                k.preventDefault();
            } return;
        } else {
            if (j === a.Keys.Down) {
                k.returnValue = false;
                if (k.altKey) {
                    this._toggleDropDown(k);
                    return;
                } this.highlightNextItem(null);
                if (k.preventDefault) {
                    k.preventDefault();
                } return;
            } else {
                if (j === a.Keys.Up) {
                    k.returnValue = false;
                    if (k.altKey) {
                        this._toggleDropDown(k);
                        return;
                    } this.highlightPreviousItem();
                    if (k.preventDefault) {
                        k.preventDefault();
                    } return;
                } else {
                    if (j === a.Keys.Tab) {
                        if (this.get_dropDownVisible()) {
                            this._hideDropDown(k);
                        } this._raiseClientBlur(k);
                        this._selectItemOnBlur(k);  // This causes the last item of RadComboBoxOne to be selected when I click on RadComboBoxTwo
                        this._applyEmptyMessage();
                        this._focused = false;
                        return;
                    }
                }
            }
        }
    } if (j == a.Keys.Left || j == a.Keys.Right) {
        return;
    } if (j >= a.Keys.Numpad0 && j <= a.Keys.Numpad9) {
        j -= (a.Keys.Numpad0 - a.Keys.Zero);
    } var d = String.fromCharCode(j);
    if (d && (!k.altKey) && !(this.get_enableLoadOnDemand() || !this.get_readOnly())) {
        this.highlightNextItem(d);
        return;
    }
}
  
  
function () { // This is highlightMatches() which is called from _selectItemOnBlur()
    if (!this.get_markFirstMatch()) {
        return;
    } var k = this.get_text();
    var f = this.getLastWord(k, this._getTrimStartingSpaces());
    if (this._getLastSeparator(k) == k.charAt(k.length - 1)) {
        return;
    } var d = this.findFirstMatch(f);
    if (this.get_highlightedItem()) {
        this.get_highlightedItem().unHighlight();
    } if (!d) {
        if (k && !this.get_allowCustomText() && !this.get_enableLoadOnDemand()) {
            var g = this._getLastSeparatorIndex(k);
            if (g < k.length - 1) {
                var l = k.substring(0, k.length - 1);
                if (l == "" && $telerik.isSafari) {
                    var h = this;
                    window.setTimeout(function () {
                        h.set_text(l);
                    }, 0);
                } else {
                    this.set_text(l);
                    this.highlightMatches();
                }
            }
        } return;
    }
    d.highlight();
    d.scrollOnTop();
    this.set_value(d.get_value());
    var m;
    var j;
    var g = this._getLastSeparatorIndex(k);
    var e = k.substring(0, g + 1) + d.get_text();
    if (k != e) {
        this.set_text(e);
        m = g + f.length + 1;
        j = e.length - m;
    } else {
        if (this._callbackText.length > 0) {
            m = g + this._callbackText.length + 1;
            j = k.length - m;
        }
    } if (m && j) {
        this.selectText(m, j);
    }
}

Has anyone else ran into this?  Any suggestions on how to fix this (other than to override Telerik's code, which could get ugly really fast)?  Is this expected behavior?

Note: I have opened a support ticket (449526) for this problem and will update this post with any answer given me by Telerik.

Thanks!
Thad
Dimitar Terziev
Telerik team
 answered on 20 Apr 2012
3 answers
91 views


   Hi,

                    I have a panelbar in my page with four panel items. In each panelitem click  an usercontrol (.ascx) will be loaded in that panelitem dynamically (asyn postback---ajax). After the pageload i clicked the second panel item. Now a javascript error occurs that is

Error: Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type

This error occurs only if it contains telerik controls. I this controls contains  asp.net controls then no error will occur

Please give a solution for this problem..

Thanks
Velkumar.
Kate
Telerik team
 answered on 20 Apr 2012
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
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
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?