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

I am using a RadGrid and when the grid populates I would like to use alternate row colour depending on the values of the Works Order number if the previous value is the same as the current row value. For example, I have the following rows below. I would like the row colour with WO 11222 to be "rgRow" and the WO with 45874 to be row colour "rgAltRow" then back to rgRow  for the next WO. So I basically want the alternate row colour to work on change of WO number.

Is there a way to achieve this please?

WO      Qty   Part

11222     3     XYZ

11222     4     XYZ

45874    1     UYH

45874   3     UYH

Doncho
Telerik team
 answered on 15 May 2023
2 answers
489 views

Hi,

I was very pleased to see the addition of the RadSignature-control to the Telerik UI for ASP-NET AJAX suite, however there are some functionalities, which we would require to properly make use of this control.

  1. If one wants to read the resulting signature server-side (after a button-click / form submission), one kind of has to work with a lot of javascript and hidden input fields to transfer the base64-encoded png towards the server. It would be way nicer, if you could provide the content of the signature as a server-side property of the RadSignature-control (during post-back).
  2. Relating to 1.: I've managed to use the client-event OnChange to write a hidden field each time the signature changes, but there's no event to hook in case of a reset; therefore I cannot detect resets to reset the value of the hidden field. (And let's just say, it's infeasible to us to read the signature-content on form submission because of dynamically generated controls.) Thus I cannot use the built-in reset button, but I would have to implement it myself to be able to reset the hidden field and the signature-control at the same time (using the js-method "reset" of the kendo widget).
  3. If one opens a dialog/window containing a RadSignature-control and resizes the dialog (e.g. make it twice as large) then the position of the cursor on the canvas does not match the position of the strokes anymore. Painting in the top-left corner is sort of okay/close, but the further one moves the cursor towards the bottom-right, the bigger the offset will be.
  4. It would be great, if the control would provide functionality to validate for mandatory user input. I.e. I (as a developer) don't want to have to memorize/manage a variable focusedSignatureDefaultContent (c.f. docs for RadSignature) for each RadSignature-control I want to put on a page. Best case, the RadSignature control manages this data for me and I can either read a boolean to determine if its contents have changed (client- and especially server-side).

And some other bugs, I've stumbled upon (- which are not as relevant to us):

  • If you paint a stroke on the canvas, then "maximize" the RadSignature-control (effectively zooming in on the control) and then paint a second stroke, you'll see that those strokes will have a different line width; the second one being bigger.
  • If you repeatedly maximize/minimize the RadSignature control and draw a stroke each time on the bottom of the canvas, then the resulting image will get distorted.

If you need any further information on any of those topics, feel free to ask.

Kind regards,
Matthias

Matthias
Top achievements
Rank 2
Iron
 answered on 15 May 2023
0 answers
116 views

RadNotification seemingly does not have focus trap

Am i missing something?

David
Top achievements
Rank 1
Iron
Iron
Veteran
 asked on 11 May 2023
1 answer
201 views
How to show the filter check list item for a datetime column as like excel. Like the Attached image below.
Doncho
Telerik team
 answered on 11 May 2023
0 answers
113 views

I saw this post: Hide XAxis Labels in UI for ASP.NET AJAX | Telerik Forums

And I would like to use the OnBeforeLayout server event for my project. But I couldn't find it in documentation. Where is this event now? Did telerik team rename it or just remove it?

Could someone tell me?

Thanks.

yuki
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 10 May 2023
1 answer
226 views

Why am I getting "RadGrid1 is not declared" ?

Running VS2019, Telerik version: 2022.3.1109.45 



ASPX page
---------------------------------------------------------------------------------------------------------------------------------------

<%@ Page Language="vb" AutoEventWireup="true" CodeFile="PriorityLists.aspx.vb" Inherits="WebApp.TDAPInterface.PriorityLists" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Priority Lists</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #demo {
            width: 891px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="false" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadFormDecorator RenderMode="Lightweight" runat="server" DecorationZoneID="demo" EnableRoundedCorners="false" DecoratedControls="All" />
