Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
323 views
I have an application that uses RadComboBoxes. I have noticed several issues regarding the width and labels. I have created two testing scenarios to demonstrate some of the
behavior. Also, I am using bootstrap in my application so to demonstrate the difference
in behavior between the two, I included examples of both. Attached are the pages rendered in Chrome.

 

 

Test 1 without Bootstrap:
Aspx:

<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

</head>

<body>

 

    <form id="form1" runat="server">

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

        <div class="container
vertical-center">

            <div class="row">

                <div class="col-sm-6
col-xs-12">

                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="50%" Label="50% With
Label:"></telerik:RadComboBox>

                    <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="100%" Label="100% With
Label:"></telerik:RadComboBox>

                    Label="100% w/o Label:
"

                    <telerik:RadComboBox ID="RadComboBox3" runat="server" Width="100%"></telerik:RadComboBox>

                    Label="50% w/o Label:
"<br />

                    <telerik:RadComboBox ID="RadComboBox4" runat="server" Width="50%"></telerik:RadComboBox>

                </div>

            </div>

        </div>

    </form>

</body>

</html>

 

Test 2
with bootstrap:
Aspx:

<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link rel="stylesheet" href="~/content/bootstrap.min.css" />

    <link rel="stylesheet" href="~/content/bootstrap-theme.min.css" />

</head>

<body>

 

    <form id="form1" runat="server">

        <telerik:RadScriptManager ID="ScriptManager" runat="server">

            <Scripts>

                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>

                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>

                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>

                <asp:ScriptReference Path="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" />

                <asp:ScriptReference Path="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js" />

            </Scripts>

        </telerik:RadScriptManager>

        <div class="container
vertical-center">

            <div class="row">

                <div class="col-sm-6
col-xs-12">

                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="50%" Label="50% With
Label:"></telerik:RadComboBox>

                    <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="100%" Label="100% With
Label:"></telerik:RadComboBox>

                    Label="100% w/o Label:
"

                    <telerik:RadComboBox ID="RadComboBox3" runat="server" Width="100%"></telerik:RadComboBox>

                    Label="50% w/o Label:
"<br />

                    <telerik:RadComboBox ID="RadComboBox4" runat="server" Width="50%"></telerik:RadComboBox>

                </div>

            </div>

        </div>

    </form>

</body>

</html>





























Attila Antal
Telerik team
 updated answer on 06 Apr 2023
1 answer
165 views
I have added Mail Merge field and and try to add checkbox property using Telerik word processing. but not able to find the solution. and not able to extract Mail Merge fields also from word document.
Yoan
Telerik team
 answered on 05 Apr 2023
1 answer
242 views

We need to change the selected item of RadComboBox's hosted in RadGrid in BatchEdit mode.

We have a RadGrid with parent child relationships. If the parent row combobox is changed then the change needs to ripple through and change the same value in the child rows.  If a child row is changed the parent may need to be changed as well.

The parent can be set to "Multiple,Detailed,Deferred" and a couple other values. If the parent is changed to Detailed then all the children become detailed. If the parent is Detailed and one of the children is changed to something other than Detailed then the parent must change to Multiple. If all the children changed to the same value then the parent should be changed to that value as well.

We are triggering processing with the grid OnBatchEditSetCellValue client event.  

MasterTableView EditMode="Batch"

BatchEditSetting EditType="Cell"

 

Attila Antal
Telerik team
 answered on 05 Apr 2023
1 answer
136 views

Hi,

I'm trying to use the Treelist for a data source with the following definition

public class MyGridItem
{
	public string ID { get; set; }
	public string Name { get; set; }
	public string ParentID { get; set; }
	public bool IsIncluded { get; set; }
	public bool IsExcluded { get; set; }
}

In markup I've got


