Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
118 views
Hello, I have data coming into the scheduler that's formatted as html.  So you should be able to click of the appointment subject and follow a link.  For some reason I'm having difficulty showing the subject text as clickable, instead I have all the html markup shown.
Peter
Telerik team
 answered on 06 Sep 2010
2 answers
88 views
Hello all,
In my project, i got 3 comboboxes. When the user clicks the first combobox and chooses an item, then the second combobox is loaded with  some data. The same mechanism works just fine when the user chooses items for the first time. When the user has already choosen the items on the 3 comboboxes, and tries to change the value in one of the comboboxes, then the following code is being used:

cmbArrondisement.Items.Clear();
  
foreach (RadComboBoxItem item in Middle_Tier.SideFormFunc.ConvertToComboBoxItem Middle_Tier.SideFormFunc.LoadArrondisements(Convert.ToString(cmbMunicipality.SelectedValue))))
{
  cmbArrondisement.Items.Add(item);
}

By the time that the program reaches cmbArrondisement.Items.Clear(); command, then it freezes and after 1 or 2 minutes it unfreezes. cmbArrondisement has only 1 item.

Could you explain this problem?


Thanks in advance
Tom
Top achievements
Rank 1
 answered on 05 Sep 2010
8 answers
445 views
Hi,
I have a hierarchical grid (version 2009.1.402.20 of Telerik.Web.UI ) where I need a expand / collapse column as the rightmost column for the master table. I need to have a particular image for expand / collapse.
I tried following code, however I am not able to get the image set for expand / collapse icons:

 

  1. With the following code, I get the expand image set at first time, but on expand / collapse, it goes off (it shows image is not available) and then onwards no image is set.

 

<Telerik:RadGrid ID="rgMyGoals" runat="server" AllowMultiRowSelection="True"

 

 

OnItemDataBound="rg_ItemDataBound"

 

 

AutoGenerateColumns="False" EnableEmbeddedSkins="False"

 

 

GridLines="None" ShowDesignTimeSmartTagMessage="true"

 

 

MasterTableView-RowIndicatorColumn-Visible="true"

 

 

MasterTableView-ExpandCollapseColumn-Display="false" ClientSettings-AllowExpandCollapse="true"

 

 

SelectedItemStyle-CssClass="GridRowSelected" ShowHeader ="false"

 

 

Skin="TP">

 

 

<ClientSettings ClientEvents-OnHierarchyExpanding="HierarchyExpanded" ClientEvents-OnHierarchyExpanded="HierarchyExpanded">

 

 

<Selecting AllowRowSelect="True" />

 

 

<Scrolling AllowScroll="True" />

 

 

</ClientSettings>

 

 

<MasterTableView DataKeyNames="GoalCategoryPK" HierarchyLoadMode="Client"

 

 

BorderWidth="0" GridLines="None" BorderStyle="None" Frame="Void"

 

 

Name="MasterTable" Width="100%" >

 

 

<DetailTables>

 

 

.
.
.
.

 

 

</DetailTables>

 

 

<Columns>

 

 

<Telerik:GridClientSelectColumn UniqueName="SelectColumn" ItemStyle-Width="5%"

 

 

ItemStyle-HorizontalAlign="Left">

 

 

</Telerik:GridClientSelectColumn>

 

 

<Telerik:GridBoundColumn DataField="ObjCategory" UniqueName="ObjCategory" ItemStyle-HorizontalAlign="Left"></Telerik:GridBoundColumn>

 

 

<Telerik:GridExpandColumn ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" ButtonType="ImageButton" Display="true" Visible="true"

 

 

ExpandImageUrl="~/expand.gif" UniqueName="ExpandCollapse"

 

 

CollapseImageUrl="~/collpase.gif"></Telerik:GridExpandColumn>

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

 

</Telerik:RadGrid>

 


When I changed the above snippet to have ButtonType="LinkButton", I get the  '+' image set for expand as well as collapse. It does not honor the image urls which i have set for ExpandImageUrl / CollapseImageUrl.

I also tried setting these from OnInit(). However that also did not work well. Please guide me  to set and retain the Expand / Collapse images.

