Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
226 views
Helllo, I would like the radwindow to stay on top of the form when selecting the "Select" button inside the combobox. The Select button does some server side work. The Reprocess button it will also do server side work. The only time the radwindow will close is when pressing the Close button.   For the 'Select' Button I could replace the code with javascript but I'm not sure how to go about it.  Below is my sample code 
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Linq.aspx.vb" Inherits="CreatePAth.Linq" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function stopPostBack() {
                return true;
            }


            function openAssayErrors() {
                var wnd = $find("<%=winAssayErrors.ClientID%>");
                wnd.show();
                return false;
            }
            function closeAssayErrors() {
                var wnd = $find("<%=winAssayErrors.ClientID%>");
                wnd.close();
                return false;
            }

            function RefreshParentPage() {
                document.location.reload();
            }
            function stopPostback() {
                return true;
            }
        </script>
    </telerik:RadCodeBlock>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnCloseWinx">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnSelectComment">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="btnSelectComment" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="bAssayErrors">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="bAssayErrors" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid ID="RadGrid1" AllowAutomaticUpdates="True"
                RenderMode="Lightweight" runat="server" AllowSorting="True" ShowStatusBar="true" AutoGenerateColumns="False"
                EnableHeaderContextMenu="True"
                Height="220"
                ViewStateMode="Enabled"
                EnableViewState="true">
                <ClientSettings>
                    <Scrolling AllowScroll="true" FrozenColumnsCount="14" SaveScrollPosition="true" UseStaticHeaders="true" />
                </ClientSettings>
                <MasterTableView HeaderStyle-ForeColor="White" EnableColumnsViewState="false" AllowAutomaticUpdates="true" AllowSorting="True" EnableLinqGrouping="False" GroupsDefaultExpanded="False" Width="100%" TableLayout="fixed" DataKeyNames="Item, ErrorSamples">
                    <Columns>
                        <telerik:GridBoundColumn DataField="Item" FilterControlAltText="Item" HeaderText="Item" UniqueName="Item" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="150px" HeaderText="Error Samples" DataField="ErrorSamples" UniqueName="ErrorSamples">
                            <ItemTemplate>
                                <telerik:RadButton ID="bAssayErrors" ButtonType="LinkButton" Width="80px" AutoPostBack="true" OnClientClicked="openAssayErrors" CommandName="SelectAssayErrors" runat="server" Text='<%# Eval("ErrorSamples") %>'></telerik:RadButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

            <div>
                <asp:Label ID="lblmessage" runat="server" Text=""></asp:Label>
            </div>
            <telerik:RadWindow ID="winAssayErrors" runat="server" Modal="true" VisibleTitlebar="True" VisibleStatusbar="false"
                ReloadOnShow="true"
                ShowContentDuringLoad="false"
                Width="950px" Height="500px"
                Title="List by Assay" Style="z-index: 100001;">
                <ContentTemplate>
                    <div>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblAssayName" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <telerik:RadGrid ID="rgAssays" AllowAutomaticUpdates="True"
                                        RenderMode="Lightweight" Skin="Default" runat="server" AllowSorting="True" ShowStatusBar="true" AutoGenerateColumns="False" OnItemDataBound="rgAssays_ItemDataBound" OnItemCommand="rgAssays_ItemCommand"
                                        EnableHeaderContextMenu="True"
                                        Height="220px"
                                        Width="900px"
                                        ViewStateMode="Enabled"
                                        EnableViewState="true">
                                        <ClientSettings>
                                            <Scrolling AllowScroll="true" FrozenColumnsCount="14" SaveScrollPosition="true" UseStaticHeaders="true" />
                                        </ClientSettings>
                                        <MasterTableView HeaderStyle-BackColor="" EnableColumnsViewState="false" AllowAutomaticUpdates="true"
                                            AllowSorting="True" EnableLinqGrouping="False" GroupsDefaultExpanded="False" Width="100%" TableLayout="fixed" ShowFooter="true"
                                            DataKeyNames="AssayName,  NoSamples, OKSamples">
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="AssayName" FilterControlAltText="AssayID" HeaderText="AssayName" UniqueName="AssayName" AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="NoSamples" FilterControlAltText="NoSamples" Display="true" HeaderText="# Samples" UniqueName="NoSamples" AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="OKSamples" FilterControlAltText="OKSamples" HeaderText="Ok Samples" UniqueName="OKSamples" ReadOnly="true">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Comments" FilterControlAltText="Comments" HeaderText="Comments" UniqueName="Comments" ReadOnly="true">
                                                </telerik:GridBoundColumn>

                                                <telerik:GridTemplateColumn HeaderStyle-Width="150px" HeaderText="Reprocess" DataField="Reprocess" UniqueName="Reprocess">
                                                    <ItemTemplate>
                                                        <telerik:RadCheckBox ID="chkReprocess" AutoPostBack="false" Width="80px" runat="server"></telerik:RadCheckBox>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderStyle-Width="250px" HeaderText="RPNote" DataField="RPNote" UniqueName="RPNote">
                                                    <ItemTemplate>
                                                        <telerik:RadComboBox runat="server" ID="cbRPNote" Height="300px" Width="100px "
                                                            DropDownWidth="500"
                                                            ViewStateMode="Enabled"
                                                            MarkFirstMatch="true"
                                                            HighlightTemplatedItems="True"
                                                            EmptyMessage="select"
                                                            CheckBoxes="false"
                                                            AllowCustomText="false"
                                                            Style="z-index: 200001;">
                                                            <HeaderTemplate>
                                                                <table style="width: 500px; text-align: left">
                                                                    <tr>
                                                                        <td style="width: 50px;">ID</td>
                                                                        <td style="width: 200px;">Spec. Comments</td>
                                                                        <td style="width: 200px;">User Comments</td>
                                                                        <td style="width: 80px;"></td>
                                                                    </tr>
                                                                </table>
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <table style="width: 550px; text-align: left; float: right;">
                                                                    <tr>
                                                                        <td style="width: 50px;">
                                                                            <asp:Label ID="Rejection_ID" runat="server" Text='<%# Eval("Rejection_ID") %>'></asp:Label>
                                                                        </td>
                                                                        <td style="width: 200px;">
                                                                            <asp:Label ID="Txt_Description" runat="server" Text='<%# Eval("Txt_Description") %>'></asp:Label>
                                                                        </td>
                                                                        <td style="width: 200px;">
                                                                            <asp:TextBox ID="txt_RPNote" runat="server" Text=""></asp:TextBox>
                                                                        </td>
                                                                        <td style="width: 80px;">
                                                                            <telerik:RadButton ID="btnSelectComment" OnClick="btnSelectComment_Click" runat="server" Text="Select"></telerik:RadButton>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </ItemTemplate>
                                                        </telerik:RadComboBox>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text=" Do Server stuff and return.... "></asp:Label>
                                                        <telerik:RadButton ID="imRP" runat="server" Text="Reprocess" OnClick="imRP_Click" CommandName="Reprocess"></telerik:RadButton>
                                                        <telerik:RadButton ID="btnCloseWinx" runat="server" Text="Close"></telerik:RadButton>

                                                    </FooterTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                </td>
                            </tr>
                        </table>
                    </div>
                </ContentTemplate>
            </telerik:RadWindow>

        </div>
    </form>
