Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
149 views
I have an oddly behaving comboBox.

Here's my markup

 
<telerik:RadComboBox
                runat="server"
                id="rcbSite"
                width="210px"
                enableloadondemand="true"
                onclientitemsrequesting="rcbSite_OnClientItemsRequesting"
                showmoreresultsbox="True"
                enablevirtualscrolling="True" >   
            <WebServiceSettings Method="GetSitesComboBoxDataByCustomerId" Path="/Services/ClientSideDataService.asmx" />
            </telerik:RadComboBox>



Pretty reasonable, comboBox is tied to a webservice.

The onItemsRequesting function adds some extra data bits to the comboBox context that we need.

  
function rcbSite_OnClientItemsRequesting(sender, eventArgs) {
        //Get the selected customer
        var selectedCustomerId = $('#<%= CustomerDropDownId %> option:selected').attr('value');
 
        var context = eventArgs.get_context();
 
        //Set filter text
        context["FilterString"] = eventArgs.get_text();
        context["CustomerId"] = selectedCustomerId;
    }






In my codebehind I create and select an item if one was previously chosen.
if (siteId.HasValue)
{
     rcbSite.Items.Add(SiteManager.GetComboBoxItemBySiteId(siteId.Value));
     rcbSite.SelectedValue = siteId.Value.ToString();
}







And finally on document.ready I attach a selctedIndexChanged event to the comboBox

Sys.Application.add_load(function(){
             
            //If the combo box has items in it, select the first one
            //Selecting first item client side ensures that address fields are refreshed when binding individual item to combo box on initial page load
            var combo = $find("<%= rcbSite.ClientID %>");
            if (combo.get_items().getItem(0)) {
                combo.trackChanges();
                combo.get_items().getItem(0).select();
                combo.commitChanges();
            }
 
            $find("<%= rcbSite.ClientID %>").add_selectedIndexChanged(
            function (sender, eventArgs) {
                var item = eventArgs.get_item();
                 
                var addressFormFields = new InventoryAddressFields("<%= ddlAddressType.ClientID %>", "<%= txtAttenTo.ClientID %>", "<%= txtAddress1.ClientID %>",
                                                               "<%= txtAddress2.ClientID %>", "<%= txtCity.ClientID %>", "<%= ddlCountry.ClientID %>",
                                                           "<%= ddlState.ClientID %>", "<%= ddlCounty.ClientID %>", "<%= txtPostalCode.ClientID %>",
                                                           "<%= txtPostalCodePlus4.ClientID %>", "<%= txtPhone.ClientID %>", "<%= txtFax.ClientID %>",
                                                           "<%= ddlTimezone.ClientID %>", "<%= chkObserveDST.ClientID %>", "<%= ddlVerificationStatus.ClientID %>");
 
                if (item) {
                    var selectedSiteId = item.get_value();
                 
                    GetAddressBySiteId(addressFormFields, selectedSiteId);
                }
                else
                {
                    clearAddressFields(addressFormFields);
                }
    }
    );
    });



Here's my issue:

 1. Page loads with one item inserted into comboBox & selected
 3. Click into comboBox & hit backspace
 4. Click off the comboBox

Expected:
ComboBox fires a selectedIndexChanged event since we now have no item selected

Actual:
Item is removed without firing event


What's interesting is that if you click into the box and off without removing an item. Then click in and remove it, the event fires correctly.

Any ideas?

Andrew
Top achievements
Rank 1
 answered on 05 Jul 2013
2 answers
74 views
Hello everyone,

I am trying to embed a calendar control within the ItemTemplate of a RadListView. It works so far, but I have problems updating the controls using the AutoPostBack feature. Each of these calendars needs to change the background of certain cells based on underlying data thats specific to each calendar (availability of a product on certain dates). Doing this works as well, but for some reason updating one of the calendars updates all other calendar instances as well. How can I fix that?

The code for the template looks like this:

