Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
Is there a way to upload all files in a directory via Dropzone?
Attila Antal
Telerik team
 answered on 21 Jun 2024
1 answer
83 views

I want to hide the Preview column that is withing a Template column and I'm not having any luck.

                                    <telerik:RadGrid ID="RadGridMaterials" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None" Width="896px" PageSize="20">
                                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                        <MasterTableView AutoGenerateColumns="false" TableLayout="Fixed">
                                            <NoRecordsTemplate>
                                                No Material Records Found
                                            </NoRecordsTemplate>
                                            <Columns>
                                                <telerik:GridButtonColumn ButtonType="PushButton" HeaderText="" HeaderStyle-Width="50px" UniqueName="EditItem" Text="Edit" ConfirmText="Edit Item?" CommandName="EditItem" />
                                                <telerik:GridBoundColumn  DataField="itemsku" HeaderText="ID" HeaderStyle-Width="120px" />
                                                <telerik:GridBoundColumn  DataField="itemdesc" HeaderText="Description" HeaderStyle-Width="380px" />
                                                <telerik:GridBoundColumn  DataField="itemquantity" HeaderText="Quantity" HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Right" />
                                                <telerik:GridButtonColumn ButtonType="ImageButton" HeaderText="Adjust Quantity" HeaderStyle-Width="70px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="EditQty" ImageUrl="~\images\Edit-32.png" CommandName="EditQty" />
                                                <telerik:GridButtonColumn ButtonType="ImageButton" HeaderText="Rename" HeaderStyle-Width="70px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="Rename" ImageUrl="~\images\Edit-32.png" CommandName="Rename" />
                                                
                                                <%--<telerik:GridButtonColumn ButtonType="ImageButton" HeaderText="Preview" HeaderStyle-Width="60px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="Preview" ImageUrl="~\images\transparent.png" />--%>
                                                <telerik:GridTemplateColumn HeaderText="Preview" HeaderStyle-Width="50px">
                                                    <ItemTemplate>
                                                        <button id="Preview" type="button" data-toggle="modal" data-target="#renderingPDF" class="previewbutton">
                                                            <img src="/images/Adobe-32.png"
                                                        </button> 
                                                    </ItemTemplate>                                                
                                                </telerik:GridTemplateColumn>
                                                
                                                <telerik:GridButtonColumn ButtonType="ImageButton" HeaderText="Download" HeaderStyle-Width="60px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="Download" ImageUrl="~\images\transparent.png" />
                                                <telerik:GridButtonColumn ButtonType="ImageButton" HeaderText="Delete" HeaderStyle-Width="48px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="DeleteItem" ImageUrl="~\images\Garbage-Closed-32.png" ConfirmText="Delete Item?" CommandName="DeleteItem" />
                                                <telerik:GridBoundColumn  DataField="PDF" Display="false" UniqueName="PDF" />
                                                <telerik:GridBoundColumn  DataField="CartContentPk" Display="false" UniqueName="CartContentPk" />
                                                <telerik:GridBoundColumn  DataField="SavePk" Display="false" UniqueName="SavePk" />
                                                <telerik:GridBoundColumn  DataField="Type" Display="false" UniqueName="Type" />
                                                <telerik:GridBoundColumn  DataField="EventOrderItemsId" Display="false" UniqueName="EventOrderItemsId" />
                                                <telerik:GridBoundColumn  DataField="EventLinkPK" Display="false" UniqueName="EventLinkPK" />
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>

  Private Sub RadGridMaterials_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridMaterials.ItemDataBound
            Try
                If TypeOf e.Item Is GridDataItem Then

                    Dim dataItem As GridDataItem = TryCast(e.Item, GridDataItem)
 '----------------------------------------------------------------------------------------------

                    'Dim btnPreview As button = TryCast(dataItem("Preview").Controls(0), button)
                    Dim btnPreview As HtmlButton = New HtmlButton
                    ' Try
                    btnPreview = CType(dataItem.FindControl("Preview"), HtmlButton)
                    'Catch ex1 As Exception
                    'LogException(New Exception("Define Button Preview" & ex1.Message.ToString))
                    'End Try

                    Try
                        If dataItem("PDF").Text = "&nbsp;" Or dataItem("CartContentPk").Text = "&nbsp;" Then
                            'btnPreview.Enabled = False
                            'btnPreview.ImageUrl = "~\images\transparent.png"
                            btnPreview.Visible = False
                        Else
                            'btnPreview.ImageUrl = "~\images\Adobe-32.png" 'Stuffed_Folder.png"
                            'btnPreview.Enabled = True
                            'btnPreview.ToolTip = dataItem("ItemSKU").Text
                            btnPreview.Visible = True
                            'btnPreview.OnClientClick = "window.open('" & dataItem("PDF").Text & "','','')"
                        End If
                    Catch ex As Exception
                        LogException(ex)
                    End Try

                    '----------------------------------------------------------------------------------------------
                End If

            Catch ex As Exception
                lblErrMessage.Text = ex.ToString
            End Try
        End Sub


