Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
87 views

When selecting a full table, by a standard, we get text selection, but we get the table selected (we can copy/paste the table)

Ive seen on docs you can change cell selection type to MultiCell, then you can shift+click and select cells, and its pretty much the same as the above however the visual selection is slightly different. In this case, however you cannot select texts manually like before.

I know you can change this selection type during runtime, but only in the backend is that right ?

What would be a good aproach to solve this problem ? Only do cell selection when shift is pressed, else do a normal selection.

Would apreciate any help !!

Best regards to Telerikers :)

Rumen
Telerik team
 answered on 01 Mar 2018
8 answers
273 views

Hello

I get sometimes a runtime error in production:

Message: Object reference not set to an instance of an object.
StackTrace:    at Telerik.Web.UI.RadEditor.<get_Text>b__b(Match m)
   at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
   at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
   at System.Text.RegularExpressions.Regex.Replace(String input, String pattern, MatchEvaluator evaluator, RegexOptions options)
   at Telerik.Web.UI.RadEditor.get_Text()
   at xyz.CN_BL.cnExportMethodsBL.writeEXTFlat(List`1 toWriteInSheet, SpreadsheetDocument xlDoc, WorkbookPart workbookPart, WorksheetPart& worksheetPart, Int32 iColIndex, ExtWert extW, Stamm st, Sheet sh, UInt32& indexRow, AdminTexte at, Int32 aktSprache) in C:\Projekte\xyz\CN_BL\cnExportMethodsBL.cs:line 11826
   at xyz.CN_BL.cnExportMethodsBL.doExport(IObjectScope myScope, String& strShortenFileNameToUse, MemoryStream& mStream, Int32[] Export_Ids, Int32[] Export_IdsStamm, exportMode ExportMode, exportTyp ExportTyp, exportTyp ExportTypOriginal, Sprache aktSprache, Boolean bModulWFAktiv, Int32 FirmaId, Int32 ExportSprache, String strFileName, String& strError) in C:\Projekte\xyz\Web\CN_BL\cnExportMethodsBL.cs:line 6640
   at xyz.CN_BL.FileFunctions_BL.startExportBackground(Object Param) in C:\Projekte\xyz\Web\CN_BL\FileFunctions_BL.cs:line 1212
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

The error does not occur every time. My guess: the more data is processed, the more likely the w3wp.exe crashes, or more specific, the special export thread crashes.
I can not reproduce the error in the development environment.

Creation of the error:
The user wants to export data. The web server starts a separate thread for writing datas into an excel file (via MemoryStream). Codesnippet from the export method:

Loop, which calls the writeEXTFlat() methods multiple times

{
// static method writeEXTFlat()
  ... some code ...

  Line 11826:  Telerik.Web.UI.RadEditor re = new Telerik.Web.UI.RadEditor();

  ... more code without touching RadEditor ...

  foreach (int i =0; x < exportRecs; i++)
  {

     ... more code without touching RadEditor ...

     re.Content = strExportDataWithHTML;
     string strToExport = re.Text;

     ... more code without touching RadEditor ...
  }

}

My question : Any idea why this error can happen? It makes totaly no sense to me. strExportDataWithHTML is always at least an empty string.

TIA
Markus

Markus
Top achievements
Rank 1
 answered on 01 Mar 2018
1 answer
185 views
Is it possible to use persistence framework to persist column settings when the radgrid is set AutoGeneratedColumns =true? 
Marc
Top achievements
Rank 1
 answered on 28 Feb 2018
8 answers
151 views
Hi, 
I have used radgrid to display some search records. However, I am not able to records like "<keyword>" which are however returned from the stored procedure and part of the datasource that is used to bind.

<telerik:GridHyperLinkColumn DataTextFormatString="{0}" DataNavigateUrlFields="Id"
                                                                    DataNavigateUrlFormatString="/sites/abc/xyz/vhj/Pages/view.aspx?id={0}&ReturnUrl=/Pages/Search.aspx"
                                                                    UniqueName="ItemTitle" DataTextField="Title" HeaderText="Title" SortExpression="Title"
                                                                    HeaderStyle-CssClass="ms-toolbar" HeaderStyle-Width="17%" HeaderStyle-HorizontalAlign="Left"
                                                                    ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true" SortAscImageUrl="/_layouts/Images/abc/SortAsc.gif"
                                                                    SortDescImageUrl="/_layouts/Images/abc/SortDesc.gif" DataType="System.String" >
                                                                </telerik:GridHyperLinkColumn>
This is my column definition.

Can you please let me know if there is a workaround for this or this is a feature?
Vibhu
Top achievements
Rank 1
 answered on 28 Feb 2018
2 answers
56 views

Hello,

I followed this example to create a column chart: https://docs.telerik.com/devtools/aspnet-ajax/controls/htmlchart/chart-types/column-chart

Now I only want one column per serie, how can I archieve that?

Thanks.

Daniel
Top achievements
Rank 1
 answered on 27 Feb 2018
2 answers
487 views
Hi there,

Here is a problem I met when using RadAsyncUpload. The files under \App_Data\RadUploadTemp were not completed removed after the timespan specified in TemporaryFileExpiration (10 minutes). In my project, I uploaded 19 files, only 17 files were removed from the temp folder after 15 mins. The other two files were still left in the folder. We did not use UploadedFile.SaveAs() in our project, we use read via Input Stream instead.

According to this thread, http://www.telerik.com/forums/how-to-delete-temporary-file,  the files are supposed to be removed completed, while it is not true in my project. Is there any way to ensure all the files under the temp folder be removed after a certain amount of time? Please help. Any suggestions is much appreciated. 
Richard
Top achievements
Rank 1
 answered on 27 Feb 2018
11 answers
1.4K+ views
Hi,

SelectedIndexChanged event of RadGrid is not fired.
Please help me with an example how to fire SelectedIndexChanged event of RadGrid.
Attila Antal
Telerik team
 answered on 27 Feb 2018
1 answer
102 views

I am trying to apply the modal setting for advanced insert, and it pops up, but with no background, see attached image.

 

My code for the template is:

 

<AdvancedInsertTemplate>
                        <div class="rsAdvancedEdit rsAdvancedModal" style="position: relative">
                            <div class="rsModalBgTopLeft"></div>
                            <div class="rsModalBgTopRight"></div>
                            <div class="rsModalBgBottomLeft"></div>
                            <div class="rsModalBgBottomRight"></div>
                            <div class="rsAdvContentWrapper">
                                <telerik:RadComboBox ID="InsertComboBox" runat="server" Label="Ordre                "
                                    DataSourceID="Insert" DataTextField="Titel" DataValueField="ID" Text='<%# Bind("Subject") %>' Skin="Metro">
                                </telerik:RadComboBox>
                                <telerik:RadDateTimePicker ID="StartInput" runat="server" Width="50%" Skin="Metro" SelectedDate='<%# Bind("Start") %>'>
                                    <Calendar runat="server" Enabled="false"></Calendar>
                                    <TimeView runat="server" StartTime="16:00" Interval="00:15" Columns="4"></TimeView>
                                    <DateInput runat="server" Label="Tænd"></DateInput>
                                    <DatePopupButton Visible="false" />
                                </telerik:RadDateTimePicker>
                                <br />
                                <telerik:RadDateTimePicker ID="EndInput" runat="server" DateInput-Label="Sluk" Skin="Metro"
                                    TimeView-Interval="00:30" TimeView-Columns="6" SelectedDate='<%# Bind("End") %>'>
                                    <Calendar runat="server" Enabled="false"></Calendar>
                                    <TimeView runat="server" StartTime="16:00" Interval="00:15" Columns="4"></TimeView>
                                    <DateInput runat="server" Label="Sluk"></DateInput>
                                    <DatePopupButton Visible="false" />
                                </telerik:RadDateTimePicker>
                                <br />
                                <telerik:RadSchedulerRecurrenceEditor ID="InsertRecurrenceEditor" runat="server" Visible="true" RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Skin="Metro"></telerik:RadSchedulerRecurrenceEditor>
                                <asp:HiddenField runat="server" ID="OriginalRecurrenceRule" />
                                <asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea">
                                    <div class="rsAdvButtonWrapper">
                                        <telerik:RadImageButton ID="InsertButton" runat="server" Text="Tilføj" CommandName="Insert" Skin="Metro">
                                        </telerik:RadImageButton>
                                        <telerik:RadImageButton ID="InsertCancelButton" runat="server" Text="Luk" CausesValidation="false" CommandName="Cancel" Skin="Metro">
                                        </telerik:RadImageButton>
                                    </div>
                                </asp:Panel>
                            </div>
                        </div>
                    </AdvancedInsertTemplate>
Peter Milchev
Telerik team
 answered on 27 Feb 2018
5 answers
67 views

I have a page with various controls. When I click a radio button, it clears ONLY the datetimepicker fields.  I tried both ASP.Net and Telerik radio buttons and both have the same effect. 

radio button:

<asp:RadioButton runat="server" Text ="<span style='font-size: 14px'>Repair and use</span>" TabIndex="115" ID="rbRepair" AutoPostBack="true" GroupName="rbGeneral" />

 

The radio button code behind:

txtRequestOther.Visible = False

 

datetimepicker:

<telerik:RadDateTimePicker ID="dtRequestDate" runat="server" Width="190px" Culture="en-US" TabIndex="40" Enabled="False">
<TimeView ID="TimeView2" runat="server" CellSpacing="-1"></TimeView>
<TimePopupButton CssClass="rcTimePopup rcDisabled" HoverImageUrl="" ImageUrl="" />
<Calendar ID="Calendar2" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" EnableWeekends="True"></Calendar>
<DateInput ID="DateInput2" runat="server" DisplayDateFormat="MM-dd-yyyy HH:mm tt" DateFormat="MM-dd-yyyy HH:mm tt" LabelWidth="40%" DisplayText="Select Request Date" EmptyMessage="Select Request Date">
<EmptyMessageStyle Resize="None" />
<ReadOnlyStyle Resize="None" />
<FocusedStyle Resize="None" />
<DisabledStyle Resize="None" />
<InvalidStyle Resize="None" />
<HoveredStyle Resize="None" />
<EnabledStyle Resize="None" />
</DateInput>
<DatePopupButton CssClass="rcCalPopup rcDisabled" HoverImageUrl="" ImageUrl="" TabIndex="30" />
</telerik:RadDateTimePicker>

Mark
Top achievements
Rank 1
 answered on 27 Feb 2018
3 answers
144 views

Hi, we're got a RadGrid on a page with a RadAjaxManager and RadAjaxLoadingPanel. On the first operation, using any of the paging, filtering, sorting etc. the grid doesn't appear to be using ajax on postback. Every other operation after that is fine and works as expected. There are no errors on the client or server side. It's a pretty simple page using version 2018.1.117.40. Thanks!

ASPX

<telerik:RadGrid ID="rgDocuments" runat="server" GridLines="None" Skin="MetroTouch" OnNeedDataSource="rgDocuments_NeedDataSource" AllowPaging="True" PageSize="18" AllowFilteringByColumn="True" AllowSorting="True" GroupingSettings-CaseSensitive="false" EnableLinqExpressions="False" RenderMode="Lightweight">
    <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="docsref" TableLayout="Fixed">
        <Columns>
            <telerik:GridTemplateColumn DataField="docname" HeaderText="Document" SortExpression="docname" UniqueName="docname" HeaderStyle-Width="31%" ItemStyle-Width="31%" ShowFilterIcon="false" FilterControlWidth="400px" AutoPostBackOnFilter="true">
                <ItemTemplate>
                    <span title='<%# Eval("docname") %>'>
                        <%# Eval("docname") %></span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="fcName" HeaderText="Area" SortExpression="fcName" UniqueName="fcName" HeaderStyle-Width="15%" HeaderStyle-Wrap="false" ItemStyle-Width="15%" ItemStyle-Wrap="false" ShowFilterIcon="false" AutoPostBackOnFilter="true">
                <FilterTemplate>
                    <telerik:RadComboBox ID="ddlArea" DataSourceID="sdsArea" DataTextField="fcName" DataValueField="fcName" Width="150px" Height="294px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("fcName").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="ddlAreaClientSelectedIndexChanged" Skin="MetroTouch" RenderMode="Lightweight">
                        <Items>
                            <telerik:RadComboBoxItem Text="All" />
                        </Items>
                    </telerik:RadComboBox>
                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                        <script type="text/javascript">
                            function ddlAreaClientSelectedIndexChanged(sender, args) {
                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                tableView.filter("fcName", args.get_item().get_value(), "EqualTo");
                        }
                        </script>
                    </telerik:RadScriptBlock>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="type" HeaderText="Type" SortExpression="type" UniqueName="type" HeaderStyle-Width="15%" HeaderStyle-Wrap="false" ItemStyle-Width="15%" ItemStyle-Wrap="false" ShowFilterIcon="false" AutoPostBackOnFilter="true">
                <FilterTemplate>
                    <telerik:RadComboBox ID="ddlType" DataSourceID="sdsType" DataTextField="type" DataValueField="type" Width="150px" Height="294px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("type").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="ddlTypeClientSelectedIndexChanged" Skin="MetroTouch" RenderMode="Lightweight">
                        <Items>
                            <telerik:RadComboBoxItem Text="All" />
                        </Items>
                    </telerik:RadComboBox>
                    <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                        <script type="text/javascript">
                            function ddlTypeClientSelectedIndexChanged(sender, args) {
                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                tableView.filter("type", args.get_item().get_value(), "EqualTo");
                        }
                        </script>
                    </telerik:RadScriptBlock>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="subtype" HeaderText="Subtype (leg docs)" SortExpression="subtype" UniqueName="subtype" HeaderStyle-Width="15%" HeaderStyle-Wrap="false" ItemStyle-Width="15%" ItemStyle-Wrap="false" ShowFilterIcon="false" AutoPostBackOnFilter="true">
                <FilterTemplate>
                    <telerik:RadComboBox ID="ddlSubtype" DataSourceID="sdsSubtype" DataTextField="subtype" DataValueField="subtype" Width="150px" Height="294px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("subtype").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="ddlSubtypeClientSelectedIndexChanged" Skin="MetroTouch" RenderMode="Lightweight">
                        <Items>
                            <telerik:RadComboBoxItem Text="All" />
                        </Items>
                    </telerik:RadComboBox>
                    <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
                        <script type="text/javascript">
                            function ddlSubtypeClientSelectedIndexChanged(sender, args) {
                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                tableView.filter("subtype", args.get_item().get_value(), "EqualTo");
                        }
                        </script>
                    </telerik:RadScriptBlock>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="reviewDate" HeaderText="Review Date" SortExpression="reviewDate" UniqueName="reviewDate" PickerType="DatePicker"
                DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="12%" HeaderStyle-Wrap="false" ItemStyle-Width="12%" ItemStyle-Wrap="false" AutoPostBackOnFilter="true" DataType="System.DateTime" ShowFilterIcon="false">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="docsref" HeaderText="Doc No." SortExpression="docsref" UniqueName="docsref" HeaderStyle-Width="12%" HeaderStyle-Wrap="false" ItemStyle-Width="12%" ItemStyle-Wrap="false" ShowFilterIcon="false" AutoPostBackOnFilter="true">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings EnableRowHoverStyle="true">
        <Resizing AllowColumnResize="true" />
        <ClientEvents OnRowClick="rgDocuments_RowClick" />
    </ClientSettings>
</telerik:RadGrid>
<asp:SqlDataSource ID="sdsArea" runat="server" ConnectionString="<%$ ConnectionStrings:IntranetConnectionString %>" SelectCommand="sp_docportal_ddl_area" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="false">
</asp:SqlDataSource>
<asp:SqlDataSource ID="sdsType" runat="server" ConnectionString="<%$ ConnectionStrings:IntranetConnectionString %>" SelectCommand="sp_docportal_ddl_type" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="false">
</asp:SqlDataSource>
<asp:SqlDataSource ID="sdsSubtype" runat="server" ConnectionString="<%$ ConnectionStrings:IntranetConnectionString %>" SelectCommand="sp_docportal_ddl_subtype" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="false">
</asp:SqlDataSource>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgDocuments">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgDocuments" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

 

CS

protected void rgDocuments_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    try
    {
        using (connection = new SqlConnection(@"Server=HA-SQL08;UID=*****;PWD=*****;database=intranet"))
        {
            dt = new DataTable();
            connection.Open();
            command = new SqlCommand("v3_docportal", connection);
            command.CommandType = CommandType.StoredProcedure;
            adapter = new SqlDataAdapter(command);
            adapter.Fill(dt);
            rgDocuments.DataSource = dt;
        }
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

 

 

 

Eyup
Telerik team
 answered on 27 Feb 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?