Thanks and Regards,
Maitreyee

Sreeram
Top achievements
Rank 1
 answered on 05 Sep 2010
1 answer
87 views
I am trying to follow the info at http://www.telerik.com/help/aspnet-ajax/grdperformingbatchupdates.html regarding batch edit updates.

Can someone explain this line to me:
SqlDataSource1.UpdateCommand = String.Format("Update Customers SET ContactName='{0}' WHERE CustomerID='{1}'", newValues("ContactName"), 

Specifically the {0} and the {1}.  My grid has 2 datakeys DataKeyNames="ContributionMasterID,EmployeeID" . I am assuming that we are updating the contactname column where the customerID is equal to either a datakey or a column. If someone can explain this I can try and implement it in my scenario.

I am just starting out so please forgive my ignorance. Thank you. 

  
STEPHEN
Top achievements
Rank 1
 answered on 05 Sep 2010
1 answer
561 views
I used some code found on this forum to implement checkboxes in a combobox itemtemplate. everything works fine apart from i want the saved items checkbox to be checked when the dropdown is viewed.
any ideas?

here is the front end

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TopFiveArticlesSelector.ascx.cs" Inherits="CMSFormControls_TopFiveArticlesSelector" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 <script type="text/javascript">
            var hiddenfld = ("<%= this.Hidden.ClientID %>");
            var cancelDropDownClosing = false;
             
            function StopPropagation(e)
            {
                //cancel bubbling
                e.cancelBubble = true;
                if (e.stopPropagation)
                {
                    e.stopPropagation();
                }
            }
 
            function onDropDownClosing()
            {
                cancelDropDownClosing = false;
            }
 
            function onCheckBoxClick(chk)
            {
                var combo = $find("<%= RadComboBox2.ClientID %>");
                //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() + ",";
                        //alert(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(text);
                    document.getElementById(hiddenfld).value = values;                  
                   
                }
                else
                {
                    //all checkboxes are unchecked
                    //so reset the controls
                    combo.set_text("");              
                }
            }
 
            //this method removes the ending comma from a string
            function removeLastComma(str)
            {
                return str.replace(/,$/,"");
            }
 
</script>
<asp:HiddenField ID="Hidden" runat="server"/>
 <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="400" AllowCustomText="true" DataValueField="DocumentID" DataTextField="Title" EmptyMessage="Select upto 5 articles" OnClientDropDownClosed="onDropDownClosing" >
    <ItemTemplate>
        <div onclick="StopPropagation(event)" class="combo-item-template">
            <asp:CheckBox runat="server" ID="chk1" Text='<%#Eval("Title")%>' onclick="onCheckBoxClick(this)" />           
        </div>
    </ItemTemplate>
</telerik:RadComboBox>

here is the backend

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using CMS.SiteProvider;
using CMS.CMSHelper;
using CMS.GlobalHelper;
using Telerik.Web.UI;
 
public partial class CMSFormControls_TopFiveArticlesSelector : CMS.FormControls.FormEngineUserControl
{
    private DataTable dt = null;
 
    protected void Page_Load(object sender, EventArgs e)
    {
        ArticleItems();
    }
 
    /// <summary>
    /// Gets or sets field value
    /// </summary>
    public override Object Value
    {
        get
        {
            return Hidden.Value.ToString();           
        }
        set
        {
            // Ensure drop down list options
            ArticleItems();
 
            Hidden.Value = System.Convert.ToString(value);
 
            string[] RelatedID = Hidden.Value.Split(new char[] { ',' });
                       
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                for (int e = 0; e < RelatedID.Length; e++)
                {
                    if (dt.Rows[i]["DocumentId"].ToString() == RelatedID[e].ToString())
                    {
                        RadComboBox2.Text += dt.Rows[i]["Title"].ToString() + ",";
                        CheckBox checkbox = (CheckBox)RadComboBox2.Items[i].FindControl("chk1");
                        checkbox.Checked = true;
                    }
                }
            }
 
        }
    }
 
    /// <summary>
    /// Returns true if some color is selected. If no, it returns false and displays an error message.
    /// </summary>
    public override bool IsValid()
    {
        if (RadComboBox2.Text != "")
        {
            return true;
        }
        else
        {
            // Set form control validation error message
            this.ValidationError = "Please Select Tags For This Article";
            return false;
        }
    }
 
    protected void ArticleItems()
    {
        DataSet ds = TreeHelper.SelectNodes("/%", false, "CriticalCare.Conclusion;CriticalCare.Literature;CriticalCare.Theory", "", " ", -1, false);
        dt = new DataTable();
 
        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            for (int i = 0; i < ds.Tables.Count; i++)
            {
                dt.Merge(ds.Tables[i]);
            }          
            RadComboBox2.DataSource = dt;
            RadComboBox2.DataBind();
 
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                CheckBox checkbox = (CheckBox)RadComboBox2.Items[i].FindControl("chk1");
                checkbox.ToolTip = dt.Rows[i]["DocumentID"].ToString();
            }
        }     
    }
}
Simon
Telerik team
 answered on 04 Sep 2010
