Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
187 views
Hi Telerik,

I have a RadWindow of a certain size. When the RadWindow is first loaded I call AdjustRadWindow to set the window size. In addition, the window adjusts fine on a RadDateTimePicker's OnPopupOpening and OnPopupClosing events.

I am struggling to get this to work when the user interacts with a RadComboBox. The RadComboBox hides elements on the RadWindow and I would like to resize the window after they're hidden.

protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    SetWindowState(RadComboBox1.SelectedValue);
}
 
private void SetWindowState(string currentSelection)
{
    if (string.Compare(currentSelection, Charts.LineChart.ToString()) == 0)
    {
        RadDateTimePicker2.Visible = true;
        Label2.Visible = true;
        CheckBox3.Visible = true;
    }
    else if (string.Compare(currentSelection, Charts.PieChart.ToString()) == 0)
    {
        RadDateTimePicker2.Visible = false;
        Label2.Visible = false;
        CheckBox3.Visible = false;
    }
    else
    {
        Debug.Assert(false, "Unhandled chart type in RadSettings");
    }
}
function OnClientSelectedIndexChanged(sender, eventArgs) {
    setTimeout(function () { AdjustRadWindow(); }, 500);
}

function AdjustRadWindow() {
    var oWindow = GetRadWindow();
    setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
}
 
//fix for Chrome/Safari due to absolute positioned popup not counted as part of the content page layout
function ChromeSafariFix(oWindow) {
    var iframe = oWindow.get_contentFrame();
    var body = iframe.contentWindow.document.body;
 
    setTimeout(function () {
        var height = body.scrollHeight;
        var width = body.scrollWidth;
 
        var iframeBounds = $telerik.getBounds(iframe);
        var heightDelta = height - iframeBounds.height;
        var widthDelta = width - iframeBounds.width;
 
        if (heightDelta > 0) oWindow.set_height(oWindow.get_height() + heightDelta);
        if (widthDelta > 0) oWindow.set_width(oWindow.get_width() + widthDelta);
        oWindow.center();
 
    }, 310);
}

If I place an alert inside of OnClientSelectedIndexChanged then, after I close the alert, AdjustRadWindow seems to work properly. The problem is that the controls aren't disappearing fast enough from the screen, even with two time-outs.

I believe the issue may be related to this -- http://www.telerik.com/community/forums/aspnet-ajax/ajax/slow-ajax-response-wondering-if-i-can-do-something-to-improve.aspx

Any suggestions? Solutions?

Thanks

Sean

Marin Bratanov
Telerik team
 answered on 31 Mar 2011
1 answer
66 views
I have a RadWindow declared with

 

 

VisibleOnPageLoad="True"
MinimizeZoneID="CatalogZone"
InitialBehaviors="Minimize"
Behaviors="Move,Minimize"
KeepInScreenBounds="True"
OffsetElementID="CatalogZone"

It does not honor the minimize zone on page load. Once I manually restore and minimize the window, it works properly. How can I get it to display in the minimize zone on initial page load?

Marin Bratanov
Telerik team
 answered on 31 Mar 2011
3 answers
171 views
What could cause Advanced paging to not work? 
<telerik:RadGrid ID="grdTicket" runat="server" AutoGenerateColumns="false" Width="946px" Font-Names="Verdana" Font-Size="x-small" EnableViewState="true"
 AllowSorting="true" AllowPaging="true" AllowMultiRowSelection="false" OnNeedDataSource="grdTicket_NeedDataSource" OnPageIndexChanged="grdTicket_PageIndexChanged" >
    <MasterTableView Width="100%" NoDetailRecordsText="No Records To Display">
        <Columns>
            <telerik:GridBoundColumn DataField="origdtdate" HeaderText="Call In Date" ReadOnly="true" SortExpression="origdtdate"></telerik:GridBoundColumn>
            <telerik:GridHyperLinkColumn DataTextField="ticketnum" HeaderText="Ticket#" SortExpression="ticketnum" DataNavigateUrlFields="ticketnum" DataNavigateUrlFormatString="SearchViewTicket.aspx?ticketnum={0}"></telerik:GridHyperLinkColumn>
            <telerik:GridBoundColumn DataField="address" HeaderText="Address" ReadOnly="true" SortExpression="address"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="street" HeaderText="Street" ReadOnly="true" SortExpression="street"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="city" HeaderText="City" ReadOnly="true" SortExpression="city"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="county" HeaderText="County" ReadOnly="true" SortExpression="county"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="company" HeaderText="Contractor" ReadOnly="true" SortExpression="company"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <PagerStyle Mode="NextPrevNumericAndAdvanced" ShowPagerText="true" />
</telerik:RadGrid>

The above PagerStyle outputs NextPrevAndNumeric controls, there are no advanced controls.  If I change mode to Advanced, nothing shows up in the footer.  I'm using 2010 Q1, but I've also updated to 2011 Q1 and get the same results.
Mira
Telerik team
 answered on 31 Mar 2011
8 answers
690 views
Hi,