</body>
</html>



Imports Telerik.Web.UI

Public Class Linq
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = False Then
            Dim AssysGroup = New List(Of Assays) _
        From {New Assays With {.AssayName = "C6", .NoSamples = "12", .OKSamples = "1", .Comments = "OK", .Reprocess = True},
                New Assays With {.AssayName = "Crtert", .NoSamples = "5", .OKSamples = "2", .Comments = "OK", .Reprocess = False},
                New Assays With {.AssayName = "POWEB", .NoSamples = "2", .OKSamples = "1", .Comments = "OK", .Reprocess = False},
                New Assays With {.AssayName = "POWELISA", .NoSamples = "4", .OKSamples = "0", .Comments = "fds", .Reprocess = False},
                New Assays With {.AssayName = "CTT", .NoSamples = "3", .OKSamples = "0", .Comments = "", .Reprocess = False},
                New Assays With {.AssayName = "POWEA", .NoSamples = "5", .OKSamples = "1", .Comments = "", .Reprocess = False}}
            rgAssays.DataSource = AssysGroup
            rgAssays.DataBind()

            Dim MainGrid = New List(Of sItems) _
             From {New sItems With {.Item = "AAA", .ErrorSamples = 10},
                New sItems With {.Item = "BBB", .ErrorSamples = 12},
                New sItems With {.Item = "CCC", .ErrorSamples = 0},
                New sItems With {.Item = "DDD", .ErrorSamples = 0}}
            RadGrid1.DataSource = MainGrid
            RadGrid1.DataBind()
        End If

    End Sub

    Private Class Assays
        Property AssayID As String
        Property AssayName As String
        Property NoSamples As String
        Property OKSamples As String
        Property Comments As String
        Property Reprocess As Boolean


    End Class


    Private Class sItems
        Property Item As String
        Property ErrorSamples As String

    End Class

    Protected Sub rgAssays_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
        If TypeOf e.Item Is GridDataItem Then
            Dim gridItem As GridDataItem = TryCast(e.Item, GridDataItem)
            Dim dt As DataTable = New DataTable()
            Dim combo As RadComboBox
            combo = gridItem.FindControl("cbRPNote")
            dt.Columns.Add("Rejection_ID", GetType(Integer))
            dt.Columns.Add("Txt_Description", GetType(String))
            dt.Columns.Add("txt_RPNote", GetType(String))
            dt.Rows.Add(1, "Not enough solution", "")
            dt.Rows.Add(2, "Positve Result", "")
            dt.Rows.Add(3, "Damage Specimen", "")
            dt.Rows.Add(4, "Equipment failute", "")
            dt.Rows.Add(5, "User mistake", "")
            combo.DataTextField = "Txt_Description"
            combo.DataValueField = "Rejection_ID"
            combo.DataSource = dt
            combo.DataBind()
        End If
    End Sub

    Protected Sub rgRPNote_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs)
        Dim val As String = e.Text
    End Sub

    Protected Sub btnSelectComment_Click(sender As Object, e As EventArgs)
        Dim button As RadButton = CType(sender, RadButton)
        Dim s As String = CType(button.NamingContainer.FindControl("Txt_Description"), Label).Text
        Dim s1 As String = CType(button.NamingContainer.FindControl("txt_RPNote"), TextBox).Text
        CType(button.NamingContainer.Parent, RadComboBox).Text = s1
    End Sub


    Protected Sub imRP_Click(sender As Object, e As EventArgs)
        For Each item As GridDataItem In rgAssays.Items
            Dim chkRP As RadCheckBox = CType(item.FindControl("chkReprocess"), RadCheckBox)
            If chkRP.Checked = False Then
                lblmessage.Text = "Please Enter an RPNote for Items to be reprocess"
                lblmessage.Focus()
                Exit Sub
            End If
            If CType(item.FindControl("cbRPNote"), RadComboBox).Text.Length > 0 Then
                Dim s As String = "yea doing long background work"
            End If
        Next
    End Sub


