Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
154 views
I was referring telerik demo for such functionality - http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx

The only change is i am using treeview with checkbox in RadComboBox. I wanted to display checked items of combobox as comobobox text with comma on collapse.

How to do that?
Teoman
Top achievements
Rank 1
 answered on 29 Feb 2012
4 answers
108 views
Hi,
We have treeview with checkbox in combobox.We dont have any problem with chrome and firefox but combobox doesnt closed when we focused out of the control in IE.

<telerik:RadComboBox ID="cbxDepartments" runat="server" DataTextField="DEPNAME" DataValueField="DEPID"
                                ExpandAnimation-Type="None" CollapseAnimation-Type="None" OnClientDropDownClosing="OnClientDropDownClosing"
                                AllowCustomText="True" EmptyMessage="-- seçiniz --">
                                <ItemTemplate>
                                    <div id="div1">
                                        <telerik:RadTreeView ID="tvDepartments" runat="server" DataTextField="DEPNAME" DataValueField="DEPID"
                                            DataFieldParentID="SUBDEPID" DataFieldID="DEPID" Height="140px" CheckBoxes="true">
                                        </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                                <Items>
                                    <telerik:RadComboBoxItem Text="" />
                                </Items>
                                <ExpandAnimation Type="Linear"></ExpandAnimation>
                                <CollapseAnimation Type="None"></CollapseAnimation>
                            </telerik:RadComboBox>

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function OnClientDropDownClosing(sender, args) {
                //            if (args.get_node().get_level() == 0)
                //            {
                //                args.set_cancel(true);
                //            }
                //            else {
                var item = sender.get_items().getItem(0); // Get the first RadComboBoxItem
                var treeView = item.findControl('tvDepartments'); // Find your RadTreeView
                var checkedNodes = treeView.get_checkedNodes(); // Retrieve the checked items in the RadTreeView

                var newText = '';
                checkedNodes.forEach(function (node) {  // Loop through the checked nodes. Requires jQuery!
                    if (newText != '') { newText += ', '; }
                    newText += node.get_text();
                });
                var comboBox = $find("<%= cbxDepartments.ClientID %>");
                comboBox.set_text(newText); // Set the RadComboBox text
                if ($.browser.msie) { // IE sometimes takes two tries for it to respond to new text
                    comboBox.set_text(newText);
                    //                }
                }
            }
        </script>


Teoman
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
199 views
I have been through your sampels http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx  and I have no issues getting these to work.  But I have been unsuccesful in getting the values of the confirm in my serverside code behind.  Basically im trying to fire one server side function if yes/true and  a different server side sub if no/false.  In your samples you are firing a javascript to display the result, thats fine but unfunctional for my application. 
Jarrett
Top achievements
Rank 2
 answered on 28 Feb 2012
4 answers
230 views
Hello,

I have several RadComboBoxes that interact with each other using client-side methods and requesting the items on demand, like here: http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx
This works well, but when I need the SelectedValue it's always empty.

Can anyone help me please? (I don't know what I'm doing wrong...)

Here I put the code used:

RadComboBoxes
<telerik:RadComboBox ID="cboProvinciaT" runat="server" Width="200px" OnClientSelectedIndexChanging="LoadLocalidades" OnItemsRequested="cboProvinciaT_ItemsRequested" MarkFirstMatch="true" Skin="Sunset"></telerik:RadComboBox>
<telerik:RadComboBox ID="cboLocalidadT" runat="server" Width="200px" OnClientSelectedIndexChanging="LoadTiposVia" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="cboLocalidadT_ItemsRequested" MarkFirstMatch="true" Skin="Sunset"></telerik:RadComboBox>
<telerik:RadComboBox ID="cboTipoViaT" runat="server" Width="80px" OnClientSelectedIndexChanged="LoadNombresVia" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="cboTipoViaT_ItemsRequested" MarkFirstMatch="true" Skin="Sunset"></telerik:RadComboBox>
<telerik:RadComboBox ID="cboNombreVia" runat="server" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="cboNombreVia_ItemsRequested" Filter="Contains" Skin="Sunset"></telerik:RadComboBox>

