Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
437 views

Hi

 Being my first forumn post, please forgive me if this has already been asked - answered.

I'm looking for information on how to reduce the amount of filter list options (contains, nofilter, equalsto......) for the grid column. The problem is that this is not the normal menu items as I'm using the excel-like filtering and therefore the items are contained in the headercontextmenu.

Other setting are:

- autogenerated columns

- grid is generated in code and not the aspx page

How do I remove, some of these items.

 

Brendan

Kostadin
Telerik team
 answered on 11 Feb 2016
1 answer
166 views

Hi

 

I have a small issue, that i cant seem to get my head around...

 

i have a radbutton - with an OnClientClicked="doSomething" attached:

<telerik:RadButton ID="ipplanSearch" runat="server" ButtonType="LinkButton" CssClass="imageButton_75" Text="Search" OnClientClicked="IPPlanSearchButtonClick" AutoPostBack="false" >
                        <Icon PrimaryIconUrl="Images/Find_16x16.png" />
                    </telerik:RadButton>

 

and the i have a javascript function as this:

function IPPlanSearchButtonClick(sender, eventArgs) {

 

    var Hostname = $find("<%= Hostname.ClientID %>")._text;
    var func = $find("<%= Func.ClientID%>")._text;
    var ApplicationID = $find("<%= ApplicationId.ClientID%>")._text;
    var IPAddress = $find("<%= IPAddress.ClientID%>")._text;
    var Terminated = $find("<%= Terminated.ClientID%>")._selectedValue;
    var url = "/Windows/IPPlanSearch.aspx?hostname=" + Hostname + "&function=" + func + "&EnvironmentID=&Application=" + ApplicationID + "&IPAddress=" + IPAddress + "&MACAddress=&AssignedIP=&ManagementIP=&CountryID=&SerialNumber=&Asset=&OSName=&DateID=&CertificateName=&Terminated=" + Terminated;
 
    OpenWindowV1(url, "Search IPPlan");
    return false;
}

 

Everything seems to be working just fine - the function is called as expected, the new window is opened.. but then it complains:

 

0x800a1391 - JavaScript runtime error: 'IPPlanSearchButtonClick' is undefined

 

from the following autogenerated function:

 

Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_accessKey":"","_hasIcon":true,"_hasImage":false,"_isClientSubmit":true,"_isImageButton":false,"_postBackReference":"__doPostBack('ipplanSearch','')","_renderMode":1,"autoPostBack":false,"buttonType":1,"clientStateFieldID":"ipplanSearch_ClientState","cssClass":"imageButton_75","iconData":{"primaryIconUrl":"/Images/Find_16x16.png"},"imageData":{},"text":"Search","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"ipplanSearch"}, {"clicked":IPPlanSearchButtonClick}, null, $get("ipplanSearch"));
});

 

Any idea what i have missed?

thanks

/Stig

 

 

Danail Vasilev
Telerik team
 answered on 11 Feb 2016
1 answer
256 views

Hey,

i wonder if it is somehow possible to define cells to be read only including the formular. I also couldn't find a solution for hiding sheets when importing an excel file.

Do you guys have any solution for that?

 

Ivan Danchev
Telerik team
 answered on 11 Feb 2016
0 answers
247 views

Good day guys I have this scenario where i want to validations.I want to be able to validate the control using jquery popup dialogs to display error message to the user.

Please help anyone...

here is my markup below

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditIncidents.aspx.cs"
    Inherits="Incident_Monitor.Incidents.EditIncidents" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%--<%@ Register TagPrefix="asp" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2015.3.930.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head id="Head1" runat="server">
       
  <script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script>
       <link rel="stylesheet" href="Theme/redmond/jquery-ui-1.10.3.custom.css"/>
   <script src="Scripts/jquery-ui-1.11.4.js" type="text/javascript"></script>
    <title>Edit Dialog</title>
    <script type="text/javascript">
 
        $(document).ready(function () {
            $("#Popdiv").dialog({
                autoOpen: false,
                autoResize: true,
                resizable: false,
                modal: true,
                draggable: false,
                hide: { effect: "blind" },
                title: "Error",
                open: function (event, ui) {
                    $(this).parent().appendTo("form");
                    $("#TextBox1").val("");
                    $("#TextBox1").focus();
                    $("#TextBox2").val("");
                    /* $("#TextBox2").focus();*/
                    //$("#hfisopen").val("true");
                },
                buttons: {
                    "ok": function () {
                        $(this).dialog("close");
                    },
                }
 
            });
        });
 
        $("#LoginButton").click(function (e) {
            ValidateUsertwo();
            e.preventDefault();
        });
        function ValidateUsertwo() {
            
            var ID = $find("#<%=cboAccount.ClientID%>");
            if (ID == "" || "Select Account") {
                $("#Popdiv").dialog("open");
                return false;
            }
 
         }
    </script>