<div id="demo" class="demo-container no-bg">
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" DataSourceID="TDAPConnectionString"
AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
AllowAutomaticDeletes="True" AllowSorting="True"
OnItemInserted="RadGrid1_ItemInserted" OnPreRender="RadGrid1_PreRender" OnInsertCommand="RadGrid1_InsertCommand" AutoGenerateEditColumn="True" Width="893px" OnItemDataBound="RadGrid1_ItemDataBound" Skin="Office2010Black">
<PagerStyle Mode="NextPrevAndNumeric" />
<GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>

<ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>

<MasterTableView DataSourceID="TDAPConnectionString" AutoGenerateColumns="False"
DataKeyNames="PriorityListId" CommandItemDisplay="Top">

<CommandItemTemplate>
<asp:Button ID="Button1" Text="Display Prioritizion for Selected Row" runat="server" OnClick="Button1_Click" CssClass="rgAdd">
</asp:Button>

<asp:Button ID="btnAdd" Text="Add New Priority List" runat="server" CommandName="InitInsert" CssClass="rgAdd" />
</CommandItemTemplate>   

<RowIndicatorColumn ShowNoSortIcon="False" Visible="False">
    <HeaderStyle Width="41px" />
                </RowIndicatorColumn>

<ExpandCollapseColumn ShowNoSortIcon="False">
    <HeaderStyle Width="41px" />
                </ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="PriorityListId" HeaderText="Priority List Id" SortExpression="PriorityListId"
UniqueName="PriorityListId" DataType="System.Int32" FilterControlAltText="Filter PriorityListId column" ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="PriorityTitle" HeaderText="Priority Title" SortExpression="PriorityTitle"
UniqueName="PriorityTitle" FilterControlAltText="Filter PriorityTitle column">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SiteIdNumber" HeaderText="Site IdNumber" SortExpression="SiteIdNumber"
UniqueName="SiteIdNumber" FilterControlAltText="Filter SiteIdNumber column" Visible="False">
</telerik:GridBoundColumn>
</Columns>

<EditFormSettings>
<EditColumn ShowNoSortIcon="False" UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
</EditFormSettings>
</MasterTableView>

<FilterMenu RenderMode="Lightweight"></FilterMenu>

<HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu>
</telerik:RadGrid>
    <asp:SqlDataSource ID="TDAPConnectionString" runat="server" ConnectionString="<%$ ConnectionStrings:TDAPConnectionString %>" DeleteCommand="DELETE FROM [Submission_PriorityLists] WHERE [PriorityListId] = @PriorityListId" InsertCommand="INSERT INTO [Submission_PriorityLists] ([PriorityTitle], [SiteIdNumber]) VALUES (@PriorityTitle, @SiteIdNumber)" SelectCommand="SELECT * FROM [Submission_PriorityLists] ORDER BY [PriorityTitle]" UpdateCommand="UPDATE [Submission_PriorityLists] SET [PriorityTitle] = @PriorityTitle, [SiteIdNumber] = @SiteIdNumber WHERE [PriorityListId] = @PriorityListId">
            <DeleteParameters>
                <asp:Parameter Name="PriorityListId" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="PriorityTitle" Type="String" />
                <asp:Parameter Name="SiteIdNumber" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="PriorityTitle" Type="String" />
                <asp:Parameter Name="SiteIdNumber" Type="String" />
                <asp:Parameter Name="PriorityListId" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
</div>
    </form>
</body>
</html>


VB Codebehind
------------------------------------------------------------------------------------------------------------------------------------------

Imports System
Imports System.Collections
Imports System.Web.UI
Imports Telerik.Web.UI
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Data.Common
Imports System.Linq
Imports System.Text
Imports System.Reflection
Imports System.Data.SqlClient


