Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
87 views
Hi!

I have many user and each one must create different excel styles. 

by example and the most important elements:
Name of columns.
Order of columns.
Filters.

I would like to save a configuration by each user with that elements. It's that possible?


regards
Eyup
Telerik team
 answered on 11 Sep 2017
0 answers
150 views

i have a plain page with raddatepicker, but upon click it shows only # on the url and no calendar pop up.

See image below.

Thanks

Tomas
Top achievements
Rank 1
 asked on 09 Sep 2017
0 answers
193 views

I have seen other postings about Ajax messing up controls that are exporting to excel but I am not sure what to do since the entire user control has been ajaxified.  

I have a web page that has a user control:

<telerik:RadAjaxManagerProxy ID="ramPackingSlip" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ramPackingSlip">
                <UpdatedControls>         
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                    <telerik:AjaxUpdatedControl ControlID="lblPageHeading" />
                    <telerik:AjaxUpdatedControl ControlID="pnlButtons" /
                    <telerik:AjaxUpdatedControl ControlID="ucPackSlipItemPickListInfo" />
                </UpdatedControls>
            </telerik:AjaxSetting>                    
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

 

In the user control there is a grid and a button that I am using to export the grid contents to Excel:

Button to Export To Excel:

  <asp:ImageButton ID="btnExcel" runat="server" ImageUrl="~/Images/ExportToExcel_up.png"
                                    onmouseover="this.src='../images/ExportToExcel_ovr.png'" onmouseout="this.src='../images/ExportToExcel_up.png'"
                                    OnClick="ibExportToExcel_Click" AlternateText="Xlsx" />

Button code behind:

 protected void ibExportToExcel_Click(object sender, EventArgs e)
        {   string joinInfo = string.Empty;
            string extraInfo = string.Empty;

            rgToolSelection.Rebind();

            rgToolSelection.ExportSettings.OpenInNewWindow = true;
            rgToolSelection.ExportSettings.ExportOnlyData = true;
            rgToolSelection.ExportSettings.FileName = "RadGridExport";

            rgToolSelection.MasterTableView.ExportToExcel();

        }

 

 