<telerik:RadTreeList ID="RadTreeMarkers" runat="server" ParentDataKeyNames="ParentID" DataKeyNames="ID" AutoGenerateColumns="false"
	OnNeedDataSource="RadTreeMarkers_NeedDataSource" AllowMultiItemEdit="true" ExpandCollapseMode="Client" EditMode="InPlace"
	AllowPaging="false" AllowSorting="false" OnItemDataBound="RadTreeMarkers_ItemDataBound">
	<Columns>
		<telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" Visible="false" ForceExtractValue="Always"></telerik:TreeListBoundColumn>
		<telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" Visible="false"></telerik:TreeListBoundColumn>
		<telerik:TreeListBoundColumn DataField="Name" UniqueName="Name" HeaderText="Mark" ReadOnly="true"></telerik:TreeListBoundColumn>
		<telerik:TreeListCheckBoxColumn DataField="IsIncluded" UniqueName="IsIncluded" HeaderText="Included" ForceExtractValue="Always"></telerik:TreeListCheckBoxColumn>
		<telerik:TreeListCheckBoxColumn DataField="IsExcluded" UniqueName="IsExcluded" HeaderText="Excluded" ForceExtractValue="Always"></telerik:TreeListCheckBoxColumn>
	</Columns>
</telerik:RadTreeList>

And then in the code behind I've got
protected void RadTreeMarkers_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
{
	var treeData = MyFacade.GetTreeData();
	var treeDataGridItems = treeData.Select(m => new GridItem
	{
		ID = m.ID.ToString(),
		Name = m.Name,
		ParentID = m.ParentID.HasValue ? m.ParentID.Value.ToString() : string.Empty,
		IsIncluded = m.IsIncluded.HasValue && m.IsIncluded == true,
		IsExcluded = m.IsIncluded.HasValue && m.IsIncluded == false
	}
	).ToList();
	RadTreeMarkers.DataSource = treeDataGridItems;
}

protected void RadTreeMarkers_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
{
	if (e.Item is TreeListDataItem item)
	{
		item.Edit = true;
	}
}

The intention is for (only) the two checkboxes to be always editable in the client.

However, when rendered in the client the root items are editable but none of the child items is editable.

What am I doing wrong?

Doncho
Telerik team
 answered on 05 Apr 2023
0 answers
121 views

I am trying to disable embeddedscripts for radgrid - everything works but context menu - which scripts altogether do I need to add?

This write up (linked below) is incorrect or out of date - can someone please help.

https://docs.telerik.com/devtools/aspnet-ajax/getting-started/performance/disabling-embedded-resources#disabling-embedded-resources

John
Top achievements
Rank 1
 asked on 04 Apr 2023
8 answers
1.2K+ views

 

Hi guys,

 

I'm using 2 MonthYearPickers on a page and need that one of them to show only the year.

 

How can i do this? Tryed the css solution with #rcMView_month but that changes for both controls.

 

Thanks,

Antonio

 

DAVY
Top achievements
Rank 1
Iron
 answered on 29 Mar 2023
5 answers
632 views
I want to prevent users from pasting images inside the Radeditor. I don't want to prevent them pasting at all but if there is an image in the pasted content I want it to be filtered out and not pasted inside the editor. 
I used this code to fire "PastePlainText" to do so:

    function OnClientLoadRadEditor(editor, args) {
        var element = document.all ? editor.get_document().body : editor.get_document();
        $telerik.addExternalHandler(element, "paste", function (e) {
            editor.fire("PastePlainText");
            //cancel the browser's paste event
            if (e.preventDefault) e.preventDefault();
            if (e.stopPropagation) e.stopPropagation();
            return false;
        });
    }

It works fine when I copy HTML code that has images inside, and it filters the images. But when I copy the image itself and paste it in the editor the above event won't be fired and the image will be copied.
I also tried OnClientPasteHtml() but I don't know how to filter the images with this function. 

It seems that different browsers have different functionality on this issue and I'm a bit confused. Currently I'm testing by Chrome and IE.

I wonder if I went the wrong way from the beginning! Could you please suggest me a solution? I need the editor not to accept images at all.
QiQo
Top achievements
Rank 1
Iron
 answered on 29 Mar 2023
0 answers
1.0K+ views

Hello,

We have a requirement to attach emails to records for audit purposes.  Is this possible with your controls?

Regards,

D

Bermuda
Top achievements
Rank 1
Iron
Iron
 asked on 28 Mar 2023
3 answers
613 views

I have a radcombobox that uses a headertemplate and an itemtemplate and I would like my users to be able to sort by clicking on the text from the headertemplate.

