Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
132 views
Hello, i currently have a form and part of the form includes a RadComboBox that is populated by a big list (over 1k items). The problem is that when i try to use the combo box it spikes the cpu and ram usage (300-600mb) and it freezes the browser. This happens everything i try to use the combobox. I've tried IE, Chrome and Firefox; they all have the same problem but IE has  more notable memory usage.

Any ideas?
Rafael
Top achievements
Rank 1
 answered on 06 Aug 2010
4 answers
191 views
I am using a context menu and when a user clicks on a certain menuitem I want a confirm dialog to appear asking whether or not it should proceed with the onclick event. If the user wants to proceed, then the onclick event is triggered, if the user does not, then nothing happens and the confirm dialog just closes. I have tried this using the blockConfirm as shown:
window.blockConfirm = function (text, mozEvent, oWidth, oHeight, callerObj, oTitle)
{
  var ev = mozEvent ? mozEvent : window.event; //Moz support requires passing the event argument manually
  //Cancel the event
  ev.cancelBubble = true;
  ev.returnValue = false;
  if (ev.stopPropagation) ev.stopPropagation();
  if (ev.preventDefault) ev.preventDefault();
 
  //Determine who is the caller
  var callerObj = ev.srcElement ? ev.srcElement : ev.target;
 
  //Call the original radconfirm and pass it all necessary parameters
  if (callerObj)
  {
    //Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again.
    var callBackFn = function (arg)
    {
      if (arg)
      {
        callerObj["onclick"] = "";
        if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz
        else if (callerObj.tagName == "A") //We assume it is a link button!
        {
          try
          {
            eval(callerObj.href)
          }
          catch (e)
          {
          }
        }
      }
    }
    radconfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle);
  }
  return false;
}
function RadContextMenu_ItemClicking(sender, eventArgs)
{
  var item = eventArgs.get_item();
    if (item.get_text().substring(0, 7).toLowerCase() == "publish")
    {
        //display radconfirm popup
        return blockConfirm('message', eventArgs, 340, 100, '', 'Confirm Publish');
    }
  if (item.get_text().substring(0, 7).toLowerCase() == "version" || item.get_text().substring(0, 7).toLowerCase() == "publish")
  
    eventArgs.set_cancel(true);
  }
  else
  {
    //disable all context menus
    <asp:Literal ID="LiteralDisableContextMenu" runat="server" />
  }
}

I am pretty sure the problem is with the eventArgs variable that I am sending the blockConfirm. I have the blockConfirm working on a different part of my project when triggered from an ImageButton and that call is:

return blockConfirm('Are you sure you want to delete this item?', event, 340, 100, '', 'Confirm Delete?');

When I try using the variable "event" with the onclientclicking I get an error saying it does not exist. So what do I need to do to make this work with a RadMenuItem?

I read on the forums and could not find any answer, however this has been asked before here: http://www.telerik.com/community/forums/aspnet-ajax/treeview/radconfirm-on-radtreeview-nodeclick.aspx







Cori
Top achievements
Rank 2
 answered on 06 Aug 2010
3 answers
160 views

Hi all,

I am using the below code to populate a DateInput when the user edits a record in a RadGrid so the Edit form is pre-populated with correct data. All is well until I try to Add a new record, because the ExpireDate variable is now NULL.

The Exception is:

An exception of type 'System.InvalidCastException' occurred in App_Web_xngshb9r.dll but was not handled in user code

Additional information: Specified cast is not valid.

And the code block (client-side):

<

 

telerik:RadDatePicker ID="RDP" runat="server" MinDate="01/01/1900" MaxDate="12/31/2100"

 

 

    SelectedDate='<%# Eval("ExpireDate") %>' TabIndex="2" OnSelectedDateChanged="RDP_SelectedDateChanged">

 

 

</telerik:RadDatePicker>

Any help would be greatly appreciated!

 

Brad
Top achievements
Rank 1
 answered on 06 Aug 2010
1 answer
137 views
Hi all,

I have found many posts about RadConfirms but none seem to fit what I need. I've read the post here:
http://www.telerik.com/help/aspnet-ajax/window_dialogsconfirm.html

Along with others.

I have RadConfirm windows tied into my RadGrids and would like to display RadConfirms, completely from the server side, similar to those fired off from the RadGrid.

I can display a confirm box from firing it off of another control like:

<

 

button onclick = "radconfirm('Are you sure?', confirmCallBackFn); return false;"> show CONFIRM BOX</button>

 

But I would rather be able to do it similar to a .Show() method from Forms controls.

But that doesn't allow for changing the title or text, nor do I need the extra function for determing the callback value.

Any help would be greatly appreciated.

Thanks!
Brad
Top achievements
Rank 1
 answered on 06 Aug 2010
1 answer
47 views
HI,

