Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
211 views
I have an ascx page that has a couple of RadComboBox controls. Those comboboxes have a RadTreeView template populated with some values. When the user clicks on the nodes the combobox's text changes. This all works pretty well. My problem however is that when the user submits the form, and he missed one or more fields, the checked nodes remain checked (which is a good thing) but the text in the combobox gets cleared again. I need to fire an onload event in which I can run through the treeviews and set the text of the comboboxes.

The code that I use to try to get this effect:
function addEvent(evnt, elem, func)  
    { 
        if (elem.addEventListener) // W3C DOM 
            elem.addEventListener(evnt,func,false); 
        else if (elem.attachEvent) // IE DOM 
        {  
            var r = elem.attachEvent("on"+evnt, func); 
        } 
        return r; 
         
    } 
    addEvent(window.onload,load()); 
function load() 
    { 
        var comboClass = $find("<%= rcClass.ClientID %>"); 
        var comboCountry = $find("<%= rcCountry.ClientID %>"); 
        var comboTm = $find("<%= rcTrademark.ClientID %>"); 
        var comboYearFrom = $find("<%= rcYearFrom.ClientID %>"); 
        var comboYearTo = $find("<%= rcYearTo.ClientID %>"); 
        var comboType = $find("<%= rcType.ClientID %>"); 
         
        var treeClass = comboClass.get_items().getItem(0).findControl("TreeClass"); 
        var treeCountry = comboCountry.get_items().getItem(0).findControl("TreeCountry"); 
        var treeYearTo = comboYearTo.get_items().getItem(0).findControl("TreeYearTo"); 
        var treeYearFrom = comboYearFrom.get_items().getItem(0).findControl("TreeYearFrom"); 
        var treeTrademark = comboTm.get_items().getItem(0).findControl("TreeTrademark"); 
         
        setText(comboClass,treeClass,0); 
        setText(comboCountry,treeCountry,2); 
        setText(comboTm,treeTrademark,1); 
        setYear(comboYearFrom); 
        setYear(comboYearTo);      
    } 

However, I get the error in the load() function that all the comboboxes return 'null'.


Simon
Telerik team
 answered on 06 Apr 2009
3 answers
117 views
How can I show and hide a tooltip from the server? I don't want the tooltip to be displayed when the user puts the mouse over the control.  I want to be able to control when it is displayed or hidden from the server-side.
Svetlina Anati
Telerik team
 answered on 06 Apr 2009
3 answers
342 views
Hi, me again, I need to do the same like its exposed on the forum:
some similar
but I have different mistakes, this is the scenario:



function onBeforeClose(sender, arg)  
{  
    function callbackFunction(arg)  
    {  
        if (arg)  
        {  
            sender.remove_beforeClose(onBeforeClose);  
            sender.close();  
        }  
    }  
arg.set_cancel(true);  
radconfirm("Are you sure", callbackFunction, 300, 100, null"Close RadWindow");  
}  
//this function call a window when I click a menu item 
function menuClick(sender,arg)  
{    
//show window .... 
//.... 
//this comment lines not work, I try both 
//wnd.add_beforeClose(onBeforeClose);  
//sender.add_beforeClose(onBeforeClose);  
 
//but this work. its a closing event not before close 
wnd.add_close(onBeforeClose); 
}  

and when i close this its the message error: arg.set_cancel is not a function,
I  read on the forum something like if its no the right method this error shows but, 'add_beforeClose' dont work to me yet.
there another way to call this event?
I'm a litle confused.
    
    Thanks in advance.
    Nenita.*
Svetlina Anati
Telerik team
 answered on 06 Apr 2009
1 answer
105 views

I have a small app that uses the radeditor. In it I insert pictures into the editor’s document by pasting some HTML using the pasteHTML method.

Wht I paste is normaly this image tag or similar one:

"<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&amp;Time=1238702704906" />"

When the user submits the document, my application then has to change all the <img> tags that were pasted into <div> tags. I dothis in javascript with this small function:

The id of the <img> tag is in this: $find(element).get_TempID()

 

Posteditor is the clientID of the editor

if

 

 

