Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
274 views
Hi Telerik,

Could I please have an example where the 'OnFocus' and 'OnBlur' events are successfully called after being applied to a RadListBox? I've tried numerous different approaches and none of them seem to work.

Sean

EDIT: Had to set the TabIndex property per HTML5 documentation -- http://www.w3.org/TR/html5/editing.html#attr-tabindex

EDIT2: Okay, so after playing around with this for a bit, I'm still not quite where I would like to be. I would like to attach a blur event to a dynamically created RadListBoxItem.

var listboxItem = radListBox.get_selectedItem();
 
$(listboxItem.get_element()).blur(function () {
    console.log("Item blurred.");
});

doesn't fire anything. What's the proper procedure?

EDIT3: So I've got something that works (mostly) but I'm not happy with... I can already think of one scenario it won't work in, in fact, but I figured I'd update.

So, the RadListBox's OnClientSelectedIndexChanged event seemed like a good place to start. I came to the conclusion that there's proooobably not a good way to set the focus to a RadListBoxItem. So, I've got this:

function OnClientSelectedIndexChanged(sender, eventArgs) {
    console.log("ClientSelectedIndexChanged");
    $telerik.$(radListBox1._getGroupElement()).focus();

which will set focus to the radListBox responsible for the OnClientSelectedIndexChanged event. Unfortunately, this isn't quite sufficient for my purposes.

My goal is this:

I have a button on the page which has two states: 'Edit Text' or 'Add Item'. When a RadListBoxItem is focused I want the button to say 'Edit Text'. When the user clicks away from that item I want it to say 'Add Item.' The above code will work for some scenarios, but consider the following:

  • User has a RadListBox with room for 4 RadListBoxItems to be displayed.
  • The RadListBox contains only 2 RadListBoxItems.
  • The user selects the first RadListBoxItem. OnSelectedIndexChanged fires, and the jquery sets the RadListBox to focused.
  • The user then clicks on a blank area of the RadListBox. Since the object is focused -- this doesn't change anything, but it 'feels' like to the user like they've clicked away from the item. Hence, the button should say 'Add Item'.

Ideally in that scenario I would deselect the item after detecting the blur event, but without the RadListBox blurring this is impossible...

Any advice on how to improve this design would be appreciated. Thanks.


Sean
Top achievements
Rank 2
 answered on 19 Oct 2011
3 answers
140 views
I have no idea really what I did to cause this. The popup RadWindow has strange visual glitches in the title bar area. I just wanted to make a basic, normal RadWindow as a popup from clicking a button in the parent page.

Here's the code for the popup window BatchAccounts.aspx:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title>Add Batch Accounts</title>
    <link href="/Styles/mainLight.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
 
        function CloseAndRebind(args) {
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
        }
 
        function returnToParent() {
            var oArg = new Object();
            //get a reference to the current RadWindow
            var oWnd = GetRadWindow();
            oWnd.close();
        }
 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="mainArea">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" IsSticky="true" />
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1">
            Add Batch Accounts TEST
        </telerik:RadAjaxPanel>
    </div>
    </form>
</body>
</html>
Phil
Top achievements
Rank 1
 answered on 19 Oct 2011
2 answers
116 views

I get this error when I try to filter on the first column in my grid:

is neither a DataColumn nor a DataRelation for table DefaultView.

<telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderText="PO #" Visible="true">
 <ItemTemplate>
<asp:Label ID="lblPONumber" Text='<%# Eval("_PONumber") %>' runat="server">
</
asp:Label>
</
ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>

I am not sure what to give you so I am giving you the ASPX for the first column. 
Any ideas on why this error is occurring?

Thanks,
Chuck

Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Oct 2011
2 answers
119 views
I'm using this demo http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=upload&RadUrid=bc55435e-4358-4e8f-9b36-bc35d69be555 as my model.  Of course, I have to switch it up a bit to use data from my back-end, and we're trying to create a library of many doc types, not just images, so my EditForm is created and handled a bit differenly.

It seems as if it's working pretty well, but I'm having a problem:  On either update or insert, the EditForm doesn't disappear after the ajax postback is through. The grid does re-display with the new data, so things are working.  I've just munged something up where the EditForm doesn't go away.

Anyway, can someone point me in the right direction, please?  I don't see in the demo what makes the EditForm go away which I've (apparently) lost.

Thank you,

Scott
golddog
Top achievements
Rank 1
 answered on 19 Oct 2011
4 answers
146 views
Hello,

I have a situation where users are creating a single never ending recurrence on the scheduler then editing the appointment each week to account for small variances in attributes or resources. This is not a problem except that the "exception" string continues to grow with each change. Currently I have the length of the recurrencerule at 2048 bytes and I don't think the correct solution is to keep extending that columns size.

My preferred solution would be to do something like count the number of exceptions created. I think there are some examples demonstrating a way to do this using parsing and something like "parsedrule.Occurrences". If the count is higher than 50 then I would like to create a new appointment which is a copy of the appointment being modified "newappt = e.appointment" then remove all exceptions from the new appointment and set it with a start date one day past the last exception in the old appointment. Then I would like to change the old appointment from a never ending recurrence to have an end date on the date of its last exception.

Does that make sense?

I've pretty much got it worked out except the copy, creation and modification steps. Is there any easier way to do this? If not, can you give me some pointers to proceed with my concept above?

Thanks!
Plamen
Telerik team
 answered on 19 Oct 2011
1 answer
127 views
Hi,

for those who would like to have custom context menu trigger element this post might be helpful:
http://weblogs.asp.net/evovision/archive/2011/10/14/customizing-radtreeview-adding-custom-context-menu-trigger.aspx

I've attached a file with 3 screenshots.

To Telerik support:
in that post I write:Note that when you click on "gear" highlighting of node item may disappear. This will happen if EnableDragAndDrop is not set or false. I haven't though how to solve that because in my use case I have EnableDragAndDrop="true", but I will ask Telerik support about possible solution.

Could you please provide missing adjustments so that no matter what value is set to EnableDragAndDrop property highlighting doesn't go away. I guess it's because when it's not set control thinks that it should remove highlight after click event, but when value is set control assumes that drag'n'drop operation may happen and preserves highlighting. I have it enabled in my project (not because of this :), so currently can't spend more time on it.

Thank you!
Plamen
Telerik team
 answered on 19 Oct 2011
1 answer
101 views
Hi
I
have a webcontrol that has a inherit of RadWindow.
And the Web controls within the page does not show off, but the contents inside the ContentTemplate.
Please help me
Thanks
Marin Bratanov
Telerik team
 answered on 19 Oct 2011
3 answers
123 views

Hello,

How do I cancel the appointment editor popup after the user double-clicks an appointment? I need to implement some validation before I allow the user to edit an appointment. This is an example of my code, but the set_cancel method is not valid apparently.

function onAppointmentDoubleClick(sender, eventArgs) {
              
            var ID = '<%=ID%>';
  
            if (ID == '0') {
                eventArgs.set_cancel(true);
            }
        }

Stuart Hemming
Top achievements
Rank 2
 answered on 19 Oct 2011
1 answer
106 views
I'm trying to use the RadEditor control in a partial view of my my MVC project.
<telerik:RadEditor Skin="Windows7" ToolsFile="~/Content/tools.xml" RegisterWithScriptManager="false"
   ID="TestEditor1" runat="server" DialogHandlerUrl="Telerik.Web.UI.DialogHandler.axd"
   SpellCheckSettings-AjaxUrl="/Telerik.Web.UI.SpellCheckHandler.axd" EditModes="Design,Preview" SpellCheckSettings-FragmentIgnoreOptions="All" SpellCheckSettings-WordIgnoreOptions="RepeatedWords,UPPERCASE">
</telerik:RadEditor>

This piece of code is working ok on IE. However, I cannot write anything nor use any tool from the editor on Firefox7 and Chrome 9.0.597.98.

I'm using the Q2 2011 version of the RadControls for AJAX

P.S: Updated Chrome to 14.0.835.202 m, it does not work.
Oscar
Top achievements
Rank 1
 answered on 19 Oct 2011
3 answers
86 views
Hello,

We are using several radtextboxes in our application and the top margin is not able to be set to 0px in IE7. The top margin seems to be 2px in IE7, and when I set vertical-align:top or bottom !important its only off by 1px. It renders fine in IE8-9, and Chrome. We have the same problem with the raddatepicker but there is only a 1px margin on it. I know setting top:-1px; will work in IE7 but the problem is it breaks it for all other browsers.

Do you know any way to get rid of the top margin on IE7 without executing different CSS based on browser?

Thank you,

Tzvetan
Galin
Telerik team
 answered on 19 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?