Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
1.4K+ views
I have a page with multiple RadDatePicker controls. For each control, I want the MaxDate to be the current date. So I created a Javascript method to set this. This is working fine. However, I don't wnat to have to create a unique Javascript method for each individual RadDatePicker to call.

Does anyone know a work-around for this situation? (I definately don't know my way around Javascript).  Is there a way I can pass as a parameter the ID of the particular RadDatePicker control, and use the parameter variable to find that control on the page?

Function to set the max date of my RadDatePicker:
function RadDatePicker_SetMaxDateToCurrentDate() {  
        var datePicker = $find("<%= txtTest.ClientID %>");  
        datePicker.set_maxDate(new Date());          
     }; 
 

One of many RadDatePicker controls on my page:  

<telerik:RadDatePicker ID="txtTest" runat="server" MinDate="1900-01-01" >                                      
    <DateInput ID="DateInput2" DateFormat="MMMM yyyy" runat="server" ReadOnly="true">  
    </DateInput> 
    <Calendar ID="CalendarInput2" runat="server">  
        <SpecialDays> 
            <telerik:RadCalendarDay repeatable="Today" Date="" ItemStyle-CssClass="rcToday" /> 
        </SpecialDays>                                          
        <ClientEvents OnLoad="RadDatePicker_SetMaxDateToCurrentDate" /> 
    </Calendar> 
</telerik:RadDatePicker> 

 

 

 

Johny
Top achievements
Rank 1
 answered on 26 Nov 2009
4 answers
121 views
When using a custom FileBrowserContentProvider I want to be able to show the paths I provide in the ViewPaths property of the FileManagerDialogConfiguration.
Let's say I provide two paths, both using a different source and both containing a lot of directories.
I'm able to display both paths, but on default they are already expanded, requering the user to scroll past the 1st path's 1st-level directories before he can see the 2nd path...

How do I (probably in the ResolveRootDirectoryAsTree (I want to use a tree-like directory structure)) avoid the 1st-level to directories to load on default? I want them to be loaded only when clicked...

thanks
Marco
Top achievements
Rank 1
 answered on 26 Nov 2009
1 answer
183 views

i have two combobox with checkbox inside. this is my code about combobox

 

 

 

<telerik:RadComboBox ID="rcbProduct" runat="server" AllowCustomText="True" AppendDataBoundItems="True" 

 

 

DropDownWidth="700px" EmptyMessage="Choose Product" Filter="Contains" ForeColor="Blue"

 

HighlightTemplatedItems="True" MarkFirstMatch="True" MaxHeight="150px" OnItemDataBound="rcbProduct_ItemDataBound">

 

 

<HeaderTemplate>

 

 

<ul>

 

<li class="col1" style="width: 120px">ProductName</li>

 

<li class="col2" style="width: 120px">ModelNumber</li>  

 

 

<li class="col3" style="width: 70px">Vender</li>

 

<li class="col4" style="width: 60px">Price</li>  

 

 

<li class="col5" style="width: 150px">Image</li>

 

 

</ul>  

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<asp:Panel ID="divUser" runat="server">

 

 

<ul>

 

 

<li class="col1" style="width: 120px">

 

<%

 

# DataBinder.Eval(Container.DataItem, "f_ProductName").ToString().Trim()%>

 

</li>

 

 

<li class="col2" style="width: 120px">

 

 

<%

 

 

 

# DataBinder.Eval(Container.DataItem, "f_ModelNum").ToString().Trim()%>

  

</li>

 

 

 

 

<li class="col3" style="width: 70px">

 

 

 

 

<%

 

 

 

#DataBinder.Eval(Container.DataItem,("f_VenderName")) %>

 

</li>

 

 

 

 

 <li class="col4" style="width: 60px">

 

 

 

 

<%

 

 

 

# DataBinder.Eval(Container.DataItem, "f_Price").ToString().Trim()%>

 

</li>

 

 

 

<li class="col5" style="width: 150px">

 

 

 

 

<asp:Image ID="img" runat="server" Height="80px" ImageAlign="AbsMiddle" Width="80px" />

 

 

 

 

<asp:Label ID="lblImg" runat="server" Text='<%# Eval("f_ImageProduct") %>' Visible="false"></asp:Label>

 

 

 

 

</li>

 

 

 

 

</ul>

 

 

 

 

</asp:Panel>

 

 

 

 

</ItemTemplate>

 

 

 

 

</telerik:RadComboBox>


and this is javascript code:

 

 

 

<script type="text/javascript"> 

 

 

 

var cancelDropDownClosing = false;

 

 

function StopPropagation(e)

{

 

//cancel bubbling

    e.cancelBubble = true;

 

 

 

    if (e.stopPropagation)

    {

        e.stopPropagation();

    }

}

 

 

function onDropDownClosing()

 

{

cancelDropDownClosing =

 

false;

 

}

 

 

 

function onCheckBoxClickPro_Shop(chk)

 

{

 

 

var combo1 = $find("<%= rcbProduct_Shop.ClientID %>");

 

 

//prevent second combo from closing

 

combo1.set_text(

 

"");

 

cancelDropDownClosing =

 

true;

 

 

//holds the text of all checked items

 

 

 

 

 

var text = "";

 

 

//holds the values of all checked items

 

 

 

 

 

var values = "";

 

 

//get the collection of all items

 

 

 

 

 

var items = combo1.get_items();

 

 

//enumerate all items

 

 

 

 

 

for (var i = 0; i < items.get_count(); i++)

 

{

 

 

var item = items.getItem(i);

 

 

 

//get the checkbox element of the current item

 

 

 

 

 

var chk1 = $get(combo1.get_id() + "_i" + i + "_chk1");

 

 

if (chk1.checked)

 {

text += item.get_text() +

 

"," ;

 

values += item.get_value() +

 

",";

}

}

 

 

//remove the last comma from the string

 

 

 

 

text = removeLastComma(text);

values = removeLastComma(values);

 

 

if (text.length > 0)

 

{

 

 

//set the text of the combobox

 

 

 

 

 

//combo.set_text("");

combo1.set_text(text);

 

 

//update the treeview in the second combobox

 

 

 

 

}

 

 

else

 

 

 

 

{

 

 

//all checkboxes are unchecked

 

 

 

 

 

 

//so reset the controls

 

 

 

 

combo1.set_text(

 

"");

 

}

}

 

 

 

function onCheckBoxClickPro(chk)

 

{

 

 

var combo = $find("<%= rcbProduct.ClientID %>");

 

 

 

//prevent second combo from closing

 

 

 

 

 

combo.set_text(

 

"");

 

cancelDropDownClosing =

 

true;

 

 

 

//holds the text of all checked items

 

 

 

 

 

var text = "";

 

 

//holds the values of all checked items

 

 

var values = "";

 

 

 

//get the collection of all items

 

 

 

 

 

var items = combo.get_items();

 

 

//enumerate all items

 

 

for (var i = 0; i < items.get_count(); i++)

{

 

 

var item = items.getItem(i);

 

 

//get the checkbox element of the current item

 

 

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

if (chk1.checked)

 

{

text += item.get_text() +

 

"," ;

 

values += item.get_value() +

 

",";

 

}

}

 

 

//remove the last comma from the string

 

 

 

 

text = removeLastComma(text);

values = removeLastComma(values);

 

 

if (text.length > 0)

{

 

 

//set the text of the combobox

 

 

//combo.set_text("");

combo.set_text(text);

 

 

//update the treeview in the second combobox

 

 

 

 

}

 

 

else

 

 

 

 

{

 

 

//all checkboxes are unchecked

 

 

//so reset the controls

 

 

 

 

combo.set_text(

 

"");

 

}

}

 

 

</script>


i use same script for two combobox . In FireFox is ok no problem but when i open it with IE.7 or IE 8 . They show a message:
"A script on this page is causing your web browser to run slowly. If it continues to run, your
computer might become unresponsive"

I test the problem and if i delete one javascript and dont load data for a combobox it's ok if i load data for two combobox sametime . This Problem will happen and show alert above. Please help me to solve this Problem .Thanks alot
 

 

 

 

Vesko
Top achievements
Rank 2
 answered on 26 Nov 2009
1 answer
67 views
I have a radcombo in a grid cell. When the user clicks a gridbutton column, i evaluate the value in the drop down in the ItemCommand event. My initial problem was that the radcombo was losing its value before the ItenCommand event.fired causing the radcombo to lose the value selected by the user. i was told to remove the code that loads the grid from the page_load event.

My issue now is, how do I repopulate the grid without affecting the value in the drop down. I cant reload the grid in the page_load because that fires prior to the itemcommand. Paging is not working in the grid and I also have to radcombo boxes outside the grid that filer the grid content when a command button is pressed.

Please assist.

thanks
Sebastian
Telerik team
 answered on 26 Nov 2009
4 answers
121 views

How i can use cookie in this sample(owner is telerik) with live link
link :

in this link just user that registered can change style...
(but wuth some change ... i used database to store data)
now i wanna user that not registered in my web site can change thire page
i think must use cookie

http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx

tnmx man
Pero
Telerik team
 answered on 26 Nov 2009
1 answer
132 views
Hi Everybody,

I'd like to know if does this component permit that shows times how it was a grid component?

For example, I'd like to show hours between 00:00 am and 23:55 pm with interval of 5 minutes.  Theses schedules woulb be shown as a grid, where this there would be 10 columns, see example:

00:00   00:05  00:10  00:15  00:20  00:25  00:30  00:35  00:40  00:45  00:50
00:55   01:00  01:05  01:10  01:15  01:20  01:25  01:30  01:35  01:40  01:45
...

Then, the user can click one or more times... Is it possible to do it with this component? Is there a demo that ilustrated a similar example that I liked?

Thank you for all attention,

Carlos
Johny
Top achievements
Rank 1
 answered on 26 Nov 2009
1 answer
82 views
Hi,

Does Grid support aggregate functions when it uses client side data binding?
Nikolay Rusev
Telerik team
 answered on 26 Nov 2009
1 answer
79 views
Hi,
 I have telerik 2009 and I m binding combo box to database . i want the text of the input field of Telerik RadComboBox to be empty when the page is loaded . But the issue is I get the text value of the checkbox's first list item in the input field of Telerik RadComboBox.

      <telerik:RadComboBox runat="server" ID="rcbLocation" HighlightTemplatedItems="true" DataTextField="Location" DataValueField="Location" Width="405px" AllowCustomText="false" >                                
                                    <ItemTemplate>
                                        <div onclick="StopPropagation(event)" >
                                            <asp:CheckBox runat="server" ID="CheckBox1" onclick="checkboxClick(event);" />
                                            <asp:Label runat="server" ID="Label1" AssociatedControlID="CheckBox1" Text='<%# DataBinder.Eval(Container, "DataItem.Location") %>' Font-Size="10pt" Width="88%"  />
                                        </div>
                                    </ItemTemplate>
                                    <CollapseAnimation Duration="200" Type="OutQuint" />
                                </telerik:RadComboBox>

    Me.rcbLocation.DataTextField = "Location"
        Me.rcbLocation.DataValueField = "Location"
        Me.rcbLocation.DataBind()
       Me.rcbLocation.Text=" "
I want to set the input field of Telerik RadComboBox to empty from server side..How can I do it ? Please let me know ..




Shinu
Top achievements
Rank 2
 answered on 26 Nov 2009
1 answer
119 views
Hi,
I would like to change the title font color of a dock which uses the forest skin to white,
since it is hard to read a black font over a dark green background.
I tried
.rdTitlebar, .rdTitle  
    {  
                color:White  !important; 
    }
but nothing happened.
Is it possible?
Thanks.
Martin
Telerik team
 answered on 26 Nov 2009
1 answer
119 views
We have the Full-Featured RadEditor for SharePoint. We have replaced the standard SharePoint editor with the Rad Editor for SharePoint, but the 'Paste from Word' button is not visible on the toolbar. We do see the Strip Word Formatting, but not the 'Past from Word'. I have added a screenshot of the Editor we see. The site features (Use RadEditor to edit HTML fields &  Use RadEditor to edit List Items) are active.

What went wrong? And more important: How can we fix this?

I think we have the RadEditor version 5.4.0.0 (I see the Rad Editor resources in:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\5.4.0.0__1f131a624888eeed\Resources)

On your help-site (http://www.telerik.com/help/aspnet-ajax/cleaningwordformatting%20.html) I found information about Cleaning Word Formatting, but we can't test this in real life...

Thanks in advance for the help !

Willem Oosterhof
The Netherlands
Stanimir
Telerik team
 answered on 26 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?