Here is the radcombobox. It works and it's pretty simple but I can't work out how to get it to sort the items based on clicking text in the header.

                <telerik:RadComboBox ID="rcbEmp2" runat="server" Width="570px" AutoPostBack="true"
                        MarkFirstMatch="true" HighlightTemplatedItems="true" AppendDataBoundItems="true" >
                        <HeaderTemplate>
                            <ul>
                                <li>Employee</li>
                                <li>Miles</li>
                                <li>Shifts</li>
                                <li>Availability</li>
                            </ul>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <ul>
                                <li><asp:Label runat="server" ID="lbEmpNameg" Text='<%# Eval("EmpFullName")%> '></asp:Label></li>
                                <li><asp:Label runat="server" ID="Label1" Text='<%# Eval("KsDistance")%> '></asp:Label></li>
                                <li><%# DataBinder.Eval(Container.DataItem, "ThisWeeksDemoCount")%></li>
                                <li><%# DataBinder.Eval(Container.DataItem, "AvailText")%></li>
                            </ul>
                        </ItemTemplate>
                    </telerik:RadComboBox>

 

Thanks in advance!

Doncho
Telerik team
 answered on 28 Mar 2023
1 answer
146 views

Hi. I have RadGrid with filter implemented as combo box. On Item command of GridColumnButton I update the record that changes value of the field being filtered by and rebind the grid. If before grid was filtered by the column that is updated and result contains only one record, rebind crashes the application. After record is updated, the only valid value for column "Sections" is Any Sections Not Complete.


                    <telerik:GridButtonColumn UniqueName="ImageButton" CommandName="MarkRecord" ButtonType="ImageButton"
                        ImageUrl="Content/Images/Reverse.jpg" HeaderStyle-Width="60px" Exportable="false">
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn UniqueName="Sections" DataField="Sections" HeaderText="Sections" HeaderStyle-Width="180px" Exportable="false">
                        <FilterTemplate>
                            <telerik:RadComboBox ID="ddlSection" runat="server" DataSource="<%#Sections %>"
                                DataTextField="Name" DataValueField="Name" Width="130px" AppendDataBoundItems="true"
                                SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Sections").CurrentFilterValue %>'
                                OnClientSelectedIndexChanged="SectionsIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
                                <script type="text/javascript">
                                    function SectionsIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        alert(args.get_item().get_value());
                                        tableView.filter("Sections", args.get_item().get_value(), "EqualTo");
                                    }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                    </telerik:GridBoundColumn>


        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            string strNewStatus;
            string btnAction;
            if(e.CommandName == "Complete" || e.CommandName == "Reverse")
            {
                if (e.CommandName == "Complete")
                {
                    strNewStatus = "COMPLETE";
                    btnAction = "Mark Complete";
                }
                else
                {
                    strNewStatus = "PENDING";
                    btnAction = "Reverse Complete";
                }
                GridDataItem dataItem = e.Item as GridDataItem;
                var id = (int)dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["EncounterID"];
                Encounter enc = Encounters.Find(i => i.EncounterID == id);
                string userName = HttpContext.Current.User.Identity.Name.Replace("ROTHMAN\\", String.Empty);
                string retValue;
                retValue = DataAccess.UpdateVisitInfo(Convert.ToInt32(enc.tid), enc.EncounterID, enc.ECWAcct, userName, strNewStatus, enc.notes, ddlSource.SelectedValue);
                if (retValue != "")
                {
                    //handle error
                    e.Canceled = true;
                    radWindowManager.RadAlert(retValue, 280, 100, "Error", null);
                    return;
                }
                retValue = DataAccess.UpdateTracker(userName, enc.EncounterID, Convert.ToInt32(enc.ECWAcct), btnAction, strNewStatus, "", ddlSource.SelectedValue);
                if (retValue != "")
                {
                    e.Canceled = true;
                    radWindowManager.RadAlert(retValue, 280, 100, "Error", null);
                    return;
                }
                // refresh grid
                Session["Encounters"] = null;
                RadGrid1.Rebind();
            }
        }

Attila Antal
Telerik team
 answered on 27 Mar 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?