Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
306 views

Hi

I'm having trouble adding bold version of Calibri font to client export manager pdf setting. Here's what I'm using :

 

RadClientExportManager1.PdfSettings.Fonts.Add("Calibri", "Styles/Fonts/Calibri.ttf");
RadClientExportManager1.PdfSettings.Fonts.Add("Calibri Bold", "Styles/Fonts/CalibriBold.ttf");

 

When I export my element to pdf, parts of text that are not bold look fine, but bold parts fonts is changed to something else. What can I do to add Calibri Bold to pdf setting?

Thanks

Vessy
Telerik team
 answered on 25 Oct 2019
1 answer
182 views

Greetings,

I have the following situation which I hope you can help me with.

I have created a RadListBox control that shows icons only - no text. The purpose of this is to act like a menu. I am loading it manually by navigating through a dataset and creating RadListBoxItems, and then adding them to the RadListBox control (e.g.lstMenu.Items.Add(lbItem) ).  This works just fine.

 

I now want to add a RadToolTip to each RadListBoxItem, but cannot seem to get it to work.

I have tried the following:

            Dim item As New RadListBoxItem
            item.Value = dt.Rows(r).Item("MainMenuID")
            item.ImageUrl = String.Format("~/Images/{0}.png", iconName)
            item.Height = New Unit(32, UnitType.Pixel)
            item.Attributes.Add("tt", name)
            lstMenu.Items.Add(item)

            Dim tt As New RadToolTip
            tt.Text = name
            tt.TargetControlID = item.ClientID
            tt.IsClientID = True
            tt.Position = ToolTipPosition.MiddleRight
            tt.Animation = ToolTipAnimation.Fade
            tt.RelativeTo = ToolTipRelativeDisplay.Element
            tt.RenderInPageRoot = True
            tt.ShowEvent = ToolTipShowEvent.OnMouseOver
            tt.HideEvent = ToolTipHideEvent.LeaveTargetAndToolTip
            tt.AutoCloseDelay = 0
            tt.VisibleOnPageLoad = False

... but no tool tips appear over the list item.

I also tried the following using a RadToolTipManager control:

.aspx page:

<telerik:RadToolTipManager runat="server" ID="ttMgr" Position="MiddleRight" Animation="Fade" RelativeTo="Element"              RenderInPageRoot="true" ShowEvent="OnMouseOver" HideEvent="LeaveTargetAndToolTip" AutoCloseDelay="0"              ShowCallout="true" VisibleOnPageLoad="false" />

code behind

            Dim item As New RadListBoxItem
            item.Value = dt.Rows(r).Item("MainMenuID")
            item.ImageUrl = String.Format("~/Images/{0}.png", iconName)
            item.Height = New Unit(32, UnitType.Pixel)
            item.Attributes.Add("tt", name)
            lstMenu.Items.Add(item)

 

Private Sub lstMenu_ItemCreated(sender As Object, e As RadListBoxItemEventArgs) Handles lstMenu.ItemCreated

    ttMgr.TargetControls.Add(e.Item.ClientID, e.Item.Attributes.Item("tt"), True)

End Sub

 

... but again no tooltip.

Can anyone please help me as to where I'm going wrong?

 

 

Adam
Top achievements
Rank 1
 answered on 25 Oct 2019
3 answers
132 views

We have a page in our application that allows user to upload CSV data to our database.  The actual import portion (not the upload) can be quite lengthy depending on the number of records so I am trying to use a RadProgressArea to show progress.  However, when I added the RadProgressArea and RadProgressManager to my page, the FileUpload codebehind no longer runs.  The dialog box opens for the user to select a file, but then the Upload() method in the code behind no longer runs:

 

<button type="button" class="btn btn-alt3" id="btnOpen" visible="true" onclick="javascript:OpenFileDialog();" > <i class="icon s7-upload"></i> Upload</button>
 
    <button type="button" runat="server" class="btn btn-alt3" id="btnUpload" onclick="javascript:ShowLoadingPanel();" onserverclick="Upload" style="visibility:hidden" ></button>
 
         <asp:FileUpload id="FileUpload1" runat="server" style="visibility:hidden" />
 
    <asp:HiddenField runat="server" ID="importType" ClientIDMode="Static" />
    <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
     <telerik:RadProgressArea RenderMode="Lightweight" ID="RadProgressArea1" runat="server" Width="500px" />
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="PageScripts_Footer" runat="server">
    <script>
        $(document).ready(function () {
            var grid = $find("<%= grdImportData.ClientID %>");
            var columns = grid.get_masterTableView().get_columns();
 
            for (var i = 0; i < columns.length; i++) {
                columns[i].resizeToFit();
            }
 
        });
        function OpenFileDialog(fileUpload) {
            document.getElementById('<%=FileUpload1.ClientID%>').click();
        }
        function UploadFile(fileUpload) {
            if (fileUpload.value != '') {
                document.getElementById("<%=btnUpload.ClientID %>").click();
            }
        }

 