<ItemTemplate>
<
img src="<%= ControlPath%>product.jpg" alt="<%# Eval("Name")%>" />
<div>
      <h2><%# Eval("Name")%></h2>
       <p><%# Eval("Description") %></p>
</div>
<br class="clear" />
<telerik:RadCalendar ViewStateMode="Disabled" runat="server" TitleFormat="MMMM yyyy" AutoPostBack="true" PresentationType="Preview" EnableNavigation="true" EnableMonthYearFastNavigation="false" OnDayRender="Calendar_DayRender" OnDefaultViewChanged="Calendar_DefaultViewChanged" />
</ItemTemplate>


Regards,
Sebastian
Sebastian
Top achievements
Rank 1
 answered on 05 Jul 2013
3 answers
92 views
Hi !

I want to select a ribbonbutton via server side, is it possible? I did not see any property to make a button selection, only the tabs, and that i'm not being able to make it work.

      var selectedButtonCookie = Request.Cookies.Get("selectedButton");
            if (selectedButtonCookie != null)
            {
                var button = ribbonBar.FindButtonByValue(selectedButtonCookie.Value);

                if (button != null)
                {
                    ribbonBar.SelectedTabIndex = button.ParentWebControl.TabIndex;
                }
            }

Thanks in advance
Kate
Telerik team
 answered on 05 Jul 2013
5 answers
117 views
Hi Team,
I have a radgrid with ClientSelectColumn.
I select a row on first page of the grid, move to second page select 3 rows on second page.
When I come back to first page, my selection on the first page disappears. I mean the selection does not persist.
So I tried what has been said in this post. It works very well as far as visualisation is concerned. It does show that I have my rows selected from different pages.
But when on a button click (outside the grid) I try to loop through this collection, all I get is the records from current selected page and not all the rows selected from different pages.

foreach (GridDataItem item in RadGrid1.SelectedItems)
{
..// Code here
}

RadGrid1.SelectedItems  gives rows from the current selected page only and not the entire selection.

Will you please help me with this?
Any help appreciated.

Thanks,
Lok..
Lokesh
Top achievements
Rank 1
 answered on 05 Jul 2013
1 answer
164 views
Hi Team,

I am using the Rad Calendar control, to display in the arabic format calendar, if I set the culture property to "ar-SA". But It throws the exception.

Valid values are between 1318 and 1500, inclusive.
Parameter name: year

Sample Code
<telerik:RadCalendar ID="radCalendar" runat="server" CultureInfo="ar-SA">               
            </telerik:RadCalendar>

I want display the Hijiri calendar if the culture property is "ar-SA", not only calendar and date picker as well.
So here I just want to confirm that whether this issue has been resolved in new releases or not.
If the same exists, I need a work around to resolve the issue.

Any help would be appreciated.
Thanks,
Konstantin Dikov
Telerik team
 answered on 05 Jul 2013
6 answers
830 views

Hi,

How to show a RadAlert on a modal RadWindow befor closing the radwindow.

Requirement Step:
1) Open a page (Say EmployeeList.aspx).
2) Open a radwindow as modal window using a button. Radwindow is navigating to other page (Say EditEmployee.aspx).
3) Modal window contails "Save" and "Cancel" button.
4) Once user edits the data and hit Save button - we need to show a radalert saying 'Data Saved Successfully' and the modal window needs to closed automatically.

Problem is: As I am closing the radwindow to refresh the parent page grid, radalert message is not getting displayed. Also I can't use asp.net alert coz normal alert will not allow me to change the alert (yellow) icon to information icon. Kindly help on this

Java script code on EditEmployee.aspx to close the modal window:

function CloseAndRebind(args) {
                radalert('Data Saved successfully', 330, 100, 'Client RadAlert', null);
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
            }
 
function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
 
                return oWindow;
            }
 
function CloseWindow() {
                GetRadWindow().close();
            }
Tripati
Top achievements
Rank 1
 answered on 05 Jul 2013
2 answers
183 views
Hi guys,

This is a 2 part question, i have been through some of the examples and previous questions posted and havent found my answer.