I have to store a value that I don't want to show to user.
I have template column like:

 <telerik:GridTemplateColumn>
                        <ItemTemplate>
                            <asp:HiddenField ID="hddesc" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.description") %>' />
                        </ItemTemplate>
</telerik:GridTemplateColumn>

How to get its value from javascript?

Thanks,
Vaibhav



Kiara
Top achievements
Rank 1
 answered on 31 Mar 2011
2 answers
83 views
Hi,

I successfully deployed MOSS 2007 RAD Editor 4.5.6 in a VM, but a strange thing happens:
if I access the Sharepoint web application inside the VM the RAD Editor control works just fine, but if I access it outside the VM with IE, no cursor or text appear in design mode. If I click in the textbox and write something, and then switch to HTML mode the written text appears as well as the cursor and I edit the text with no problems. If I switch back to Design the text and the cursor disappear again.

This only happens with IE. With Firefox and Chrome everything works fine.

Can you please help me to understand what's happening?

Best regards

Vitor
Vitor
Top achievements
Rank 1
 answered on 31 Mar 2011
2 answers
217 views
Hi,

I have a web site running on IIS 6 (using both Telerik and AJAX Control toolkit), it works fine. 

But then I copy the website on an Win 2008 Server running IIS 7.0, the program dosen't work and I got the ASP.NET AJAX failed to load Javascript error, I've added the handler to the web.config but with no luck.
<system.webserver>
<handlers>
<add 
name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" 
path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
</handlers>
</system.webserver>
I am using the RadControl v.2010.3.1317.35
And our web hosting is using Plesk Control Panel.

Please advise. Thanks
Andy Ho
Andy Ho
Top achievements
Rank 1
 answered on 31 Mar 2011
1 answer
144 views
Hi,

I need to create a chart with the following properties:
  1. On the y axis, i need to show an integer say score
  2. On the x axis, i need to display the month on which the score was posted. The x axis can be static also and contain all the months.

I have a complex object which has both score and date attributes.

how can this be achieved? I am not able to find a solution for this problem. It is not present in a demo also.

Please help!

Thanks in advance
Vishesh
Missing User
 answered on 31 Mar 2011
1 answer
114 views
The Hyperlink column is kind of a pain in the ass if we can't set an Eval() statement on NavigateUrl directly in the markup...

Will this ever be fixed?  We can do it with a TemplateColumns controls fine...doesn't make it easy to use if you always have to use ItemDataBound everytime we need a simple nav column
Sebastian
Telerik team
 answered on 31 Mar 2011
1 answer
107 views

Ajax 2010.3.1317.45

as mentioned in this article,
http://www.telerik.com/help/aspnet-ajax/grdperformcalculationsingroupheader.html

I would like to have calculation (only group "count") on Any column being grouped. is there any way to accomplish this client-side, the reason for asking is that i use

 

 

 

GroupLoadMode="Client"

 


and dont want to set up groupfields for all columns, can i achieve this type of count aggrigation independent from what column is being grouped, maybe trough javascript?
Marin
Telerik team
 answered on 31 Mar 2011
2 answers
198 views
What I'm trying to do

I have an ASP.NET page which shows a list of items.  Once the page has loaded, I perform an AJAX call to go and get the stock for every item.  When the AJAX call returns, we then display an "in stock" or "out of stock" icon with an associated tooltip for each item.  The tooltip will display the actual stock.

The problem
The tooltip is not just text but has formatting in it.  I have got my code to work in Firefox 4, but it doesn't work in Internet Explorer 8.

The code
The tooltip text template is:

In stock - <span style='color: #ff0000;'>[[stock]]</span> items

When the page first loads, I have a hidden label (style display = none) and I set this label's text property to that of the template text.

When my AJAX call returns, it runs a function.  This function iterates through each item and performs the following:

tooltip.show();
tooltip.set_contentElement(inStockTextCached);
var content = tooltip.get_content().replace(""[[stock]]"", fields[" + QoHDisplay.QuantityOrdinal + @"]);
tooltip.set_content(content);
tooltip.hide();

Okay, a quick explanation of this JavaScript:

tooltip.show();
If I don't add this then I get an error if I attempt the next line.  The error is "this._contentCell is null" and the solution was posted here: http://www.telerik.com/community/forums/aspnet-ajax/tooltip/client-side-set-content-to-dom-element.aspx

tooltip.set_contentElement(inStockTextCached);
Earlier on in the function I create a reference "inStockTextCached" to the label that holds the template text.  I then set the tooltip's content element to be the same.

In Firefox 4 and Chrome, calling set_contentElement(inStockTextCached) works fine but in InternetExplorer it does not work.

var content = tooltip.get_content().replace(""[[stock]]"", fields[" + StockOrdinal + @"]);
Here, I load the content of the tooltip and "[[stock]]" with the actual stock value returned from the AJAX call.

tooltip.set_content(content);
I then attempt to update the content of the tooltip

tooltip.hide();
I had to show the tooltip to prevent the error, but ideally I don't want it to show when it first loads....this is my attempt to therefore hide it (but that doesn't seem to have the desired effect).


Any help would be much appreciated.

Thanks in advance

Griff


Svetlina Anati
Telerik team
 answered on 31 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?