It its the btnUpload.Client click call, but it never runs the code behind.  If I remove the RadProgressArea and the RadProgressManager, the Upload code runs as expected.

Eyup
Telerik team
 answered on 25 Oct 2019
7 answers
1.3K+ views

Hey guys,

 

I'm currently trying to achieve to have a specific year selected on initialize in the code behind. I try to select the current year by default and fill some years into the box. As soon as I switch the year and reload the page the radgrid takes the correct value but it gets displayed the old value (for example 2015) . Anyone has an Idea how to fix that? I already tried to clear all items before setting the datasource.

 

Thanks in advance,

Daniel

Attila Antal
Telerik team
 answered on 25 Oct 2019
3 answers
320 views

     I have built dozens of grids with command menus with no issues, but this one does not show?

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
    Width="1200px" CommandItemDisplay="Top"
    RenderMode="Auto" AllowPaging="True" AllowSorting="True" PageSize="50" ShowHeader="true">
    <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
    <ExportSettings FileName="Agenda">
    </ExportSettings>
    <ClientSettings EnableRowHoverStyle="True">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" PageSize="25">
        <CommandItemSettings ShowAddNewRecordButton="False" ShowPrintButton="true" ShowExportToExcelButton="True" ShowExportToCsvButton="true" ShowRefreshButton="False" />
        <RowIndicatorColumn Visible="False">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Created="True">
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="Client" SortExpression="Client" UniqueName="flname">
                <ItemTemplate>
                    <asp:HyperLink ID="editClient" runat="server" NavigateUrl="#" Text='<%# Eval("flname") %>'></asp:HyperLink>
                </ItemTemplate>
                <ItemStyle Width="125px" Font-Size="8" />
            </telerik:GridTemplateColumn>

            <telerik:GridBoundColumn DataField="APTCPTCode" HeaderText="CPT Code" UniqueName="APTCPTCode" Display="True">
                <ItemStyle Width="50px" Font-Size="8" />
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Start" DataType="System.DateTime" Display="True" FilterControlAltText="Filter Start column" HeaderText="Date" SortExpression="Start" UniqueName="Start" DataFormatString="{0:g}">
                <ItemStyle Width="125px" HorizontalAlign="Center" Font-Size="8" />
                <HeaderStyle HorizontalAlign="Center" />
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status" Display="True">
                <ItemStyle Width="50px" Font-Size="8" />
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Duration" DataType="System.Int32" HeaderText="Min" ReadOnly="True" SortExpression="Duration" UniqueName="Duration" HeaderStyle-HorizontalAlign="Center" Visible="True">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle Width="40px" HorizontalAlign="Center" Font-Size="8" />
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="ClientID" FilterControlAltText="Filter ClientID column" HeaderText="ClientID" SortExpression="ClientID" UniqueName="ClientID" Display="false">
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Subject" FilterControlAltText="Filter Subject column" HeaderText="Subject" SortExpression="Subject" UniqueName="Subject" Visible="True">
                <ItemStyle Width="80px" Font-Size="8" />
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Practitioner" HeaderText="Staff" SortExpression="Practitioner" UniqueName="Practitioner" Display="True">
                <ItemStyle Width="100px" Font-Size="8" />
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="RoomName" FilterControlAltText="Filter RoomName column" HeaderText="Room" SortExpression="RoomName" UniqueName="RoomName" Visible="true">
                <ItemStyle Width="80px" Font-Size="8" />
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn DataField="Owner" HeaderText="Owner" DataType="System.Boolean"></telerik:GridCheckBoxColumn>

            <telerik:GridCheckBoxColumn DataField="HasInsurance" HeaderText="Insurance" DataType="System.Boolean"></telerik:GridCheckBoxColumn>

            <telerik:GridBoundColumn DataField="UserID" DataType="System.Int32" Visible="False" FilterControlAltText="Filter UserID column" HeaderText="UserID" SortExpression="UserID" UniqueName="UserID">
            </telerik:GridBoundColumn>
        </Columns>
        <CommandItemTemplate>
        </CommandItemTemplate>
    </MasterTableView>

    <FilterMenu RenderMode="Auto"></FilterMenu>

    <HeaderContextMenu RenderMode="Auto"></HeaderContextMenu>
</telerik:RadGrid>

Vessy
Telerik team
 answered on 25 Oct 2019
1 answer
91 views

Hello,