Scripts
<script type="text/javascript">
    var LocalidadesCombo;
    var TiposViaCombo;
    var NombresVia;
 
    function pageLoad() {
        LocalidadesCombo = $find("<%= cboLocalidadT.ClientID %>");
        TiposViaCombo = $find("<%= cboTipoViaT.ClientID %>");
        NombresVia = $find("<%= cboNombreVia.ClientID %>");
    }
 
    function LoadLocalidades(sender, eventArgs) {
        var item = eventArgs.get_item();
        LocalidadesCombo.set_text("Cargando...");
        TiposViaCombo.clearSelection();
 
        if (item.get_index() > 0) {
            LocalidadesCombo.requestItems(item.get_value(), false);
            LocalidadesCombo.clearSelection();
        }
        else {
            LocalidadesCombo.set_text(" ");
            LocalidadesCombo.clearItems();
 
            TiposViaCombo.set_text(" ");
            TiposViaCombo.clearItems();
        }
    }
 
    function LoadTiposVia(sender, eventArgs) {
        var item = eventArgs.get_item();
 
        TiposViaCombo.set_text("Cargando...");
        TiposViaCombo.requestItems(item.get_value(), false);
        TiposViaCombo.clearSelection();
 
        if (item.get_index() > 0) {
            TiposViaCombo.requestItems(item.get_value(), false);
            TiposViaCombo.clearSelection();
        }
        else {
            TiposViaCombo.set_text(" ");
            TiposViaCombo.clearItems();
            NombresVia.set_text(" ");
            NombresVia.clearItems();
        }
 
    }
 
    function LoadNombresVia(sender, eventArgs) {
        var item = eventArgs.get_item();
        NombresVia.set_text("Cargando...");
        NombresVia.requestItems(item.get_value(), false);
        NombresVia.clearSelection();
    }
 
    function ItemsLoaded(sender, eventArgs) {
       sender.showDropDown();
    }
</script>

Page_Load (server-side)
if (!Page.IsPostBack)
{
    CargarProvincias(); //This method fill cboProvinciaT
}
else if (!Page.IsCallback)
{
    LoadLocalidades(cboProvinciaT.SelectedValue);
    LoadTiposVia(cboLocalidadT.SelectedValue);
    LoadNombresVia(cboTipoViaT.SelectedValue);
}

Rest of functions
#region Dirección
 
