Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
149 views
I am using Telerik Controls in Master page.I am facing a problem regrading panel height.Whenever scren size changes then panel height automatically reduce or increase.it should be increase according to Screen resolution.Please provide me solution so that i can use Telerik Controls.

For Example ..

Currently i am using Following code to adjust Panel Height

var div=document.getElementById("ctl00_divWidth");
alert(div);
   if ( (screen.width == 1280) && (screen.height == 1024) ) //1280 x 1024
        divWidth = 1270;
    else if ( (screen.width == 1152) && (screen.height == 864) )  //1152 x 864
        divWidth = 1142;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
        divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
        divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;
    else if ( (screen.width == 1024) && (screen.height == 768) )  //1024 x 768
    divWidth = 1015;

Above code is not working properly.Please resolve my problem..
Mangesh
Top achievements
Rank 1
 asked on 26 Jun 2011
1 answer
166 views
Hello

My RadComboBox gets item from a SqlDataSource, custom text is not allowed.

The items are generated well but the SelectedValue when the data is bound on PageLoad is empty. Only when I select another value, the SelectedValue set.

I need SelectedValue right after DataBind, not after changing the value by picking another value from the drop down list.

How can I do this?

Looking forward to your replies.

Thanks
Thanh Dang
Top achievements
Rank 2
 answered on 25 Jun 2011