Grid on the user control:

 <telerik:RadGrid ID="rgToolSelection"
                    runat="server"
                    AllowPaging="true"
                    PageSize="100000"
                    GridLines="None"
                    AllowSorting="True"
                    DataSourceID="odsToolSelected"
                    EnableEmbeddedSkins="false"
                    AllowMultiRowSelection="true"
                    AllowAutomaticUpdates="true"
                    OnItemCommand="rgToolSelection_ItemCommand"
                    OnItemDataBound="rgToolSelection_ItemDataBound">
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    <HeaderStyle HorizontalAlign="Center" />
                    <ClientSettings>
                    </ClientSettings>
                    <MasterTableView ClientDataKeyNames="ToolID" DataKeyNames="ToolID" AutoGenerateColumns="false" AllowAutomaticDeletes="True" EditMode="InPlace">
                         <Columns>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
                                FilterControlAltText="Filter DeleteColumn column" HeaderText="Deselect"
                                ImageUrl="~/Images/Trash.gif" Text="Delete"
                                UniqueName="DeleteColumn" Resizable="false" ConfirmText="Remove Record?">
                                <HeaderStyle CssClass="rgHeader ButtonColumnHeader"></HeaderStyle>
                                <ItemStyle CssClass="ButtonColumn" />
                            </telerik:GridButtonColumn>
                            <telerik:GridTemplateColumn UniqueName="SerialNumber" HeaderText="Serial Number"
                                SortExpression="Serial_Number" ItemStyle-Wrap="false">
                                <ItemTemplate>
                                    <asp:Image ID="imgStatus" runat="server" 
                                        Visible="true" />
                                    <%# Eval("SerialNumber", "{0}")%>
                                </ItemTemplate>

                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn UniqueName="ToolName" HeaderText="Tool Name" DataField="ToolName" AllowSorting="false" />
                            <telerik:GridBoundColumn UniqueName="ComponentName" HeaderText="Component Name" DataField="ComponentName" AllowSorting="false" />
                            <telerik:GridBoundColumn UniqueName="SystemStatus" HeaderText="System Status" DataField="Status" AllowSorting="false" />
                            <telerik:GridBoundColumn UniqueName="ToolSizeName" HeaderText="Size" DataField="ToolSizeNameWithMM" AllowSorting="false" />
                            <telerik:GridTemplateColumn UniqueName="TemplateMoreInfoColumn" HeaderText="">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="ibMoreToolInfo" runat="server" ImageUrl="~/Images/Info.gif" OnClientClick="return false" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>


                            <telerik:GridTemplateColumn UniqueName="IntendedUse" HeaderText="Intended Use">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:RadioButtonList ID="rblIntendedUse" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Text="Land" Value="L" />
                                        <asp:ListItem Text="Offshore" Value="O" />
                                    </asp:RadioButtonList>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridTemplateColumn UniqueName="Leasing" HeaderText="Leasing">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:RadioButtonList ID="rblLeasing" RepeatDirection="Horizontal" runat="server">
                                        <asp:ListItem Text="Monthly" Value="M" />
                                        <asp:ListItem Text="Long Term" Value="L" />
                                        <asp:ListItem Text="None" Value="*" Selected="True" />
                                    </asp:RadioButtonList>
                                </ItemTemplate>

                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="Value" HeaderText="Value">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox ID="rntbItemValue" runat="server" Width="60px" NumberFormat-DecimalDigits="2"
                                        EnableEmbeddedSkins="false" EnabledStyle-HorizontalAlign="Right">
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridTemplateColumn UniqueName="DontPrint" HeaderText="Don't Print">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkDontPrint" runat="server"></asp:CheckBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="IsDefaultConsignment" HeaderText="Consignment">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkIsDefaultConsignment" runat="server"></asp:CheckBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="CommunityValue" HeaderText="Community">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:RadioButtonList ID="rblCommunity" RepeatDirection="Horizontal" runat="server">
                                        <asp:ListItem Text="FCG" Value="1" />
                                        <asp:ListItem Text="IPR" Value="2" />
                                        <asp:ListItem Text="EU" Value="3" />
                                        <asp:ListItem Text="None" Value="*" Selected="True" />
                                    </asp:RadioButtonList>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="HTS" HeaderText="HTS">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <telerik:RadTextBox ID="rtbHTS" runat="server" EnableEmbeddedSkins="false" Columns="10">
                                    </telerik:RadTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="FieldTicket" HeaderText="Field Ticket" ItemStyle-VerticalAlign="Top">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <telerik:RadTextBox ID="rtbFieldTicket" runat="server" EnableEmbeddedSkins="false"
                                        Columns="10">
                                    </telerik:RadTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true">
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                </telerik:RadGrid>

 

 



Kristin
Top achievements
Rank 1
 asked on 08 Sep 2017
3 answers
126 views

I came across this issue and have been looking for awhile. In a radgrid control in edit mode I have a dropdownlist control and the font weight for the label is not bold. How can I do this? Also, in edit mode I have a radtextbox and it's label font weight is bold and can't be changed.

Thank you in advance.

Jim

Vessy
Telerik team
 answered on 08 Sep 2017
5 answers
1.2K+ views
Hi,
I need to allow only alpha numeric value with some special chracters ('_','-','@','.').






Thanks
Pravin
Top achievements
Rank 1
 answered on 08 Sep 2017
7 answers
193 views
hello

i know there are a lot of issues for frozen columns and horizontal scrolling when the number of frozen columns is high and takes a lot of space in the grid. i also use the workaround of increasing the last column with in order to be able to scroll to last column.
the bug i am facing is if i don't scoll using the arrows of the scroll bar but click directly in the scroll bar to scroll some columns it always jumps back to the beginning.
if i already scrolled to the middle position and then click it works.

is there a workaround or fix or this issue?

regards
رامي
Top achievements
Rank 1
 answered on 08 Sep 2017
0 answers
131 views

Hi 

 

I am trying to find a control like a label inside the nestedtable view in the client side when a button on the parent table is clicked. Can you please direct me to how get it.

 

This is how far I got :-