protected void LoadLocalidades(string pIdProvincia)
{
 
    try
    {
        AD.Motor mMotorAD = new AD.Motor();
 
        DataTable mDT = new DataTable();
 
        mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, 'Localidad...' as Nombre union SELECT ID, Nombre FROM tlLocalidadDN where idProvincia=" + pIdProvincia + " ORDER BY Nombre ASC");
 
        DataSet mDS = new DataSet();
        mDS.Tables.Add(mDT);
 
        cboLocalidadT.DataTextField = "Nombre";
        cboLocalidadT.DataValueField = "ID";
        cboLocalidadT.DataSource = mDS.Tables[0];
        cboLocalidadT.DataBind();
         
 
 
    }
    catch (Exception ex)
    {
 
        throw ex;
    }
     
}
protected void LoadTiposVia(string pIdLocalidad)
{
    try
    {
        AD.Motor mMotorAD = new AD.Motor();
 
        DataTable mDT = new DataTable();
 
        mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, 'Vía..' as Nombre union SELECT ID, Nombre FROM tlTipoViaDN ORDER BY Nombre ASC");
 
        DataSet mDS = new DataSet();
        mDS.Tables.Add(mDT);
 
        cboTipoViaT.DataTextField = "Nombre";
        cboTipoViaT.DataValueField = "ID";
        cboTipoViaT.DataSource = mDS.Tables[0];
        cboTipoViaT.DataBind();
 
 
    }
    catch (Exception ex)
    {
 
        throw ex;
    }
}
protected void LoadNombresVia(string pIdTipoVia)
{
    try
    {
 
        //HERE ALWAYS GET empty ("")
           string
mIdLocalidad = cboLocalidadT.SelectedValue;
        AD.Motor mMotorAD = new AD.Motor();
 
        DataTable mDT = new DataTable();
 
        mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, '  Nombre de la Vía..' as Nombre union SELECT ID, Nombre FROM tlViaDN where idLocalidad=" + mIdLocalidad + " and idTipovia=" + pIdTipoVia + " order by Nombre");
 
        DataSet mDS = new DataSet();
        mDS.Tables.Add(mDT);
 
        cboNombreVia.DataTextField = "Nombre";
        cboNombreVia.DataValueField = "ID";
        cboNombreVia.DataSource = mDS.Tables[0];
        cboNombreVia.DataBind();
 
    }
    catch (Exception ex)
    {
         
        throw ex;
    }
}
protected void LoadNombresVia(string pIdTipoVia, string pIdLocalidad)
{
    try
    {
 
        AD.Motor mMotorAD = new AD.Motor();
 
        DataTable mDT = new DataTable();
 
        mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, '  Nombre de la Vía..' as Nombre union SELECT ID, Nombre FROM tlViaDN where idLocalidad=" + pIdLocalidad + " and idTipovia=" + pIdTipoVia + " order by Nombre");
 
        DataSet mDS = new DataSet();
        mDS.Tables.Add(mDT);
 
        cboNombreVia.DataTextField = "Nombre";
        cboNombreVia.DataValueField = "ID";
        cboNombreVia.DataSource = mDS.Tables[0];
        cboNombreVia.DataBind();
 
    }
    catch (Exception ex)
    {
 
        throw ex;
    }
}
protected void cboNombreVia_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
    LoadNombresVia(e.Text);
}
protected void cboProvinciaT_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
    CargarProvincias();
}
protected void cboLocalidadT_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
    LoadLocalidades(e.Text);
 
}
protected void cboTipoViaT_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
    LoadTiposVia(e.Text);
}
 
#endregion

When I try to get cboLocalidadT.SelectedValue in function LoadNombresVia
protected void LoadNombresVia(string pIdTipoVia)
        {
            try
            {
                //********************************************
                //**** HERE ALWAYS GET EMPTY VALUE --> "" ****
                //********************************************
 
                string mIdLocalidad = cboLocalidadT.Text;
 
                //********************************************
 
                AD.Motor mMotorAD = new AD.Motor();
 
                DataTable mDT = new DataTable();
 
                mDT = mMotorAD.ExecuteDataTable("Select 0 as ID, '  Nombre de la Vía..' as Nombre union SELECT ID, Nombre FROM tlViaDN where idLocalidad=" + mIdLocalidad + " and idTipovia=" + pIdTipoVia + " order by Nombre");
 
                DataSet mDS = new DataSet();
                mDS.Tables.Add(mDT);
 
                cboNombreVia.DataTextField = "Nombre";
                cboNombreVia.DataValueField = "ID";
                cboNombreVia.DataSource = mDS.Tables[0];
                cboNombreVia.DataBind();
 
            }
            catch (Exception ex)
            {
                 
                throw ex;
            }
        }

Thank you very much for your help!!
jeslopmay
Top achievements
Rank 1
 answered on 28 Feb 2012
2 answers
372 views
I have this RadTextBox:
<asp:panel id="div_projectsAssigned" runat="server" class="infoBox-projectsAssigned">
        <telerik:RadTextBox ID="txtProjectsAssigned" runat="server" Text="0"
                   BorderStyle="None" ReadOnly="True" Width="42" >
                    <ClientEvents OnValueChanged="onValueChanged()" />
                    <ReadOnlyStyle HorizontalAlign="Center" BackColor="Transparent" ForeColor="White"
                            Font-Bold="True" Font-Names="Segoe UI" Font-Size="12pt" Width="30px">
                     </ReadOnlyStyle>
       </telerik:RadTextBox>
</asp:panel>

Note the parenthesis on

ClientEvents OnValueChanged="onValueChanged()" />