1st.
I have a main.aspx page with a RadGrid , In the Grid i have a column with and ImageButton that Opens Edit.aspx page inside of a RadWindow. On the Edit.aspx page i have 7 UserControls that are only shown when needed, The one user control is just a summary Control and has a RadGrid on it (This is the default UserControl that Gets shown when the RadWindow is opened). Now when a different UserControl is shown the Summary UserControl Just gets hidden.

On the UserControl now being shown it has a few Text Boxes and a Save Button which will update my database. When the user Clicks on the Save button my database is updated, the Current UserControl is hidden and my summary UserControl is being shown again. The problem i am having is that the RadGrid in the Summary UserControl Isnt being refreshed or updated. The only way i have found the RadGrid to refresh its contents it to close the RadWindow and open it again by clicking on my imageButton on the Main.aspx page.

Is there a way to refresh the RadGrid on the Summary UserControl once a user clicks on the Save button and the Summary UserControl is being shown again. (All code snippets i have found so far have failed)

RadWindow on the Main.aspx page

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="True">
<Windows>
<telerik:RadWindow ID="IncidentListDialog" runat="server" Title="Incident" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Width="900px" Height="760px" Left="50px" Top="50px" >
</telerik:RadWindow>
 
<telerik:RadWindow ID="IncidentActionsDialog" runat="server" Title="Actions" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Width="900px" Height="760px" Left="50px" Top="50px">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>


2nd
On my Main.aspx page, When i Click on the ImageButton to open a New RadWinow even though i have set Top and Left positions my RadWindow Still Centers itself on my screen, and if i am scrolled to the top of the Main.aspx page and Click on a ImageButton the Radwindow will move to the Top of my page where i cannot access the RadWindows Control bar

newguy
Top achievements
Rank 1
 answered on 05 Jul 2013
7 answers
220 views
Telerik RadMenu seems not supported in IE 10, we have telerik dll version 2010.3.1317.20
We have sub menus which are not getting open when hover over the menus. Even main menus not getting open automatically when hover, it needs to keep on moving the cursor on the menu, then only it gets open automatically.
This issue occured only in IE 10. It works correctly on all the other versions of browser.

Here is a link to replicate the issue when open in IE 10
http://www.exair.com
On the top nav menu bar, go to "Buy Now" menu, it has other sub menus, which are not open at all. If you open the same link in other version, it works well.

Please let me know how do I resolve this issue.

Kate
Telerik team
 answered on 05 Jul 2013
2 answers
70 views
I've been working on this for several days now and I've had no luck so far. I have a RadGrid that Exports to excel, actually, several RadGrids in the application. The grids export as expected. The problem is that once I've exported, I can't edit a row. Here's what I've found so far.

When I click the Export button, if I set a breakpoint in the ItemCommand handler, the command name is ExportToExcel, as it should be. Then, once it exports and the page is ready for use again, I click the Edit icon in the row. This time, in the ItemCommand handler, the command name is still ExportToExcel, it should be Edit at this point. In fact, the command source is the Export button, not the Edit button.

I've also set a break point in the master page in OnRequestStart. I can confirm that the Ajax postback is canceled when Export is clicked and that the Event Target is btnExpXls. But when I click Edit, after exporting, the event target is the Edit button. However, by the time it hits the server, even in the RequestStart event in Global.asax, the event target is the export button.

When I step through the script side code I can see the event target getting changed from EditButton to btnExpXls; this appears to be  happening in the script for RadScriptManager. But I can't access that script to make changes, obviously. I'm hoping this is a known issue and that there is a workaround for it. Any suggestions will be greatly appreciated.
Kostadin
Telerik team
 answered on 05 Jul 2013
1 answer
80 views
I need to manually set the value of a control (hidden) during the InsertCommand event so that it inserts into the table.  I've tried a couple of different approaches but I can't seem to navigate to the control.  Can someone tell me how to do this?
Eyup
Telerik team
 answered on 05 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?