function showDetailsOnButtonClick(rowIndex) {
        var parentRow = $find("<%=rGridColors.ClientID %>").get_masterTableView().get_dataItems()[rowIndex];
        var lblInNestedTableView = parentRow .get_dataItems()[0].findControl("lblInNestedTableView");
         lblInNestedTableView .visible = false;
        }

 

Here is the markup :-

 <telerik:RadGrid runat="server" ID="rGridColors" >

           <MasterTableView AutoGenerateColumns="false" AllowPaging="false"  HierarchyDefaultExpanded="true" CssClass="grid">
                <Columns>
                 
                    <telerik:GridTemplateColumn HeaderText="Color" UniqueName="Color">
                   <ItemTemplate>
                 
<asp:ImageButton ID="btnShowColorLabel" runat="server" ImageUrl="~\images/info.gif"/>
</span>
                   </ItemTemplate>
                    </telerik:GridTemplateColumn>
                   
                </Columns>
           
            <NestedViewTemplate>

         <asp:Label runat="server" id ="lblInNestedTableView" Text ="You CLicked on color :===" />

 

 

Thanks

 

Rishi
Top achievements
Rank 1
 asked on 07 Sep 2017
1 answer
275 views

I need to get a reference to a combo box on that is in an edittemplatecolumn. I only need the reference on post back after the first combo box has an item selected.

As you can see below I have a very simple grid for testing purposes. I basically just want to select cmboCondition and have it auto post back. On item index changed, I want to populate cmboCondition2 however I can't get a reference to cmboCondition2.

<telerik:RadGrid ID="gridConditions" EnableTheming="false" runat="server" AllowPaging="false" AllowSorting="false" AllowFilteringByColumn="false" PageSize="1000" AutoGenerateColumns="false">
    <GroupingSettings CaseSensitive="false" />
    <ClientSettings>
        <Scrolling AllowScroll="False" />
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
    <MasterTableView CommandItemDisplay="Top" AllowNaturalSort="false" NoMasterRecordsText="There are no conditions. Please add one to the rule." ShowHeader="false">
        <CommandItemTemplate>
            <div style="padding-left:8px; padding-right:8px; padding-top:6px; padding-bottom:6px;">
                <table width="100%">
                    <tr>
                        <td runat="server" Visible='<%# Not gridConditions.MasterTableView.IsItemInserted%>'>
                            <asp:LinkButton ID="btnAddCondition" runat="server" ToolTip="Add Condition" CommandName="InitInsert" Visible='<%# Not gridConditions.MasterTableView.IsItemInserted%>'><asp:Image ID="imgAddCondition" runat="server" ImageUrl="~/images/add_button.gif"/>Add</asp:LinkButton>   
                            <asp:LinkButton ID="btnDeleteCondition" runat="server" ToolTip="Delete Condition" OnClientClick = " return confirm('Are you sure you want to delete the selected condition?');" CommandName="DeleteSelected" Visible='<%# Not gridConditions.MasterTableView.IsItemInserted%>'><asp:Image ID="Image1" runat="server" ImageUrl="~/images/delete_button.gif"/>Delete</asp:LinkButton>
                        </td>
                        <td runat="server" Visible='<%# gridConditions.MasterTableView.IsItemInserted%>'>
                        <asp:LinkButton ID="btnInsertCondition" runat="server" ToolTip="Confirm Add" CommandName="PerformInsert" Visible='<%# gridConditions.MasterTableView.IsItemInserted%>'><asp:Image ID="imgInsertCondition" runat="server" ImageUrl="~/images/updaterecord_button.gif"/>Confirm Add</asp:LinkButton>   
                            <asp:LinkButton ID="btnCancelCondition" runat="server" ToolTip="Cancel Add" CommandName="CancelAll" Visible='<%# gridConditions.EditIndexes.Count > 0 or gridConditions.MasterTableView.IsItemInserted %>'><asp:Image ID="imgCancelCondition" runat="server" ImageUrl="~/images/cancel_button.gif"/>Cancel Add</asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </div>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridTemplateColumn UniqueName="Condition" HeaderText="" AllowFiltering="false" ItemStyle-Wrap="false">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <asp:Label runat="server" ID="lblCondition" Text="" />
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblCondition2" Text="" />
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblValue" Text="" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <EditItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <telerik:RadComboBox runat="server" ID="cmboCondition" AutoPostBack="true" OnSelectedIndexChanged="cmboCondition_OnSelectedIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="Select One" Value="0" />
                                        <telerik:RadComboBoxItem Text="The sender ..." Value="1" />
                                        <telerik:RadComboBoxItem Text="The recipient ..." Value="2" />
                                        <telerik:RadComboBoxItem Text="The subject or body ..." Value="3" />
                                        <telerik:RadComboBoxItem Text="Any attachment ..." Value="4" />
                                        <telerik:RadComboBoxItem Text="Any recipient ..." Value="5" />
                                        <telerik:RadComboBoxItem Text="A message header ..." Value="6" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                            <td>
                                <telerik:RadComboBox runat="server" ID="cmboCondition2"/>
                            </td>
                            <td>
                                This is where the value popup goes
                            </td>
                        </tr>
                    </table>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