3 answers
133 views
I use a Radcombobox integrated in a RadListView. (Made from Example Binary image / FirstLook (http://demos.telerik.com/aspnet-ajax/binaryimage/examples/default/defaultcs.aspx)

I tried to use javascript to close the list, but an error occurs when I search the component ID.

JavaScript code:
 function OnClientNodeClickedHandler (sender, e) {
var comboBox = $ find ("<%= ReportsListItems.ClientID %>");
var node = e.get_node ();
if (! node.get_enabled ()) return;
comboBox.set_text (node.get_text ());
comboBox.trackChanges ();
comboBox.get_items (). getItem (0). set_value (node.get_value ());
comboBox.commitChanges ();
comboBox.hideDropDown ();
}

The error message:
Compiler Error Message: BC30451: 'ReportsListItems' is not declared. It may be inaccessible due to its protection level.
I understand that each control must have a unique ID, but then!
How do I manage the closure of the list after selecting an item?

Preview Code:
 

<%

 

@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="general.master" CodeBehind="reportsList.aspx.vb" Inherits=".ReportsList" uiCulture="Auto" Culture="Auto" %>

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<

 

 

asp:Content ID="Content1" ContentPlaceHolderID="Content2" runat="Server">

</

 

 

asp:Content>

<

 

 

asp:Content ID="Content2" ContentPlaceHolderID="OEEDirectContent" runat="server">

 

<script type="text/javascript">

 

function showingMenu(sender, args) {

 

//Disable the menu on the category image

 

if (args.get_targetElement().id == "RadListView1") {

args.set_cancel(

 

true);

}

}

 

function OnClientNodeClickedHandler(sender, e) {

 

var comboBox = $find("<%= ReportsListItems.ClientID %>");

 

var node = e.get_node();

 

if (!node.get_enabled()) return;

comboBox.set_text(node.get_text());

comboBox.trackChanges();

comboBox.get_items().getItem(0).set_value(node.get_value());

comboBox.commitChanges();

comboBox.hideDropDown();

}

 

</script>

 

<div>

 

<div class="Contents">

 

<telerik:RadFormDecorator runat="server" id="radFormDecorator" DecoratedControls="All" />

 

<telerik:RadListView id="RadListView1" runat="server" datasourceid="SqlDataSource1"

 

ItemPlaceholderID="ListViewContainer" >

 

<LayoutTemplate>

 

<asp:PlaceHolder runat="server" id="ListViewContainer" />

 

</LayoutTemplate>

 

<ItemTemplate>

 

<fieldset id="fieldset" style="float: left; width: 230px; height: 150px; border-style:solid; border-width:1px; border-color:#008080; ">

 

<legend>

 

<b><font size="3"><%# Eval("category")%></font></b></legend>

 

<div class="details">

 

<asp:HiddenField ID="HideF" runat="server" Value= '<%# Eval("id_category")%>'/>

 

<div class="photo-container">

 

<telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("image_value") %>'

 

AutoAdjustImageControlSize="false" Width="55px" Height="55px"

 

AlternateText='<%#Eval("category", "Categorie {0}") %>' />

 

</div>

 

<div class="data-container">

 

<div class="data_leftitem" title="<%# Eval("descript")%>">

 

<label>Description:</label><br><%# Eval("descript")%>

 

</div>

 

<div class="data_bottomitem">

 

<label><strong>Rapports </strong><note>(<%# Eval("nbReports")%>):</note></label>

 

<telerik:RadComboBox

 

runat="server"

 

ID= "ReportsListItems"

 

OnClientNodeClicked="OnClientNodeClickedHandler"

 

AllowCustomText="false"

 

skin="Windows7"

 

AutoPostBack="True"

 

datafieldvalue="id_Report" datatextfield="Reporttitle"

 

DataSourceID="SqlDataSource2"

 

Width="215px"

 

ImageUrl="images/report.png"

 

EmptyMessage="">

 

<ItemTemplate>

 

<div>

 

<asp:Image runat="server" ImageUrl="images/report2.png" Width="18" Height="18" />

 

<asp:Label runat="server" ID="Label1">

 

<asp:HyperLink id="hyperlink1"

 

DataNavigateUrlFields="id_Report"

 

DataNavigateUrlFormatString="viewreports.aspx?id={0}"

 

NavigateUrl='<%#"viewreport.aspx?ID=" + EVAL("id_Report").tostring %>'

 

Text='<%# Eval("Reporttitle") %>'

 

Target="_blank"

 

runat="server"/>

 

</asp:Label>

 

</div>

 

</ItemTemplate>

 

</telerik:RadComboBox>

 

<br />

 

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TF5100ConnectionString %>"

 

SelectCommand="SELECT Reporttitle, id_Report FROM report where id_category=@param and isReport =1">

 

<selectparameters>

 

<asp:controlparameter name="param" controlid="HideF" PropertyName="Value"/>

 

</selectparameters>

 

</asp:SqlDataSource>

 

</div>

 

</div>

 

</div>

 

</fieldset>

 

</ItemTemplate>

 

</telerik:RadListView>

 

</div>

 

<div style="clear: both;">

 

</div>

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TF5100ConnectionString %>"

 

SelectCommand="SELECT * FROM (SELECT DISTINCT rc.id_category, rc.category, rc.descript, rc.image_value, (Select ri.num_order from ReportCategory ri where id_category = rc.id_category ) as num, (SELECT COUNT(id_category) FROM Report WHERE id_category = rc.id_category AND isReport= 1) as nbReports FROM ReportCategory rc INNER JOIN Report ON rc.id_category = Report.id_category WHERE (rc.category <> '')) as tbl WHERE nbReports >0 ORDER BY num ">

 

</asp:SqlDataSource>

 

</div>

</

 

 

asp:Content>

Thank you for your help

Dimitar Terziev
Telerik team
 answered on 25 Jun 2011
1 answer
95 views
Hello!

Wanting to use the example described here:
Combox / Server-side events

So I adapted the code of my control by adding the directive: OnTextChanged = "Group_List_TextChanged" side aspx
<telerik:RadComboBox id="Group_List" runat="server" style="background-color:#fff;"  
    AutoPostBack="true"  
    OnTextChanged="Group_List_TextChanged"              
    AllowCustomText="false"       
    ExpandAnimation-Type="OutCubic"
    CollapseAnimation-Type="InOutQuart"       
    HighlightTemplatedItems="True"       
    Font-Italic="True"                               
    Width="270px">
<ItemTemplate>
    <div onclick="StopPropagation(event)">
        <telerik:RadTreeView ID="rtvInProdLineGroups" runat="server" DataFieldID="id_opc_item"
            OnClientNodeClicking="OnClientNodeClickedHandler"  AutoPostBack="True"
            DataFieldParentID="IdParent" DataTextField="Name" DataValueField="id_opc_item"                
            CheckBoxes="false" CheckChildNodes="false" MultipleSelect="false" style="background-color:#fff;"  >
        </telerik:RadTreeView>
    </div>
</ItemTemplate>
<Items>
    <telerik:RadComboBoxItem Text="Sélection ..." />
</Items>
</telerik:RadComboBox>
Then vb side. i added the event corresponding to it:

' Changement de signal
Private Sub Group_List_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Group_List.TextChanged
 
    ' Recuperer id Moyen
    Dim IdSignal As String = Group_List.SelectedValue
 
    ' Affecter les nouvelles valeurs
    hfSignal.Value = IdSignal
    RaiseEvent SelectedSignalChanged(New Guid(IdSignal))
End Sub

But
the example does not work for me!? I get this error:
Compiler Error Message: BC30456: 'Group_List_TextChanged' is not a member of 'ASP.oeecalcul_ctrl_tselect_signal_ascx'.

If one of you has an idea why. I'm interested
Thank you all
G
Dimitar Terziev
Telerik team
 answered on 25 Jun 2011
4 answers
95 views
I'm trying to implement the demo as is, but the only difference is that I want to use it in the EditItemTemplate of the RadGrid.
Upon compile it gives me an error (CS0103: The name 'txbImage' does not exist in the current context) on the

function OnFileSelected(fileSelected) {var textbox = $find("<%= txbImage.ClientID %>");textbox.set_value(fileSelected);}
 
which makes sense because txbImage (textbox) does not exisit when the page is first rendered.  I've tried to add with ClientScript.RegisterClientScriptBlock()  but have not found an event in which to add the Javascript function where it works.

I get thi error reported by FireBug when I double click on the file from the Explorer:

openerPage.OnFileSelected is not a function

1)Is what I'm trying to do possible?
2) how would I change the demo to work in this manner?  I want to be able to pick a file from the explorer while in edit mode interacting with a row in the grid.

thank you.

Glenn
Top achievements
Rank 1
 answered on 25 Jun 2011
1 answer
162 views
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
  
        //RadTreeNOde in Combobox
        function nodeClicking(sender, args) {
            var comboBox = $find("<%= DepartmentCombo.ClientID %>");
  
            var node = args.get_node()
  
            comboBox.set_text(node.get_text());
  
            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text(node.get_text());
            comboBox.get_items().getItem(0).set_value(node.get_value());
            comboBox.commitChanges();
                          
  
            comboBox.hideDropDown();
  
            // Call comboBox.attachDropDown if:
            // 1) The RadComboBox is inside an AJAX panel.
            // 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
            // Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.
  
            //comboBox.attachDropDown();
        }
  
        function StopPropagation(e) {
            if (!e) {
                e = window.event;
            }
  
            e.cancelBubble = true;
        }
  
        function OnClientDropDownOpenedHandler(sender, eventArgs) {
            var tree = sender.get_items().getItem(0).findControl("RadTreeView1");
            var selectedNode = tree.get_selectedNode();
            if (selectedNode) {
                selectedNode.scrollIntoView();
            }
        
                         
    </script>
</telerik:RadCodeBlock>
  
  
 <telerik:RadComboBox runat="server" ID="DepartmentCombo" Width="100%" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
                        EmptyMessage="Хэлтэс албаны сонгоно уу" ExpandAnimation-Type="None" CollapseAnimation-Type="None"
                        AutoPostBack="true" OnInit="DepComboBox_OnInit">
                        <Items>
                            <telerik:RadComboBoxItem Value="0" Text="Хэлтэс албаа сонгоно уу" />
                        </Items>
                        <ItemTemplate>
                            <div id="div1">
                                <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking" Width="100%" Height="240px">
                                </telerik:RadTreeView>
                            </div>
                        </ItemTemplate>
                    </telerik:RadComboBox>
                    <script type="text/javascript">
                        var divitem = document.getElementById("div1");
                        if (null != divitem)
                            divitem.onclick = StopPropagation;
                    </script>

when i postback and get RadTreeview1.selectedvalue  all working perfectly
RadTreeView RadTree = (RadTreeView)DepartmentCombo.Items[0].FindControl("RadTreeView1");
            Response.Write(RadTree.SelectedValue);

but when i get RadTreeview1.selectedvalue in PositionCombo i get msg "Input string was not in a correct format"
<telerik:RadComboBox runat="server" ID="PositionCombo" Width="100%" EmptyMessage="Албан тушаалаа сонгоно уу"
                        EnableLoadOnDemand="True" ShowMoreResultsBox="true" Height="150px" EnableVirtualScrolling="true"
                        OnItemsRequested="PositionCombo_ItemsRequested" LoadingMessage="Ачааллаж байна...">
                        <HeaderTemplate>
                            <table style="width: 100%" cellspacing="0" cellpadding="0">
                                <tr style="color: #417CAB; font-weight: bold;">                                   
                                    <td style="width: 100%;">
                                        Нэр
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table style="width: 100%" cellspacing="0" cellpadding="0">
                                <tr>                                   
                                    <td style="width: 100%;">
                                        <%# DataBinder.Eval(Container, "Text")%>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:RadComboBox>

protected void PositionCombo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            RadTreeView RadTree = (RadTreeView)DepartmentCombo.Items[0].FindControl("RadTreeView1");          
  
            int ComboID = Convert.ToInt32(DepartmentCombo.SelectedValue); //0
            int TReeID = Convert.ToInt32(RadTree.SelectedValue);//Input string was not in a correct format
              
  
            DataTable data = _DepClass.GetPositionListForCbx(TReeID);
  
            int itemOffset = e.NumberOfItems;
            int endOffset = Math.Min(itemOffset + 500, data.Rows.Count);
            e.EndOfItems = endOffset == data.Rows.Count;
  
            for (int i = itemOffset; i < endOffset; i++)
            {
                RadComboBoxItem tempIT = new RadComboBoxItem();
  
                tempIT.Value = data.Rows[i]["id"].ToString();
                tempIT.Text = data.Rows[i]["title"].ToString();
                PositionCombo.Items.Add(tempIT);
                tempIT.DataBind();
            }
            e.Message = GetStatusMessage(endOffset, data.Rows.Count);
        }


PS: Sorry my English is bad :).
Dimitar Terziev
Telerik team
 answered on 25 Jun 2011