If I remove the parenthesis from the function call, the function is not executed. If I keep the parenthesis, the function is executed (see below), but the parameters are not passed.
<script type="text/javascript">
 
        function onValueChanged(sender, args) {
 
            if (args.get_oldvalue != args.get_newvalue) {
 
                thisDiv = $get("<%= div_projectsAssigned.ClientID %>");
                esteDiv = "#" + thisDiv;
                animateDiv(thisDiv);
            }
        }
 
        function animateDiv(divToAnimate) {
 
            for (i = 1; i <= 3; i++) {
 
                $(divToAnimate).animate(
                    { "opacity": "0.15" },
                    "slow");
 
                $(divToAnimate).animate(
                    { "opacity": "1.00" },
                    "slow");
            }
        }
 
    </script>

I need the parameters to check if the value in the RadTextBox has changed, and if so, make an amimation.
Any idea about why the parameters are not being passed?
Joaquín
Top achievements
Rank 2
 answered on 28 Feb 2012
5 answers
208 views
With several detail tables at the same level, is there a way to bind each table to a source programmatically? Each one will be calling the same stored procedure, but with a different parameter value.

I'd love to do something like this:
DetailTable1.DataSource = spFillMe 1
DetailTable2.DataSource = spFillMe 2
DetailTable3.DataSource = spFillMe 3

Also, because connection strings are managed in my environment, I can't point SqlDataSources to a table or string on the front page.
Casey
Top achievements
Rank 1
 answered on 28 Feb 2012
1 answer
162 views
Is there any way I can set focus on the textelement in the combobox from client side. I tried setting .focus() method on the client side, but it only keeps the combobox focused, and when i press any key the input text element, inside the combobox does not get focus. Is there any other way to get focus on that.
Dimitar Terziev
Telerik team
 answered on 28 Feb 2012
7 answers
197 views
Hi ,

I need a tooltip to be displayed when I hover mouse over LinkButton.
The tooltip required should have blue border and we need to change font color and size as well.

I have tried using :

<style type="text/css">
    .style1
        {
            color:Red !important;
            border:Blue;
        }
    </style>

And :

<form id="form1" runat="server">
    <rad:RadScriptManager runat="server"></rad:RadScriptManager>
     <div>
                  
        <asp:LinkButton ID="LinkButton1" runat="server" Text="Welcome"></asp:LinkButton>
          
        <rad:RadToolTip ID="Tooltip1" runat="server" Text="Hello Everyone" Enabled="true" CssClass="style1" 
            Font-Size="Medium" TargetControlID="LinkButton1" RelativeTo="Element" Position="BottomCenter" AutoCloseDelay="2000" 
            ShowEvent="OnMouseOver" EnableTheming="true" EnableEmbeddedSkins="true"></rad:RadToolTip>
              
    </div>
    </form>

But the styles are not effecting the Tooltip .
Not sure for the solution ,I also tried using codebehind and using a separate stylesheet. But it didn't help.

Please provide me a solution for implementing this.
rdmptn
Top achievements
Rank 1
 answered on 28 Feb 2012
9 answers
174 views
Hi,

I wonder if you could add a new option in the Image Manager for the next version:

When inserting a thumbnail image, there are already options to link to the original and to open this link in a new window.

How about another option to open the original image in a lightbox?

When activated, a rel="lightbox" attribute is added to the link tag.

We could then add any lightbox (or derivate) script we like to the page.

If you add an extra field for an "image set" you could also have the image gallery mentioned in another post. Typing a value in the field "image set" would then result in the attribute rel="lightbox[<image set value>]" being added to the link tag.

Or can I achieve this in any other way?
Would be nice to have this for radE for Sharepoint 4.5.3 especially... ;-)

Regards

Martni
Rumen
Telerik team
 answered on 28 Feb 2012
1 answer
118 views
Hello,

I've a grid on a dynamically loaded UserControl. From the code-behind I'm adding serveral columns to the existing column collection. This happens on Page_Init. Now when a postback occurs the columns are added again and when the viewstate is loaded the columns from a previous creation are added also. So every postback my column collection grows.
I only want to recreated the columns on Page_Init manually and exclude them from ViewState. How can I force this?

Regards,
  JosM
Pavlina
Telerik team
 answered on 28 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?