Private Sub PopulateConditions(ByVal clientID As String)
        Dim cmboCondition2 As RadComboBox = gridConditions.MasterTableView.FindControl(clientID)
 
        For Each item As GridDataItem In gridConditions.EditItems
            cmboCondition2 = CType(item("Condition").FindControl("cmboCondition2"), RadComboBox)
        Next
 
        If Not cmboCondition2 Is Nothing Then
            Dim prmParentID As New SqlParameter("@ParentID", cmboCondition2.SelectedValue)
            Dim arrParameters() As SqlParameter = {prmParentID}
 
            Dim dsValues As DataSet = mySQLFunctions.SQLStoredProc("sp_selectDLPConditionsByParentID", arrParameters)
 
            If dsValues.Tables.Count > 0 Then
                cmboCondition2.DataSource = dsValues.Tables(0)
                cmboCondition2.DataTextField = "Text"
                cmboCondition2.DataValueField = "Value"
                cmboCondition2.DataBind()
            End If
        End If
    End Sub
 
    Protected Sub gridConditions_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridConditions.NeedDataSource
        gridConditions.DataSource = New Datatable()
    End Sub
 
    Protected Sub gridConditions_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
        If TypeOf e.Item Is GridCommandItem Then
 
            Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
            Dim insertButton As LinkButton = CType(commandItem.FindControl("PerformInsertButton"), LinkButton)
            Dim cancelButton As LinkButton = CType(commandItem.FindControl("CancelButton"), LinkButton)
 
            insertButton.Visible = False
            cancelButton.Visible = False
        End If
    End Sub
 
    Protected Sub cmboCondition_OnSelectedIndexChanged(ByVal sender As RadComboBox, ByVal e As EventArgs)
        PopulateConditions(sender.ClientID & "2")
    End Sub

 

Trevor
Top achievements
Rank 1
 answered on 07 Sep 2017
6 answers
494 views
I use ExportToRtf to save theEditor's content(Track Change), but it seems to lose the text format. When I reload the Rtf file I saved the text format is losed. If I export with ExportToPdf function, the text format is keeped. But there is no function to load pdf file. I prefer using Rtf. Does somebody know how to keep Editor's text format(track change) and save the content into a Rtf, and then load the Rtf file and show the content(keep Track Change) in Editor?

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim astr As String = theEditor.Text
    theEditor.ExportToRtf()
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
    Dim totalStr As String = ""
    Using sr As StreamReader = New StreamReader("C:\Users\User\Downloads\RadEditorExport.rtf")
        Dim line As String
        Do
            line = sr.ReadLine()
            totalStr &= line
        Loop Until line Is Nothing
        sr.Close()
    End Using
    theEditor.LoadRtfContent(totalStr)
End Sub
gayathri
Top achievements
Rank 1
 answered on 07 Sep 2017
0 answers
162 views

Hello,

is there any way how to get rid of all embedded resources (css, js) and handle everything different way?

We are using custom skins, so all related css are on our server. But I would like to be able maintain all other base resources and disable using axd handlers to server data.

René
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 07 Sep 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?