($get($find(element).get_TempID(), $find(Posteditor).get_document()) != null) {

 

 

 

var temImg = $get($find(element).get_TempID(), $find(Posteditor).get_document());

 

 

 

var div = $find(Posteditor).get_document().createElement("div");

 

 

 

var uniqueIDv = this._UniqueID;

 

div.id = uniqueIDv + index.toString();

div.className =

 

'ForumPostPhotoDivCss';

 

$find(Posteditor).get_document().body.insertBefore(div, temImg);

$find(Posteditor).get_document().body.removeChild(temImg);

The problem I am having is this:

If the user only types some text and pastes images then the HTML of the editor looks something like this and all works fine:

this is a test<br />

<br />

<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&amp;Time=1238702704906" />

 

However, if the user selects the entire content of the editor and decides to align it ‘centre’ then the HTML in the editor looks like this and it does not work because of the <p align="center"></p> tag surounding it.

<p align="center">this is a test<br />

<br />

<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&amp;Time=1238702704906" /> </p>

The same problem occurs when the user selects the content of the editor and puts it in bold, then it wraps it up in these <strong></strong> tags an it also does not work.

 

<strong>this is a test<br />

<br />

<img alt="" id="Tempdivphoto0" src="PhotoFeeders/GetNewTempForumPostPhotoThumbNail.aspx?ForumPostTempPhotoIndex=0&amp;Time=1238702704906" /></strong>

The error is this line:

$find(Posteditor).get_document().body.insertBefore(div, temImg);

 

Where it says:

Error: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "http://localhost:1761/BCW_Web/Scripts/ForumsAJAX.js Line: 369"]

Source File: http://localhost:1761/BCW_Web/Scripts/ForumsAJAX.js

Line: 369

How can I reference the div and/or the image correctly when they are wraped inside <strong> or <div> tags?

Tervel
Telerik team
 answered on 06 Apr 2009
1 answer
126 views
I've spent months working with the default skin. I purchase the product to get it into production and you change the Default skin!!!  Now I have to spend more of my free time hacking this crap to get it to look like the 2008 default skin. AND I have a damn demo tomorrow.

Can you feel my rage here!?
Dimo
Telerik team
 answered on 06 Apr 2009
3 answers
110 views
Hi,

I'm using RadEditor 5.3.2 in MOSS and I configured to use it in a list. So far, so good.

Then I select a paragraph, or some text, and apply a custom css using the "Apply Css" button. Good! Then, if I remove the last character in the selected text/paragraph above, the styles is applied to the entire html after the initial tag.

Is that a bug or I'm doing something wrong?

Thanks in advance,
Guilherme
Stanimir
Telerik team
 answered on 06 Apr 2009
2 answers
111 views

Hi All

 

protected

void rgvReport_OnExcelExportCellFormatting(object source, ExcelExportCellFormattingEventArgs e)

 

{

 

if (e.FormattedColumn.HeaderText == "Date")

 

e.Cell.HorizontalAlign =

HorizontalAlign.Center;

 

}

This coding is for setting the alignment for a field with heading "Date" to center in excel.

I there any option like this for changing the alignment in pdf

Same thing to make the field with heading "Date" to center.

-Anto

Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 06 Apr 2009
1 answer
101 views
hi

i am new to telerik controls.

I was assigned a tooltip to Textbox. its works fine.

but when i attch it to datepicker control its raises an java script error as 'un known control' when the page loads


can anybody help me pls.

thnaking you.
Svetlina Anati
Telerik team
 answered on 06 Apr 2009
1 answer
253 views
Is there a way to customize the Decrease, Increase button so I can position them differently and change the size of those buttons?
I want a horizontal slider but I want the Decrease (Previous) and Increase (Next) buttons to be about 50px above the slider.

Is there a way to make the horizontal slider thicker? Or make it look like this?
http://jqueryfordesigners.com/demo/slider-gallery.html

Thanks
J.
Tsvetie
Telerik team
 answered on 06 Apr 2009
5 answers
192 views
Linq Filter does not work with GridHyperLinkColumn.
I use field data as an url link. 
(filterExpression does not have field name - instead of "Name.Contains...", it has only ".Contains..." and return error)

How do I correct the problems?
Thanks.
 
Nikolay Rusev
Telerik team
 answered on 06 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?