From where can i get the download for Q1 2010 SP2. I am running Q1 2010 currenlty

Thanks
ab
Dev LIPIX
Top achievements
Rank 1
 answered on 06 Aug 2010
2 answers
141 views
I should preface this by saying I just inherited a website that uses Telerik and, well, I've never used them before, so please bear with me. Also, this site doesn't use any code behind pages...nothing I can do about that, so it might complicate some of your suggestions.

Anyway, I have a radgrid that is displaying user suggested features, and in the last column there is a GridHyperLinkColumn that links to a new page displaying more details on the feature request. Since any filtering or paging that has taken place gets wiped out upon going to that details page, I'd like to invoke a RadOpen call to display the details in a new window.

But, I can't seem to make that happen. How do you call a function from a RadGrid???

Here is the current RadGrid on the site (for what it's worth):

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
        DataSourceID="SqlDataSource1" GridLines=None Skin="WebBlue" PageSize="50" Width=100
        AllowFilteringByColumn=true ShowGroupPanel="True">
        <HeaderContextMenu EnableTheming="True" Skin="WebBlue">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </HeaderContextMenu>
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MasterTableView GroupLoadMode=Client AutoGenerateColumns="False" DataKeyNames="pkRequestID" AllowMultiColumnSorting="True" DataSourceID="SqlDataSource1">
            <Columns>
                <telerik:GridBoundColumn  DataField="pkRequestID" HeaderText="ID" SortExpression="pkRequestID"
                    UniqueName="pkRequestID" FilterControlWidth="20px">
                    <HeaderStyle Width="5%" />
                       
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="strTitle" HeaderText="Title" SortExpression="strTitle"
                    UniqueName="strTitle">
                    <HeaderStyle Width="50%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="fullName" HeaderText="Submitted By" SortExpression="fullName"
                    UniqueName="fullName">
                    <HeaderStyle Width="15%" />
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn DataField="dteDate" HeaderText="Added" SortExpression="dteDate"
                    UniqueName="dteDate" DataFormatString="{0:MM/d/yy}">
                    <HeaderStyle Width="10%" HorizontalAlign=Center    />
                    <ItemStyle HorizontalAlign=Center />
                </telerik:GridDateTimeColumn>
                  
                <telerik:GridBoundColumn DataField="strStatus" HeaderText="Status" SortExpression="strStatus"
                    UniqueName="strStatus">
                     <HeaderStyle Width="10%" HorizontalAlign=Center  />
                     <ItemStyle HorizontalAlign=Center />
                </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="votes" HeaderText="Votes" SortExpression="votes"
                    UniqueName="votes" FilterControlWidth="20px">
                     <HeaderStyle Width="5%" HorizontalAlign=Center  />
                     <ItemStyle HorizontalAlign=Center />
                </telerik:GridBoundColumn>
                  
                <telerik:GridBoundColumn DataField="comments" HeaderText="Comments" SortExpression="comments"
                    UniqueName="comments" FilterControlWidth="20px">
                     <HeaderStyle Width="5%" HorizontalAlign=Center  />
                     <ItemStyle HorizontalAlign=Center />
                </telerik:GridBoundColumn>
                  
                <telerik:GridHyperLinkColumn AllowFiltering=False   
                DataTextFormatString="{0}"
                        DataNavigateUrlFields="pkRequestID" Text="Details"  
                        UniqueName="pkRequestID" 
                        DataNavigateUrlFormatString="/portal/technical/requests/view.aspx?lpi={0}">
                        <HeaderStyle Width="5%" HorizontalAlign=Center  />
                </telerik:GridHyperLinkColumn>
            </Columns>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
        </MasterTableView>
          
        <PagerStyle Mode=NextPrevNumericAndAdvanced Position="TopAndBottom" />
    </telerik:RadGrid>

 

 

 

 

 

RW
Top achievements
Rank 1
 answered on 06 Aug 2010
3 answers
199 views

Hi,

 I am using RadEditor in a preview page. I configured EditModes as "Preview":
 
        <telerik:RadEditor ID="editor1" runat="server" Width="100%" EnableResize="false"
            Height="100%" OnClientLoad="OnClientLoad" EditModes="Preview">
            <Tools>
                <telerik:EditorToolGroup>
                </telerik:EditorToolGroup>
            </Tools>
        </telerik:RadEditor>

and in OnClientLoad event, set it as full screen: 

 

    function OnClientLoad(editor) {  

        editor.fire(

 

"ToggleScreenMode");

 

    

 

}

The problem is that after toggle to full screen mode, the editor become editable, while I am expecting the editor still in Preview mode. How do I set back to preview mode in client side (JavaScript), or is there other way to set to full screen without impacting edit mode? In this page, I only need keep the editor in preview mode (and zoom the contect).

I tried with following command (javascript) in OnClientLoad function, but it does not work:
    editor.EditModes = Telerik.Web.UI.EditModes.Preview; 
 
My other question is if can keep the editor in preview mode, and leave zoom command available?

Thank you very much,
Junbin


 

Junbin
Top achievements
Rank 1
 answered on 06 Aug 2010
1 answer
374 views
Hi all,

I am using the below code to try to display a radalert or confirm server-side and am getting this error:
1.)Microsoft JScript runtime error: '_visibilityMode' is null or not an object
2.) Microsoft JScript runtime error: Object doesn't support this property or method