Vasko
Telerik team
 answered on 20 Jun 2024
2 answers
445 views

Hello,

We are not able to open hyperlinks which are in the content area of the RadEditor.  We are experiencing this behavior in our code as well as on your demo site.  Here is how to replicate the issue on the demo site.

a)  Go to the overview page on the RadEditor demo site:  http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

b)  Clear all content in the RadEditor

c)  Click on the <html> tab for the RadEditor

d)  Enter the following hyperlink into the content area:  <a href="http://www.w3schools.com/html/">Visit our HTML tutorial</a>

e)  Click on the Preview tab of the RadEditor

f)  Click on the hyperlink for d) above.  This will not take the browser to the hyperlink which was added into the content area

This behavior is consistent between Google Chrome, Firefox, Edge, Safari and IE

Please advise.

Mark
Top achievements
Rank 1
Iron
Iron
 answered on 19 Jun 2024
2 answers
480 views

Hi!

I have a RadEditor on a page and links do not work when clicked.  I read in other posts that the links won't work due to it being rendered in an IFRAME, and try some JavaScript workarounds:

https://www.telerik.com/forums/radeditor-hyperlinks-not-working

 

I tried both of the workarounds mentioned there:

http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/how-to/open-link-in-a-new-window-when-clicked
http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/how-to/open-link-in-a-new-window-on-double-click

But neither was able to open a new page.  I set ContentFilters to "None", and still the same issue so it's not related to that.

Thanks!

Mark
Top achievements
Rank 1
Iron
Iron
 answered on 19 Jun 2024
1 answer
97 views

Hi all,