0 answers
137 views
I bind the schedular with objectdatasource...inseting and update with that datasource only......when i edit the 0ccurence it works and when i edit with series it getting some error like object reference is not set to be istance of class ..i think  some value is not passing... i written
like this
below
 <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Web20" DataSourceID="ods_calender"
         DataKeyField="calendartaskid" DataSubjectField="description" DataStartField="startdate"
        DataEndField="enddate" DataRecurrenceField="recurrencerule" DataRecurrenceParentKeyField="recurrenceruleid"
        OnAppointmentDelete="RadScheduler1_AppointmentDelete" OnAppointmentClick="RadScheduler1_AppointmentClick"
        OnOccurrenceDelete="RadScheduler1_OccurrenceDelete">
     
    </telerik:RadScheduler>
    <asp:ObjectDataSource ID="ods_calender" runat="server" InsertMethod="insertUpdate_Calendertasks"
        SelectMethod="Get_Calendertasks" TypeName="General" UpdateMethod="insertUpdate_Calendertasks"
        DeleteMethod="insertUpdate_Calendertasks">
        <%-- <DeleteParameters>
            <asp:Parameter Name="calendartaskid" Type="Int32" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="startdate" Type="DateTime" />
            <asp:Parameter Name="enddate" Type="DateTime" />
            <asp:Parameter Name="recurrencerule" Type="String" />
            <asp:Parameter Name="recurrenceruleid" Type="Int32" />
            <asp:Parameter Name="Recordtype" Type="String" />
            <asp:SessionParameter Name="doneby" Type="Int32" SessionField="UserID" />
            <asp:Parameter Name="cmd" Type="String" DefaultValue="D" />
        </DeleteParameters>--%>
        <UpdateParameters>
           <%-- <asp:ControlParameter ControlID="hdn_appid" Type="Int32" Name="calendartaskid" />--%>
            <asp:Parameter Name="calendartaskid" Type="Int32" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="startdate" Type="DateTime" />
            <asp:Parameter Name="enddate" Type="DateTime" />
            <asp:Parameter Name="recurrencerule" Type="String" />
            <asp:Parameter Name="recurrenceruleid" Type="Int32" />
            <asp:Parameter Name="Recordtype" Type="String" DefaultValue="C" />
            <asp:SessionParameter Name="doneby" Type="Int32" SessionField="UserID" />
            <asp:Parameter Name="cmd" Type="String" DefaultValue="M" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="calendartaskid" Type="Int32" DefaultValue="0" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="startdate" Type="DateTime" />
            <asp:Parameter Name="enddate" Type="DateTime" />
            <asp:Parameter Name="recurrencerule" Type="String" />
            <asp:Parameter Name="recurrenceruleid" Type="Int32" />
            <asp:Parameter Name="Recordtype" Type="String" DefaultValue="C" />
            <asp:SessionParameter Name="doneby" Type="Int32" SessionField="UserID" />
            <asp:Parameter Name="cmd" Type="String" DefaultValue="C" />
        </InsertParameters>
    </asp:ObjectDataSource>



no coding part only source  can u rectify the  error
pich cock
Top achievements
Rank 1
 asked on 04 Sep 2010