</head>
<body ID="EditIncident">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        <StyleSheets>
            <telerik:StyleSheetReference Path="~/Styles/Site.css" />
            <telerik:StyleSheetReference Path="~/App_Themes/iThNk/iThNk.skin" />
        </StyleSheets>
    </telerik:RadStyleSheetManager>
    <form id="form1" runat="server">
    <div>
        <script type="text/javascript">
            function SiteNodeClicking(sender, args) {
                var comboBox = $find('<%= fvIncidentEdit.FindControl("cboSite").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.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 toggleVisibility(txtOtherTitle)
            {
                var control = document.getElementById(txtOtherTitle);
 
                if (control.style.visibility == "visible" || control.style.visibility == "") {
                    control.style.visibility = "hidden";
                }
                else {
                    control.style.visibility = "visible";
                }
            }
 
 
 
            function LocationNodeClicking(sender, args) {
                var comboBox = $find('<%= fvIncidentEdit.FindControl("cboLocation").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.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 DepartmentNodeClicking(sender, args) {
                var comboBox = $find('<%= fvIncidentEdit.FindControl("cboDepartment").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.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 CategoryNodeClicking(sender, args) {
                var comboBox = $find('<%= fvIncidentEdit.FindControl("cboCategory").ClientID %>');
 
                var node = args.get_node()
 
                if (node.get_value() == 0) {
 
                    node.set_selected(false);
                    args.set_cancel(true);
 
                } else {
 
                    comboBox.set_text(node.get_text());
 
                    comboBox.trackChanges();
                    comboBox.get_items().getItem(0).set_text(node.get_text());
                    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 OnClientSiteDropDownOpenedHandler(sender, eventArgs) {
                var tree = sender.get_items().getItem(0).findControl("trvSite");
                var selectedNode = tree.get_selectedNode();
                if (selectedNode) {
                    selectedNode.scrollIntoView();
                }
            }
 
            function OnClientLocationDropDownOpenedHandler(sender, eventArgs) {
                var tree = sender.get_items().getItem(0).findControl("trvLocation");
                var selectedNode = tree.get_selectedNode();
                if (selectedNode) {
                    selectedNode.scrollIntoView();
                }
            }
 
            function OnClientDepartmentDropDownOpenedHandler(sender, eventArgs) {
                var tree = sender.get_items().getItem(0).findControl("trvDepartment");
                var selectedNode = tree.get_selectedNode();
                if (selectedNode) {
                    selectedNode.scrollIntoView();
                }
            }
 
            function OnClientCategoryDropDownOpenedHandler(sender, eventArgs) {
                var tree = sender.get_items().getItem(0).findControl("trvCategory");
                var selectedNode = tree.get_selectedNode();
                if (selectedNode) {
                    selectedNode.scrollIntoView();
                }
            }
 
            function CloseAndRebind(args) {
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
            }
 
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
 
                return oWindow;
            }
 
            function CancelEdit() {
                GetRadWindow().close();
            }
        </script>
 
<%--        <asp:RadScriptManager ID="ScriptManager2" runat="server" />--%>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
 
            <AjaxSettings>
 
                <telerik:AjaxSetting AjaxControlID="cboAccount">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboSite" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboSite">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboLocation" />
                        <telerik:AjaxUpdatedControl ControlID="cboDepartment" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboDepartment">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboCategory" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboProductGroup">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboProduct" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboProduct">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboComponent" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboDepartment">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboCategory" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboCategory">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboCategory" />
                        <telerik:AjaxUpdatedControl ControlID="cboAssignedTo" />
                        <telerik:AjaxUpdatedControl ControlID="cboRiskPriority" />
                        <telerik:AjaxUpdatedControl ControlID="cboRisk" />
                        <telerik:AjaxUpdatedControl ControlID="cboPriority" />
                        <telerik:AjaxUpdatedControl ControlID="txtImpactLvl" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboRiskPriority">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cboPriority" />
                        <telerik:AjaxUpdatedControl ControlID="cboRisk" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboRisk">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="txtImpactLvl" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cboPriority">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="txtImpactLvl" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server"  Skin="Office2010Silver"
            DecoratedControls="All" />
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"></telerik:RadScriptManager>
        <asp:FormView ID="fvIncidentEdit" runat="server" DataKeyNames="IncidentID" GridLines="None"
            OnItemCommand="fvIncidentEdit_ItemCommand" Width="100%" Height="148px">
            <EditItemTemplate>
                <table class="IncDetails">
                    <tr>
                        <td colspan="4">
                            <asp:Label ID="lblSiteDetails" runat="server" Text="Site Details" CssClass="bold" />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblAccount" runat="server" Text="Account:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboAccount" runat="server" DataTextField="AccountName" DataValueField="AccountID" EnableLoadOnDemand="true" EmptyMessage="Select Account"
                                MarkFirstMatch="true" OnSelectedIndexChanged="cboAccount_SelectedIndexChanged" AllowCustomText="false" AutoPostBack="true">
                                 
                            </telerik:RadComboBox>
                             <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" InitialValue="- Search in -"
                        ControlToValidate="cboAccount" ValidationGroup="SearchFormValidationGroup"
                        ErrorMessage="Please select Account" CssClass="validator" />
                        </td>
                        <td>
                            <asp:Label ID="lblDepartment" runat="server" Text="Department:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboDepartment" runat="server" OnClientDropDownOpened="OnClientDepartmentDropDownOpenedHandler"
                                ExpandAnimation-Type="None" CollapseAnimation-Type="None" EmptyMessage="Select Department" AutoPostBack="true">
                                <ItemTemplate>
                                    <div id="divDepartment">
                                        <telerik:RadTreeView ID="trvDepartment" DataValueField="DepartmentID" runat="server" OnNodeClick="trvDepartment_NodeClick"  DataFieldID="DepartmentID" DataTextField="DepartmentName"
                                        DataFieldParentID="ParentDepartmentID" OnClientNodeClicking="DepartmentNodeClicking" Width="100%" Height="140px">
                                        </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                                <Items>
                                    <telerik:RadComboBoxItem Text=""></telerik:RadComboBoxItem>
                                </Items>
                            </telerik:RadComboBox>
                            <script type="text/javascript">
                                var div1 = document.getElementById("divDepartment");
                                div1.onclick = StopPropagation;
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblSite" runat="server" Text="Site:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboSite" runat="server" OnClientDropDownOpened="OnClientSiteDropDownOpenedHandler" ExpandAnimation-Type="None" CollapseAnimation-Type="None"
                                EmptyMessage="Select Site" AutoPostBack="true" >
                                <ItemTemplate>
                                    <div id="divSite">
                                        <telerik:RadTreeView ID="trvSite" DataValueField="SiteID" runat="server" OnNodeClick="trvSite_NodeClick" DataFieldID="SiteID" DataTextField="SiteName" DataFieldParentID="ParentSiteID"
                                            OnClientNodeClicking="SiteNodeClicking" Width="100%" Height="140px">
                                        </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                                <Items>
                                    <telerik:RadComboBoxItem Text=""></telerik:RadComboBoxItem>
                                </Items>
                            </telerik:RadComboBox>
                            <script type="text/javascript">
                                var div1 = document.getElementById("divSite");
                                div1.onclick = StopPropagation;
                            </script>
                        </td>
                        <td>
                            <asp:Label ID="lblLocation" runat="server" Text="Location:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboLocation" runat="server" OnClientDropDownOpened="OnClientLocationDropDownOpenedHandler" ExpandAnimation-Type="None" CollapseAnimation-Type="None" EmptyMessage="Select Location" AutoPostBack="true">
                                <ItemTemplate>
                                    <div id="divLocation">
                                        <telerik:RadTreeView ID="trvLocation" runat="server" DataFieldID="LocationID" DataValueField="LocationID" DataTextField="LocationName" DataFieldParentID="ParentLocationID" OnClientNodeClicking="LocationNodeClicking"
                                            Width="100%" Height="140px">
                                        </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                                <Items>
                                    <telerik:RadComboBoxItem Text=""></telerik:RadComboBoxItem>
                                </Items>
                            </telerik:RadComboBox>
                            <script type="text/javascript">
                                var div1 = document.getElementById("divLocation");
                                div1.onclick = StopPropagation;
                            </script>
                        </td>
                    </tr>
                </table>
                <table class="IncDetails">
                    <tr>
                        <td colspan="4">
                            <asp:Label ID="lblIncidentDetails" runat="server" Text="Incident Details" CssClass="bold" />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblCategory" runat="server" Text="Category:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboCategory" runat="server" OnClientDropDownOpened="OnClientCategoryDropDownOpenedHandler" ExpandAnimation-Type="None" CollapseAnimation-Type="None" EmptyMessage="Select Category">
                                <ItemTemplate>
                                    <div id="divCategory">
                                        <telerik:RadTreeView ID="trvCategory" runat="server" DataFieldID="QuestionCategoryID" DataTextField="QuestionCategoryName" DataValueField="CategoryValue" DataFieldParentID="ParentCategoryID"
                                            OnClientNodeClicking="CategoryNodeClicking" Width="100%" Height="140px" OnNodeDataBound="trvCategory_NodeDataBound" OnNodeClick="trvCategory_NodeClick" >
                                        </telerik:RadTreeView>
                                    </div>
                                </ItemTemplate>
                                <Items>
                                    <telerik:RadComboBoxItem Text=""></telerik:RadComboBoxItem>
                                </Items>
                            </telerik:RadComboBox>
                            <script type="text/javascript">
                                var div1 = document.getElementById("divCategory");
                                div1.onclick = StopPropagation;
                            </script>
                        </td>
                        <td class="LabelWidth">
                            <asp:Label ID="lblProductGroup" runat="server" Text="Product Group:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboProductGroup" runat="server" EnableLoadOnDemand="true" DataTextField="ProductGroupName" DataValueField="ProductGroupID" EmptyMessage="Select Product Group"
                                MarkFirstMatch="true" AllowCustomText="false" OnSelectedIndexChanged="cboProductGroup_SelectedIndexChanged" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblAffectedParty" runat="server" Text="Affected Party:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboAffectedParty" runat="server" EnableLoadOnDemand="true" DataTextField="AffectedPartyName" DataValueField="AffectedPartyID" EmptyMessage="Select Affected Party"
                                MarkFirstMatch="true" AllowCustomText="false">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            <asp:Label ID="lblProduct" runat="server" Text="Product:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboProduct" runat="server" EnableLoadOnDemand="true" DataTextField="ProductName" DataValueField="ProductID" EmptyMessage="Select Product" OnSelectedIndexChanged="cboProduct_SelectedIndexChanged"
                                MarkFirstMatch="true" AllowCustomText="false" >
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblIncidentSource" runat="server" Text="Incident Source:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboIncidentSource" runat="server" EnableLoadOnDemand="true"
                                DataTextField="IncidentSourceName" DataValueField="IncidentSourceID" EmptyMessage="Select Incident Source"
                                MarkFirstMatch="true" AllowCustomText="false">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            <asp:Label ID="lblComponent" runat="server" Text="Component:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboComponent" runat="server" EnableLoadOnDemand="true" DataTextField="ComponentName"
                                DataValueField="ComponentID" EmptyMessage="Select Component" MarkFirstMatch="true"
                                AllowCustomText="false" >
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblIncidentType" runat="server" Text="Incident Type:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboIncidentType" runat="server" EnableLoadOnDemand="true" DataTextField="IncidentTypeName" DataValueField="IncidentTypeID" EmptyMessage="Select Incident Type"
                                MarkFirstMatch="true" AllowCustomText="false">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            <asp:Label ID="lblProductRef" runat="server" Text="Product Reference:" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtProductRef" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblNonCon" runat="server" Text="Non Conformance Type:" />
                        </td>
                        <td colspan="3">
                            <telerik:RadComboBox ID="cboNonCon" runat="server" EnableLoadOnDemand="true" DataTextField="NonConformanceTypeName"
                                DataValueField="NonConformanceTypeID" EmptyMessage="Select Non Conformance" MarkFirstMatch="true"
                                AllowCustomText="false">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                </table>
                <table class="IncDetails">
                    <tr>
                        <td colspan="4">
                            <asp:Label ID="lblIncidentParties" runat="server" Text="Incident Parties" CssClass="bold" />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblLoggedBy" runat="server" Text="Logged By:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboLoggedBy" runat="server" DataTextField="FullName" DataValueField="IDWithSuffix"
                                EmptyMessage="Select Logger" EnableLoadOnDemand="true" AllowCustomText="false"
                                MarkFirstMatch="true" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            <asp:Label ID="lblConsumer" runat="server" Text="Consumer:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboConsumer" runat="server" EnableLoadOnDemand="true" DataTextField="FullName"
                                DataValueField="ConsumerID" EmptyMessage="Select Consumer" AllowCustomText="false"
                                MarkFirstMatch="true" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblAssignedTo" runat="server" Text="Assigned To:" />
                        </td>
                        <td colspan="3">
                            <telerik:RadComboBox ID="cboAssignedTo" runat="server" DataTextField="FullName" DataValueField="IDWithSuffix"
                                EmptyMessage="Select Assignee" EnableLoadOnDemand="true" AllowCustomText="false"
                                MarkFirstMatch="true" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:CheckBox ID="chkAllContacts" runat="server" Text="All Contacts" AutoPostBack="true" OnCheckedChanged="chkAllContacts_CheckedChanged" />
                        </td>
                    </tr>
                </table>
                <table class="IncDetails">
                    <tr>
                        <td colspan="4">
                            <asp:Label ID="lblProblemDefinition" runat="server" Text="Problem Definition" CssClass="bold" />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblIncidentTitle" runat="server" Text="Title" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboIncidentTitle" runat="server" DataTextField="IncidentTitleName" DataValueField="IncidentTitleID" EmptyMessage="Select Title" EnableLoadOnDemand="true"
                                AllowCustomText="false" MarkFirstMatch="true" AutoPostBack="true" >
                            </telerik:RadComboBox>
                        </td>
                        <td rowspan="2">
                            <asp:Label ID="lblComments" runat="server" Text="Comments:" />
                        </td>
                        <td rowspan="2">
                            <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblOtherTitle" runat="server" Text="Other Title:" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtOtherTitle" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblProblemDesc" runat="server" Text="Problem Description:" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtProblemDesc" runat="server" TextMode="MultiLine" />
                        </td>
                        <td>
                            <asp:Label ID="lblActionsReq" runat="server" Text="Actions Required:" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtActionsReq" runat="server" TextMode="MultiLine" />
                        </td>
                    </tr>
                </table>
                <table class="IncDetails">
                    <tr>
                        <td colspan="4">
                            <asp:Label ID="lblImpactDetails" runat="server" Text="Impact Details" CssClass="bold" />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblRiskPriorityType" runat="server" Text="Risk Priority Type:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboRiskPriorityType" runat="server" DataTextField="RiskPriorityTypeName"
                                DataValueField="RiskPriorityTypeID" EmptyMessage="Select Risk Priority" EnableLoadOnDemand="true"
                                AllowCustomText="false" MarkFirstMatch="true" OnSelectedIndexChanged="cboRiskPriorityType_SelectedIndexChanged" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            <asp:Label ID="lblPriority" runat="server" Text="Priority" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboPriority" runat="server" DataTextField="PriorityName"
                                DataValueField="PriorityID" EmptyMessage="Select Priority" EnableLoadOnDemand="true"
                                AllowCustomText="false" MarkFirstMatch="true" onselectedindexchanged="cboPriority_SelectedIndexChanged" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblImpactlvl" runat="server" Text="Impact Level:" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtImpactLvl" runat="server" AutoPostBack="true"
                                ReadOnly="True"/>
                        </td>
                        <td>
                            <asp:Label ID="lblRisk" runat="server" Text="Risk:" />
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboRisk" runat="server" DataTextField="RiskName" DataValueField="RiskID"
                                EmptyMessage="Select Risk" EnableLoadOnDemand="true" AllowCustomText="false"
                                MarkFirstMatch="true" AutoPostBack="true">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblJustification" runat="server" Text="Justification" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtJustification" runat="server" TextMode="MultiLine" />
                        </td>
                        <td>
                            <asp:Label Text="Attachment:" runat="server" ID="lblAttachment" />
                        </td>
                        <td>
                            <telerik:RadUpload ID="ruAttachment" runat="server">
                            </telerik:RadUpload>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label Text="Escalation Delayed:" runat="server" ID="lblEscalationDelayed" />
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtEscalationDelayed" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <br /> 
                            <asp:Button ID="btnUpdate" runat="server" onclick="btnSave_Click" Text="Save" OnClientClick = "return ValidateUsertwo();" />   
                             <asp:Button ID="btnClear" runat="server" Text="Clear"
                                onclick="btnClear_Click" />   
                             <asp:Button ID="btnClose" runat="server" Text="Close" />
                        </td>
                    </tr>
                </table>
            </EditItemTemplate>
        </asp:FormView>
    </div>
    </form>
      <div id="Popdiv" style="display:none">
                           <b>The email you entered is incorrect. Please try again!</b>
                                      </div>   
</body>
</html>

Tony
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 11 Feb 2016
25 answers
1.9K+ views

I have a weird issue that appears to have cropped up after switching from a regular RadGrid to the Prometheus Rad Grid (3.1425 release).  I have several check boxes in a template column and am using the automatic databinding:

<asp:CheckBox ID="PublicCheckBox" Checked='<%#Bind("IsPublic") %>' runat="server" />

This worked fine on the old grid.  But on the new Prometheus one I get the following error:

Conversion from type 'DBNull' to type 'Boolean' is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid.

Source Error:

Line 173:							<br />
Line 174:							Is Public?
Line 175: <asp:CheckBox ID="PublicCheckBox" Checked='<%#Bind("IsPublic") %>' runat="server" />Line 176:							<br />
Line 177:							Folder:


What's weird is that this only occurs when I try to insert a record.  Editing an existing record works fine.  There are a total of 3 Boolean columns in the database table ALL of which do NOT allow Null and have a default value of False (or 0).  Also this error occurs whether or not the grid is Ajaxified with the Prometheus RadAjaxManager.  Again, I'm using all automatic datasource operations and the datasource controls and the data is the same that worked just fine with the old Rad Grid.  Is there anything in the new grid that would cause this?

Thanks,

Jimmy

Angel Petrov
Telerik team
 answered on 11 Feb 2016
3 answers
423 views

In order to make my pages containing RadGrids more responsive, I load the page with no data and then retrieve the data in a postback.

This worked great until I tried running it with the latest Telerik UI controls (2016 Q1). Now, the remove_load does not seem to work, so the data is continually reloaded.

Any ideas?

The code on my aspx page is as follows:

<script type="text/javascript">
    function rebindGrid(clientid) {
        var grid = $find(clientid);
        if (grid == null)
            return;
        if (typeof (grid.get_masterTableView) != "function")
            return;
        var masterTable = grid.get_masterTableView();
        if (masterTable != null)
            masterTable.rebind();
    }
 
    function rebindPageGrid() {
        Sys.Application.remove_load(rebindPageGrid);
        rebindGrid("<%= AccountGrid.ClientID %>");
    }
 
    Sys.Application.add_load(rebindPageGrid);
</script>

The code behind looks like:

protected void OnAccountGridNeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    if (Page.IsPostBack)
    {
        AccountGrid.DataSource = GetAccountList();
        AccountGrid.MasterTableView.NoMasterRecordsText = "No records to display";
    }
    else
    {
        AccountGrid.DataSource = new List<Account>();
        AccountGrid.MasterTableView.NoMasterRecordsText = "Loading Data...";
    }
}

 

Maria Ilieva
Telerik team
 answered on 11 Feb 2016
2 answers
170 views

We are having problems with the way the command bar is displayed on a radgrid. The icons are in the wrong order and not displaying properly. I think this problem started when we updated Telerik to the latest version, but I'm not too sure.

Screenshot_1 shows how it looks on my machine in IE. (This is how it should look).

Screenshot_2 shows how it looks on my colleague's machine (on the same version of IE with same compatibility settings). This is also the way it looks in Chrome.

Radgrid code:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" OnBatchEditCommand="RadGrid1_BatchEditCommand"
    AutoGenerateColumns="False" DataSourceID="sqlReviewPlanner"  OnPreRender="RadGrid1_PreRender" OnDataBound="RadGrid1_DataBound">
    <MasterTableView DataSourceID="sqlReviewPlanner" DataKeyNames="ID" CommandItemDisplay="Top" EditMode="Batch"
        AutoGenerateColumns="false">
        <BatchEditingSettings EditType="Row" OpenEditingEvent="Click" />
        <SortExpressions>
            <telerik:GridSortExpression FieldName="ReviewNo" SortOrder="Ascending" />
        </SortExpressions>
        <Columns>
            <telerik:GridTemplateColumn DataField="ReviewNo" HeaderText="No." UniqueName="ReviewNo" SortExpression="ReviewNo" DataType="System.Int32">
                <HeaderStyle Width="60px" />
                <ItemTemplate><%# Eval("ReviewNo") %></ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtReviewNo" runat="server" Value='<%# Bind( "ReviewNo") %>' Type="Number"
                        ShowSpinButtons="true" MinValue="0" MaxValue="50" Width="50px" NumberFormat-DecimalDigits="0">
                    </telerik:RadNumericTextBox>
                    <asp:RequiredFieldValidator ID="valReviewNo" runat="server" ErrorMessage="*Required" ControlToValidate="txtReviewNo"></asp:RequiredFieldValidator>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ReviewDate" DataType="System.DateTime" FilterControlAltText="Filter ReviewDate column" HeaderText="Plan Date" SortExpression="ReviewDate" UniqueName="ReviewDate">
                <HeaderStyle Width="125px" />
                <EditItemTemplate>
                    <telerik:RadDatePicker ID="ReviewDateRadDatePicker" runat="server" DbSelectedDate='<%# Bind("ReviewDate") %>' Width="110px">
                    </telerik:RadDatePicker>
                    <asp:RequiredFieldValidator ID="valReviewDateRadDatePicker" runat="server" ErrorMessage="*Required" ControlToValidate="ReviewDateRadDatePicker"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="ReviewDateLabel" runat="server" Text='<%# Eval("ReviewDate","{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Reviewer" UniqueName="ReviewOwner" DataField="ReviewOwner">
                <ItemTemplate>
                    <%# Eval("ReviewOwnerName") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox runat="server" ID="drpReviewOwner" DataValueField="staffcode"
                        DataTextField="staff" DataSourceID="SqlReviewOwner" Filter="Contains">
                    </telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="valReviewOwner" runat="server" ErrorMessage="*Required" ControlToValidate="drpReviewOwner"></asp:RequiredFieldValidator>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Status" UniqueName="ReviewStatus" DataField="ReviewStatus">
                <ItemTemplate>
                    <%# Eval("ReviewStatusDescription") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox runat="server" ID="drpReviewStatus" DataValueField="Id"
                        DataTextField="Description" DataSourceID="SqlReviewStatus" Filter="Contains">
                    </telerik:RadComboBox>
                    <%--<asp:RequiredFieldValidator ID="valReviewStatus" runat="server" ErrorMessage="*Required"
                        ControlToValidate="drpReviewStatus"></asp:RequiredFieldValidator>--%>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ReviewStatusDate" DataType="System.DateTime" FilterControlAltText="Filter ReviewStatusDate column" HeaderText="Status Date" SortExpression="ReviewStatusDate" UniqueName="ReviewStatusDate">
                <HeaderStyle Width="125px" />
                <EditItemTemplate>
                    <telerik:RadDatePicker ID="ReviewStatusDateRadDatePicker" runat="server" DbSelectedDate='<%# Bind("ReviewStatusDate") %>' Width="110px">
                    </telerik:RadDatePicker>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="ReviewStatusDateLabel" runat="server" Text='<%# Eval("ReviewStatusDate","{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Comments" HeaderText="Comments">
                <ItemTemplate><%# Eval("Comments") %></ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadTextBox ID="txtComments" runat="server" Text='<%# Bind( "Comments") %>'
                        Columns="30" Rows="3" TextMode="MultiLine">
                    </telerik:RadTextBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn ConfirmText="Delete this Review?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" HeaderText="Delete"
                HeaderStyle-Width="50px" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
        </Columns>
        <CommandItemStyle />
        <CommandItemSettings AddNewRecordText="Add New Review" AddNewRecordImageUrl="../assets/img/plus32.png" RefreshImageUrl="../assets/img/refresh32.png" />
    </MasterTableView>
</telerik:RadGrid>

 

CSS file for icons:

 

#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_InitInsertButton,
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_CancelChangesButton,
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_CancelChangesButton,
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_SaveChangesButton,
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_SaveChangesButton,
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_RebindGridButton,
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_RebindGridButton {
    font-size: 12pt;
}
 
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_SaveChangesIcon
    {
    background-image:url("https://staff.oldham.ac.uk/assets/img/save32.png");
    background-position:center;
    width:32px;
    height:32px;
    }
 
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_SaveChangesIcon
    {
    background-image:url("https://staff.oldham.ac.uk/assets/img/save32.png");
    background-position:center;
    width:32px;
    height:32px;
    }
 
 
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_CancelChangesIcon
    {
    background-position:center;
    width:32px;
    height:32px;
    }
 
#ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_CancelChangesIcon
    {
    background-position:center;
    width:32px;
    height:32px;
    }

Kostadin
Telerik team
 answered on 11 Feb 2016
3 answers
206 views

Hello!

I'm testing telerik:RadGrid control..

I would like to use picture (if it exists) on server. If file doesn't exists i would like to use "default_image.jpg". I suppose have to use RadGrid1_ItemDataBound but don't know how?

Right now fixing DataImageUrlFields="Artikal_ID" DataImageUrlFormatString="IMG/{0}_tiny.jpg" work without problem, but don't know to test File.Exists and use correct value.

Any advice?

Now have something like this:

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GroupPanelPosition="Top" PageSize="20" AllowSorting="True" AllowPaging="True" OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound">
    <ExportSettings>
        <Pdf PageWidth="">
        </Pdf>
 
    </ExportSettings>
    <MasterTableView NoMasterRecordsText="Molimo odaberite kategoriju." AllowMultiColumnSorting="True">
        <Columns>
            <telerik:GridBoundColumn DataField="Artikal_ID" FilterControlAltText="Filter Artikal_ID column" HeaderText="Å ifra artikla" ReadOnly="True" SortExpression="Artikal_ID" UniqueName="Artikal_ID">
 
                <ColumnValidationSettings>
                    <ModelErrorMessage Text=""></ModelErrorMessage>
                </ColumnValidationSettings>
 
            </telerik:GridBoundColumn>
 
            <telerik:GridImageColumn DataImageUrlFields="Artikal_ID" DataImageUrlFormatString="IMG/{0}_tiny.jpg" AlternateText="" DataAlternateTextField="Artikal"
                ImageAlign="Middle" ImageWidth="60px" HeaderText="" HeaderButtonType="None">
                <ItemStyle CssClass="RadGrid" Height="80px" HorizontalAlign="Center" VerticalAlign="Middle" />
            </telerik:GridImageColumn>

 

 

Eyup
Telerik team
 answered on 11 Feb 2016
1 answer
156 views

I've been trying to get my numeric values to be displayed in the following format:   14.000.000,99 instead of 14,000,000.99.

I have not been able to figure this out for the life of me.  I've tried many different methods of masks and column types, but the solution is evading me.

 Any help would be appreciated.

 

Dennis

Eyup
Telerik team
 answered on 11 Feb 2016
1 answer
571 views

Hi,

I am trying to apply conditional formatting on my RadGrid row when the value of a column is true for external action. For this I am setting the CssStyle for the GridDataItem in the code behind to new style as below, as shown in the example in this link:

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/appearance-and-styling/conditional-formatting

 .aspx

    <style type="text/css">
             body div.RadGrid_Office2007 .rgFollowUpRow { background-color: red;      
  }

 code-behind:

  e.Item.CssClass = "rgFollowUpRow";

But, after this style is applied the row loses its original style and so grid lines disappear, and row losses its padding too, as shown in the attachment. Can anyone please let me know what is that I am missing here in applying this custom style to the grid row?

 

Thanks in advance,

Lax

    

Eyup
Telerik team
 answered on 11 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?