I have tried to use the samples shown in this post ( https://www.telerik.com/forums/determine-column-series-color ) but cannot get it to apply for a pie chart. I have several dark & light coloured pie segments (eg: black & yellow) and cannot set a single colour across the board.

My current function looks like this:

function Chart1SeriesHover(e) { setTimeout(function () { switch (e.category) { case'Not Done': $telerik.$('.k-tooltip')[0].style.color = "white"; //black pie segment break; default: break;

} }, 10); }


but I keep getting the following error in DevTools:

Uncaught TypeError: Cannot read properties of undefined (reading 'style')

Any help would be greatly appreciated.

Vasko
Telerik team
 answered on 19 Jun 2024
1 answer
126 views

I have a RadGrid that required two separate Edit Buttons used for InPlace EditMode. I have created two GridButtonColumns each with a unique CommandName. I am capturing these button presses in the RadGrid.ItemCommand method. What I need, however, is some way of displaying a Confirm and a Cancel button while in Edit Mode for each of these edit buttons.  How can I achieve this?

Thanks!

Vasko
Telerik team
 answered on 12 Jun 2024
1 answer
193 views

If I set the background color of dates in a raddatepicker the background color will show when I hover over the date but not before I do.

If I set the render mode to lightweight the background color does show upon the raddatepicker showing.

Does anyone else have this problem?

Here is the control

<telerik:RadDatePicker ID="rdpPickUpDate" runat="server"  >
   <Calendar OnDayRender="Calendar_OnDayRender" ></Calendar>
</telerik:RadDatePicker>

 

Here is the code to set the background color to red for Mondays

        protected void Calendar_OnDayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
        {
            if (e.Day.Date.DayOfWeek == DayOfWeek.Monday)
            {
                RadCalendarDay calendarDay = new RadCalendarDay();
                calendarDay.Date = e.Day.Date;

                calendarDay.ItemStyle.BackColor = System.Drawing.Color.Red;


                calendarDay.Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.DayAndMonth;

                rdpPickUpDate.Calendar.SpecialDays.Add(calendarDay);
            }
        }

 

Does anyone have any ideas

Vasko
Telerik team
 answered on 10 Jun 2024
4 answers
962 views
When I click "Get latest" the 2024.2.513 version is downloaded but does not appear in the dropdownlist so I cannot apply the update to my projects.
Rumen
Telerik team
 answered on 10 Jun 2024
1 answer
222 views

We have the RadImageGallery implemented on page. The code behind loads up one or more images by reading in an array of bytes from each file.  Occasionally, an exception is thrown when one of those images is invalid (corrupt or some other issue).  OK, that's fine, but we would like to trap the exception and handle the error in a particular way.  But... we don't seem to be able to trap it other than in our last-chance global exception handler.

The binary data is created in the NeedDataSource event, and that returns successfully.  I've added other events and set breakpoints in each of them, and they all return ok.  So, is there an event we can handle that would be appropriate for a simple try/catch block?

Pretty simple markup for the RadImageGallery control (note, all the events after the OnNeedDataSource were added simply to test out if there was a place we could try/catch the exception, but no exception was thrown in those events):

    <telerik:RadImageGallery ID="galleryImages" runat="server" RenderMode="Lightweight"
        DisplayAreaMode="Image" LoopItems="true" DataImageField="ImageBytes" DataDescriptionField="Description" DataTitleField="Title"
        OnNeedDataSource="galleryImages_NeedDataSource"
        OnDataBinding="galleryImages_DataBinding"
        OnImageRequested="galleryImages_ImageRequested" 
        OnItemCreated="galleryImages_ItemCreated" 
        OnPreRender="galleryImages_PreRender">
    </telerik:RadImageGallery>

 

Code behind for NeedDataSource (which returns successfully):

    protected void galleryImages_NeedDataSource(object sender, Telerik.Web.UI.ImageGalleryNeedDataSourceEventArgs e)
    {
        galleryImages.Visible = false;

        FileManager fileManager = new FileManager ();
        DataTable dt = fileManager.GetFileList();
        var imageFiles = fileManager.GetGalleryImages(dt);

        if (imageFiles.Count() == 0)
        {
            txtNotes.Text = "There are no image files to display.";
            return;
        }

        try
        {
            galleryImages.DataSource = imageFiles;
            galleryImages.Visible = true;
        }
        catch (Exception ex)
        {
            LogException(ex);
            ErrorMessage("An unexpected occurred while reading one or more the image files");
        }

        if (fileManager.HasErrors)
        {
            txtErrors.Text = "The following errors were encountered:<br/><ul>" + String.Join("<li>", fileManager.ErrorList) + "</ul>";
        }
    }

 

Library code that reads image files into byte arrays (also return successfully):

        public List<GalleryImage> GetGalleryImages(DataTable srcDataTable)
        {

            //...


            foreach (DataRow dr in query)
            {
                CustomImageFile f = new CustomImageFile(dr);                

                try
                {
                    byte[] byteArray = File.ReadAllBytes(f.FullFileName);
                    GalleryImage img = new GalleryImage
                    {
                        ImageBytes = byteArray,
                        Description = $"{f.Description}", // [{f.Name}]
                    };
                    imageList.Add(img);
                }
                catch (Exception ex)
                {
                    Errors.Add($"{f.Name} could not be read");
                    LogException(ex);                    
                }
            }
            return imageList;
        }

 

Yet when there is an invalid file encountered, we get this:

[ArgumentException: Parameter is not valid.]
   System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) +1162080
   Telerik.Web.UI.BinaryImageFormatHelper.CreateImgFromBytes(Byte[] data) +69

[ArgumentException: The provided binary data may not be valid image or may contains unknown header]
   Telerik.Web.UI.BinaryImageFormatHelper.CreateImgFromBytes(Byte[] data) +120
   Telerik.Web.UI.BinaryImageTransformationFilter.ProcessImageInternal(Byte[] image) +44
   Telerik.Web.UI.BinaryImageTransformationFilter.ProcessImage(Byte[] image) +20
   Telerik.Web.UI.BinaryImageFilterProcessor.ProcessFilters(Byte[] imageData) +112
   Telerik.Web.UI.RadBinaryImage.ProcessImageData() +57
   Telerik.Web.UI.RadBinaryImage.OnPreRender(EventArgs e) +20
   System.Web.UI.Control.PreRenderRecursiveInternal() +90
   System.Web.UI.Control.PreRenderRecursiveInternal() +163

 

Attila Antal
Telerik team
 answered on 07 Jun 2024
1 answer
92 views

Hello,

Is Editor support both rtl and ltr modes for editor content? For ex. Is it possible to create a table with 2 columns, where left column content is ltr on english and right column is rtl on arabic?

For a while I found only separate examples and not found rtl/ltr buttons in the Editor.

Rumen
Telerik team
 answered on 06 Jun 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?