I have an AdvancedInsertTemplate with and RequiredFieldValidator. When I want to cancel the insert (push button Cancel with commandname cancel), the RequiredFieldValidator is active and I can't cancel the insert( the modal doesn't close).

Could you give me a solution ?

 

Thank you

HYSCAD

Patrick
Top achievements
Rank 1
 answered on 24 Oct 2019
8 answers
373 views

Hello,
I am binding columns dynamically to my grid as per this article:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section21

I am also attempting to implement a drop-down filter box as per this article:
http://www.telerik.com/help/aspnet-ajax/grid-filtering-with-dropdownlist.html

But when I postback the the grid for any reason (refresh, paging, or applying a filter), I get the following exception:

Cannot create column with the specified type name: CustomFilteringColumn

How can I make this programatic column (instanciated at Page_Load) play nice with the column creation on post-backs?

here is my class that inherits from GridBound Column (as per the 2nd article):

    public class CustomFilteringColumn : GridBoundColumn
    {
 
        protected override void SetupFilterControls(System.Web.UI.WebControls.TableCell cell)
        {
            RadComboBox rcBox = new RadComboBox();
            rcBox.ID = "ddlFilter_" + Guid.NewGuid().ToString();
            rcBox.AutoPostBack = true;
            rcBox.DataTextField = this.DataField;
            rcBox.DataValueField = this.DataField;
            rcBox.SelectedIndexChanged += rcBox_SelectedIndexChanged;
 
            RadComboBoxItem blankItem = new RadComboBoxItem(string.Empty, string.Empty);
            rcBox.Items.Add(blankItem);
 
            // add other items to the dropdown here
 
            cell.Controls.Add(rcBox);
        }
 
        protected override void SetCurrentFilterValueToControl(System.Web.UI.WebControls.TableCell cell)
        {
            base.SetCurrentFilterValueToControl(cell);
        }
 
        protected override string GetCurrentFilterValueFromControl(System.Web.UI.WebControls.TableCell cell)
        {
            return base.GetCurrentFilterValueFromControl(cell);
        }
 
        private void rcBox_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter"new System.Web.UI.Pair());
        }
    }

Thanks,
Ben

John
Top achievements
Rank 1
 answered on 23 Oct 2019
1 answer
117 views

 have a RadGrid which has a main data source dsA. I have a foreign key column on this dsA called fColumn having integer values, on which I am getting the relevant text of this fColumn from a second table "tblB". The tblB has two columns (id and text) which the id is corresponding to fColumn.
I want to have the FilterCheckList values in the grid from this tblB, column named "text" which I did as:

<telerik:GridBoundColumn DataField="fColumn" FilterCheckListEnableLoadOnDemand="true"
                HeaderText="HeaderTxt" SortExpression="fColumn" UniqueName="fColumn">        
 </telerik:GridBoundColumn>

 

and in the code.cs file:

protected void RadGrid1_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
 {
            string DataField = (e.Column as IGridDataColumn).GetActiveDataField();
            e.ListBox.DataSource = dsTblB;
            e.ListBox.DataKeyField = "id";
            e.ListBox.DataTextField = "text";
            e.ListBox.DataValueField = "id";
            e.ListBox.DataBind();
 }

 

What I am getting as error in alert when I am clicking on this filter:
fColumn is neither a DataColumn nor a DataRelation for table DefaultView.

So how this above scenario can be easily achieved with Telerik controls.

PS: I don't want to use SQL Joins for filling the Grid in the query.
Thanks in Advance!

Eyup
Telerik team
 answered on 23 Oct 2019
5 answers
274 views
Dear Telerik Team, 

Using the RadDiagram I would like to connect a number of shapes and to include meaning regarding the connection. Common sense tells me that the 2 lines below ought to accomplish this task and assign the "Connection Test" string to the connection. However, somehow that's not working out too well for me. If you could give me a pointer in the right direction to get this accomplished that would be much appreciated. 

Dim connection = New DiagramConnection()
connection.ContentSettings.Text = "Connection Test"

Additionally, I was wondering if there is any way to execute something server side when the user clicks / double clicks on a DiagramShape?

Thank you for your assistance, 

Andre. 
Vessy
Telerik team
 answered on 23 Oct 2019
9 answers
5.5K+ views

Hi, recently our company has updated development laptops with windows 10. After Installing Visual Studio 2015 and telerik controls I receive below error:

Error  'Could not load file or assembly 'Telerik.Web.UI, Version=2016.3.1027.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))'

However everything is working fine on old developer machine.

OS : Windows 10 Pro

IDE: Visual Studio 2015 Update 3

Telerik: 2016.3.1027.45

P.S - We do not have installed any previous version of Visual studio on new laptop.

 

 

Shubhra
Top achievements
Rank 1
 answered on 23 Oct 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?