1 answer
78 views
I have an dropdownlist put above of the grid
inside the grid i have checkbox "GridClientSelectColumn", i want to hide the "GridClientSelectColumn", but, when i choose something in dropdown list
the "GridClientSelectColumn' must appear...is it have any possible way to do
Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Jun 2011
0 answers
73 views
Hi,

I added those things into xml file
<paragraphs>
   <paragraph name="<H1 style='font-size: 14px; font-family: Arial; color:#808080'> Title </H2>" value="<h1 style='font-size: 14px; font-family:Arial;  '> </h1>" />
   <paragraph name="<H2 style='font-size: 12px; font-family: Arial; color:#808080'> Subhead </H2>" value="<h3 style='font-size: 12px; font-family:Arial; '> </h3>" />
   <paragraph name="<H3 style='font-size: 10px;  font-family: Arial; color:#808080'> Text </H3>" value="<h4 style='font-size: 10px; font-family:Arial; '> </h4>" /> 
 </paragraphs>


In Editor only once it show font name for selected text, if i choose second time it not shown the font name in the drop down list.
any solution?

Second Thing,

I need to play video inside of Rad Editor, any suggestions!!!!!


thanks in advance
Vinoth Arun
Top achievements
Rank 2
 asked on 25 Jun 2011
2 answers
149 views
I am using the 2010.3.1510.40 version. When I add an event with recurrence all works fine if I leave it with no end date.
However, if I try to use the "End After 'X' occurrences" option, the rule that is generated does not include anything for that limit and I get an event that recurs forever.
Also, if I try to use the date picker to end a recurrence by a certain date, the rule that is generated has tomorrow's date (no matter what I chose for the end date).