Namespace TDAPInterface

    Partial Class PriorityLists
        Inherits System.Web.UI.Page

        Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
                If Not (TypeOf e.Item Is GridEditFormInsertItem) Then
                    Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
                    Dim manager As GridEditManager = item.EditManager
                    Dim editor As GridTextBoxColumnEditor = TryCast(manager.GetColumnEditor("PriorityListId"), GridTextBoxColumnEditor)
                    editor.TextBoxControl.Enabled = False
                End If
            End If
        End Sub

        Protected Sub RadGrid1_ItemInserted(source As Object, e As GridInsertedEventArgs) Handles RadGrid1.ItemInserted

            If e.Exception IsNot Nothing Then

                e.ExceptionHandled = True

                SetMessage("Priority List cannot be inserted. Reason: " + e.Exception.Message)
            Else
                SetMessage("New Priority List is inserted!")
            End If
        End Sub

        Private Sub DisplayMessage(text As String)
            RadGrid1.Controls.Add(New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text)))
        End Sub

        Private Sub SetMessage(message As String)
            gridMessage = message
        End Sub

        Private gridMessage As String = Nothing

        Protected Sub RadGrid1_PreRender(sender As Object, e As EventArgs) Handles RadGrid1.PreRender
            RadGrid1.MasterTableView.GetColumn("PriorityListId").Visible = False
            RadGrid1.Rebind()

            If Not String.IsNullOrEmpty(gridMessage) Then
                DisplayMessage(gridMessage)
            End If
        End Sub

        Protected Sub RadGrid1_InsertCommand(sender As Object, e As GridCommandEventArgs)
            If TypeOf e.Item Is GridEditableItem Then
                Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
                'here editedItem.SavedOldValues will be the dictionary which holds the
                'predefined values

                'Prepare new dictionary object
                Dim newValues As New Hashtable()
                'the newValues instance is the new collection of key -> value pairs
                'with the updated ny the user data
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
            End If
        End Sub

        Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
            If TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode Then
                Dim eitem As GridEditableItem = CType(e.Item, GridEditableItem)
                eitem("SiteIdNumber").Visible = False    ' for making the cell invisible during editing
                eitem("SiteIdNumber").Parent.Visible = False ' for making its label also invisible

            End If
        End Sub

        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim id As String = "0"
            Dim dataItem As GridDataItem
            For Each dataItem In RadGrid1.SelectedItems
                Dim index As Integer = dataItem.ItemIndex ' Get Row Index
                id = dataItem.GetDataKeyValue("PriorityListId").ToString() 'Accessing the datakey value
            Next
            If id = "0" Then
                SetMessage("Select a row!")
            End If
        End Sub

    End Class
End Namespace
Ross
Top achievements
Rank 1
Iron
 answered on 09 May 2023
0 answers
146 views

I want to use the Radeditor to edit HTML data.  However, I have a special image editor that I want to execute when the user double clicks on certain images in the document.  Is this possible with Radeditor?  Can I execute Javascript in the editor?

Thanks,

Arthur

Arthur
Top achievements
Rank 1
 asked on 09 May 2023
0 answers
139 views

Dear Telerik Team,

We have purchased Telerik UI for ASP.NET AJAX UI 2010.1519. Now we are facing vulnerable issues as it is using jQuery 1.4.2.

One of the Telerik doc tells that

When Telerik upgraded jQuery version to 3.3.1, it faces incompatibilities with the MS AJAX framework and its __doPostBack() method. Due to which, Telerik downgraded jQuery version Telerik UI for ASP.NET AJAX R1 2019 - present are using a modified jQuery version 1.12.4 that includes security vulnerability backport fixes.

Is there a fix to overcome this issue other than upgrading the Telerik version to 2019 or greater?

1 answer
144 views

I would like to add a hyper link to the node of an Org Chart, and I tried to add like:


<telerik:RadOrgChart>
<ItemTemplate>
<div class="abc">
<a herf="abc.abc">test link</a>
But it won't work. The hyperlink is not even clickable. Can anyone tell me how to add hyperlink to OrgChart?
yuki
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 08 May 2023
0 answers
119 views
As described in the titel, could someone give me some suggestions? Much appreciated.
yuki
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 08 May 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?