End Class

Doncho
Telerik team
 answered on 20 Oct 2022
1 answer
118 views

Hi,

I have a client who wants to make the drag & drop functionality to be more prominent.  Namely the dotted line that appears on the target to indicate where it's going to be dropped.  What's the name of this style so I can modify it, please?

 

 

Doncho
Telerik team
 answered on 20 Oct 2022
1 answer
194 views
Is there any way I can work around ASP.NET AJAX RadChat control not having a setting for changing the single line input textbox (class=t-input) for message into a multi line textarea?
Rumen
Telerik team
 answered on 18 Oct 2022
1 answer
955 views

We switched from using your DLLs directly to pulling from Nuget.

We were originally targeting the .NET Framework version of your libraries and planned to continue to do so.

However in the conversion it was realized that Telerik.Web.Spreadsheet is only available as Standard in your Nuget. Therefore due to this ONE missing library I had to convert everything to Standard.

This was fine until we realized that Standard isn't capable of embedding subset fonts into PDFs like Framework, leading to larger files.

I attempted to do a mix of the two and failed but I'd really rather not do that anyway.

Could you please properly update your Nuget to include the Framework version of Telerik.Web.Spreadsheet? I know it exists because I used it before moving to Nuget.

Thank you

Attila Antal
Telerik team
 updated answer on 18 Oct 2022
10 answers
596 views
hi, 
i am using multiple line  radtextbox in many user control on my project . enter key is not working with radtextbox in some user controls . 
Sathish
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 17 Oct 2022
0 answers
136 views

I have a RadTabStrip and I will have a button to export which downloads it in excel (x.xlsx), I want to change the name that the file shows me by default when it is downloaded. asp framework

Attila Antal
Telerik team
 updated question on 14 Oct 2022
0 answers
138 views

Hi Team,

Is is possible to figure out captcha isvalid property set to false due to maxtimeout property even though correct input provided and display different error message

shaili
Top achievements
Rank 1
 asked on 13 Oct 2022
6 answers
904 views
Hello,

I have tried to set the text property in code-behind to "\n", Environment.Newline, Server.HtmlDecode("Carriage&#13;&#10;return");
and "<br />" but nothing has created multiline text on RadButton. My searching for answers has also found the aspx
templating : 
<
ContentTemplate>
        <span>RadButton Content</span><br />
<span>RadButton Content2</span>
 </ContentTemplate>
but even this is not giving me multiple lines.
Is there any other workaround for this ?

Martin

Doncho
Telerik team
 updated answer on 13 Oct 2022
1 answer
253 views

Hello,

Is it possible to put Aggregate="sum" on the header as on the screenshot below?

I'm able to do it on the footer. I would like to also show it on the header.

Regards,

Nicolas

Doncho
Telerik team
 answered on 13 Oct 2022
1 answer
135 views
Hello,

I would like to know the smallest way to change an image to text when exporting to excel.

My column is of type GridTemplateColumn with a literal object carrying the image, as in the example below, inside an ItemDataBound.

  If CBool(e.Item.DataItem("Read")) = True Then
                 litStatus.Text = "<i Class=""fa fa-envelope-open-o fa-2x"" title=""Read""></i>"
             Else
                 litStatus.Text = "<i Class=""fa fa-envelope-o fa-2x"" title=""Unread""></i>"
             End If

Thank you very much in advance
Attila Antal
Telerik team
 answered on 13 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?