Here is the generated rule for an event that I set with Weekday occurrence, starting on 7/4/2011 and it was supposed to end on 7/9/2011:
DTSTART:20110704T180000Z
DTEND:20110704T200000Z
RRULE:FREQ=DAILY;UNTIL=20110624T050000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR

The "UNTIL" is specified as 6/24/2011 so, needless to say, none of the occurrences ever showed up.

Is there a workaround for this issue?

Thanks.
Chad
Top achievements
Rank 1
 answered on 24 Jun 2011
2 answers
126 views

We have successfully used several Rad Controls in our preexisting AJAX enabled project, but are unable to get spell check working on the RadEditor.

When I click on the spell icon I get the following error:

   Microsoft JScript runtime error: 'null' is null or not an object

The debugger shows the error as occurring in the following function:

// Name:        HTMLEditor.EditPanel.debug.js
// Assembly:    AjaxControlToolkit
// Version:     3.5.50508.0
// FileVersion: 3.5.50508
 _invokingRequest: function(sender, args) {
     if (this._contentPrepared) {
         return;
     }
     var webRequest = args.get_webRequest();
     var body = webRequest.get_body();
     // change body here...
     var reg = new RegExp("([\\?&])(" + this.get_contentElement().name + "=)([^&$]*)([&$])", "g");
     this._prepareContentForPostback(this.get_content());
 >>> body = body.replace(reg, "$1$2" + escape(this.get_contentElement().value) + "$4");  <<<- body is null
     this._contentPrepared = true;
     webRequest.set_body(body);
 },

I followed the directions for adding RadControls for ASP.NET AJAX to an existing application found here: http://www.telerik.com/help/aspnet-ajax/introduction-adding-radcontrols-prometheus-existing-application.html … and the recommendations for getting started with the editor here: http://www.telerik.com/help/aspnet-ajax/editor-getting-started.html
It should be noted the documentation specified configuration options in Step 9 which did not exist on the Smart Tag Menu (yes, we have the Telerik.Web.UI.dll in the project’s bin folder). Unable to add from the designer, I followed the directions found here: http://www.telerik.com/help/aspnet-ajax/editor-enable-spellcheck.html and manually added the spell check handler to my web.config, resulting in the editor displaying on the UI with a spell check icon on the toolbar.

I also tried substituting in a RadScriptManger in place of the ASP ScriptManger, but that only led to another problem:

Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the AjaxScriptManager in System.Web.Ajax.dll, or use the ToolkitScriptManager in AjaxControlToolkit.dll.

We are developing in VS 2008. Any help is appreciated.

Aaron
Top achievements
Rank 1
 answered on 24 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?