Code:

ScriptManager

 

.RegisterStartupScript(this, this.GetType(), "WindowOpen", "radalert('Test', null, null, 'Test')", true);

 

 

 
I get the same problem if the code is in a Javascript function and that function is called.
ie.

 

function

 

openNewWindow()

 

{

 

var windowURL = "www.yahoo.com";

 

 

var oWnd = radopen("http://" + windowURL, null);

 

oWnd.center();

 

//var websiteName = getWebsiteName(oWnd.get_navigateUrl());

 

 

 

 

 

//Add new tab to the tabstrip

 

 

 

 

tabStrip.trackChanges();

 

var tab = new Telerik.Web.UI.RadTab();

 

tab.set_text(

"Test");

 

tabStrip.get_tabs().add(tab);

tab.set_imageUrl(oWnd.get_navigateUrl() +

"/favicon.ico");

 

tabStrip.commitChanges();

 

//Select this tab

 

 

 

 

tab.select();

}

 

the code is breaking on: var oWnd = radopen("http://" + windowURL, null);

Any ideas?

Thanks!

Brad
Top achievements
Rank 1
 answered on 06 Aug 2010
2 answers
120 views
 I am upgrading a asp.net project from older telerik RadContorls (2008.03.1125.35) to (2010.2.713.35).

I have a RadComboBox + RadTreeView inside.

proper behavior (which was working perfectly in the old version):
=========================
Click the inside treeview node;
Javascript update ComboBox value;
postback
ComboBox lost focus after postback;
========================

Weired behavior after new RAD version
========================
First time load the page and click the inside treeview node,
Javascript update CobmoBox  value;
No postback & ComboBox not losing focus; (Until I click any blank area of the page, it posts back and losing focus for ComboBox)

Once the first time done (clicking the blank area),
ComboBox turns normal behavior for the rest treeview node changes (no need to click blank area to postback).
==========================

My code is here:
==============
Javascript
---------------------------------------
function nodeClicking(sender, args)
{
           
    var comboBox = $find('<%= RadCboOffice.ClientID %>');
    
    var node = args.get_node()
    if(node.get_value()!='no')
    {
        comboBox.set_text(node.get_text());
        CollapseAllNodes();
        comboBox.hideDropDown();
    }
    else
    {
        node.expand();
        //no further postback needed
        event.cancelBubble = true;
    }
}

function CollapseAllNodes()
{
   var tree = $find('<%=RadCboOffice.Items[0].FindControl("RadTrvOffice").ClientID %>');;
            
   var allNodes = tree.get_allNodes();
   
   var index;
   for (index = 0; index < allNodes.length; index++)
   {
       var node = allNodes[index];
       if(node.get_expanded())
       {
           node.collapse();
       }
   }
   
}
-------------------------------------
ASPX
        <telerik:RadComboBox ID="RadCboOffice" Runat="server" Width="300px"  CssClass="" OnClientLoad="CboLoad" Skin="WebBlue" AutoPostBack="true" OnTextChanged="RadCboOffice_TextChanged">
        <ItemTemplate>
        <div id="div1">
        <telerik:RadTreeView runat="server" ID="RadTrvOffice"  ShowLineImages="false" OnClientNodeClicking="nodeClicking"/>
        </div>
        </ItemTemplate>
        <Items>
        <telerik:RadComboBoxItem runat="server" />
        </Items>
        </telerik:RadComboBox>   
---------------------------------------
code behind C#

        protected void RadCboOffice_TextChanged(object sender, EventArgs e)
        {
            TxtHiddenOfficeId.Text = GetOfficeId().ToString();
        }

----------------------------------------
Again, this is very weird to me. Old version works, new version will only hiccup for the first time.

Please help.

Thanks a lot
-Simon

simon
Top achievements
Rank 1
 answered on 06 Aug 2010
8 answers
131 views
I have an aspx page that has 2 RadGrids on the page and depending on what RadioButtonList is selected i set the grid visible or not.

The problem is when I load the grid with data then hide it and then load new data in the grid and unhide it the styling of the grid is all messed up.  The filters lose the filter image, that alternating row color is lost and so on.

Can you tell me the best way to clear the grid, hide it and unhide it so to not lose the styling?

Thank you. 
Mark Andrew
Top achievements
Rank 1
 answered on 06 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?