0 answers
89 views
Hi,



I am facing this problem i catching dropdown selected value through javascript on on click event of button

Microsoft JScript runtime error: Object doesn't support this property or method

how to solve this problem.
<asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
   
      <telerik:RadComboBox ID="RadComboBox1" runat="server"
                      HighlightTemplatedItems="true"  >
                     <Items>
            <telerik:RadComboBoxItem runat="server" Text="Jan" Value="1" />
            <telerik:RadComboBoxItem runat="server" Text="feb" Value="2" />
            <telerik:RadComboBoxItem runat="server" Text="Mar" Value="3" />
            <telerik:RadComboBoxItem runat="server" Text="Apr" Value="4" />
            <telerik:RadComboBoxItem runat="server" Text="May" Value="5" />
            <telerik:RadComboBoxItem runat="server" Text="June" Value="6" />
            <telerik:RadComboBoxItem runat="server" Text="July" Value="7" />
            <telerik:RadComboBoxItem runat="server" Text="Aug" Value="8" />
            <telerik:RadComboBoxItem runat="server" Text="Sep" Value="9" />
            <telerik:RadComboBoxItem runat="server" Text="Oct" Value="10" />
            <telerik:RadComboBoxItem runat="server" Text="Nov" Value="11" />
            <telerik:RadComboBoxItem runat="server" Text="Dec" Value="12" />
        </Items>
        </telerik:RadComboBox>
    
    
    <input id="Button1" type="button" value="button" onclick="getvalue();" />
     
     
     <script type="text/javascript" language="javascript"
function getvalue() 
  var combo = <%=RadComboBox1.ClientID %>; 
    var val= combo.GetValue(); // getting the selected value 
    var text= combo.GetText();  // getting the selected text 
}


thanks and regards 

shanker.B
shanker bangari
Top achievements
Rank 1
 asked on 04 Sep 2010
1 answer
132 views
Hello people from Telerik world!

This is my first steps with this amazing tool and I'm so impressed with its power, flexibility and documentation...
I've been learning ASP.NET and C# since 6 months ago...

I'm working in a draft based in 'http://demos.telerik.com/webmail/' for an Outlook-like application and the customer wants a combo to choose what skin he wants to see and for this, I was using this example.

I'm facing another problem: In this application, I have another HTML elements like headers (using divs), titles (using h1, divs and spans) that makes part of the visual identity of the application, but when I change the skin, for example, I would like that the header and titles, uses the same color from the current skin.

How can I do that?

I thought in create classes like .Header_Windows7, .Header_Black, .Header_Vista and so on in an external stylesheet used in the application, but how I should apply this for a div, for example?

Exists something like the following?

<div id="header" class="Header_<%= ??? %>">

Thanks,

Marcel
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 04 Sep 2010
5 answers
164 views
Hello,

I could use a little assistance here. I have a grid that I'm using popup edit forms to add new records and edit existing ones. On the popup edit form, I have 2 RadTextBoxes that I want to use a JQuery script for to count the characters entered and show the remaining available.

So...I need a way to fire off a client side event and get the client ID of those two RadTextBoxes so I can put them in the JQuery.

The JQuery script is a simple one liner that uses the client ID of the textbox to get the object and then writes the results using a span ID.

Is there a way to use the OnPopUpShowing client side event to get the client ID of those RadTextBoxes? Do I have to do it in the ItemCreated event on the server side and register the JavaScript?

Any help you can provide is much appreciated. Thanks.
Philip Senechal
Top achievements
Rank 1
 answered on 03 Sep 2010
34 answers
727 views
I understand that IE8 is still beta, but wondering if you guys are testing against it yet.  I have placed a combobox on a form and bound it to a simple list.  View this page in IE8 Compatibility Mode and everything looks great - normal sized box.  However, if I turn off compatibility mode the combo stretches to the full width of the window.  It stretches regardless of any width I may have specified directly on the control.

Is this a bug with IE8 or with the controls?

BTW, looks fine in other browsers I have tested, but eventually MS will push IE8 out the door and want to be ready for it.
JULIAN GOMEZ
Top achievements
Rank 1
 answered on 03 Sep 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?