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

I am trying to Export into PDF from RadGrid. My grid is too wide on a screen and when output to PDF happened it is squished. I was trying to apply style before I do Export but it does not make any difference.

        private void btnExportToPDF_Click(object sender, EventArgs e)

        {

            ApplyStylesToPDFExport(giftGrid.MasterTableView);

            giftGrid.MasterTableView.ExportToPdf();

        }

 

        private void ApplyStylesToPDFExport(GridTableView view)

        {

            // Get access to the header of the grid

            GridItem headerItem = view.GetItems(GridItemType.Header)[0];

 

            // Apply some css style to the header

            foreach (TableCell cell in headerItem.Cells)

            {

                cell.Style["font-family"] = "Verdana";

                cell.Style["text-align"] = "center";

                cell.Style["vertical-align"] = "middle";

                cell.Style["font-size"] = "2px";

            }

                       

            // Get access to the date of the grid

            GridItem[] dataItems = view.GetItems(GridItemType.Item);

 

            // Apply some css style to the data items

            foreach (GridItem item in dataItems)

            {

                foreach (TableCell cell in item.Cells)

                {

                    cell.Style["font-family"] = "Verdana";

                    cell.Style["text-align"] = "center";

                    cell.Style["vertical-align"] = "middle";

                    cell.Style["font-size"] = "2px";

                }

            }

        }

Please explain to me what do I do wrong.

Thanks,

Yuriy

Vessy
Telerik team
 answered on 20 Jan 2021
1 answer
299 views

Hello,

Is there a way of disabling cell, sheet or workbook editing with Javascript without having to set every cell to disabled.

Vessy
Telerik team
 answered on 20 Jan 2021
1 answer
139 views

hello,

Is there a way to tag a user from my db in radeditor/kendo

i need to display the list of users after clicking @ and filter based on typing.

i need it similar to facebook or devops editors.

thanks

 

Rumen
Telerik team
 answered on 20 Jan 2021
18 answers
2.8K+ views

We are using Telerik UI for ASP.NET AJAX in our .Net Application.

Can someone tell me what is the latest version of jQuery being used in the latest version(Jan 2019) of Telerik UI for ASP.NET AJAX?

Rumen
Telerik team
 answered on 20 Jan 2021
1 answer
206 views

Hi,

I looked everywhere to get a selected item from a file explorer in C#, but nothing worked.

I need only the name and the extension to update my database, is that possible?

Vessy
Telerik team
 answered on 19 Jan 2021
5 answers
3.0K+ views
my radgrid sample is;

<telerik:RadGrid ID="GridView1"    OnDataBound="GridView1_DataBound"  
                    runat="server" DataSourceID="SqlDataSourceKategori"
                    AutoGenerateColumns="False" Skin="Windows7">
                    <MasterTableView DataSourceID="SqlDataSourceKategori" DataKeyNames="ID">
                        <Columns>
                          
                            <telerik:GridTemplateColumn HeaderText="Kategori">
                                <EditItemTemplate>

but i couldnt get datakeyname value at codebehind
i tried beloow

Label16.Text = GridView1.MasterTableView.DataKeyValues[0].ToString();
but response

"System.Collections.Hashtable+ValueCollection"

please help me


Doncho
Telerik team
 answered on 19 Jan 2021
5 answers
194 views

New user to Telerik, here. Main question is, I have a radgrid that is about 20 columns wide w/ the ability to hide columns. In mobile render, if you attempt to hide columns using the context menu, the buttons are really wide. If you want to hide a column, you have to scroll way over uncheck it. Then you can't see what the other column names are without scrolling way back over and viewing the names.

Is there any way to set the width of the context menu so it automatically adjusts to the screen size? I did do a lot of searching on this and came up empty handed.

2) Also, in grouping, everything groups and works exactly like I would think it would, but if you ungroup anything, it throws an "Object reference not set to an instance of an object." error. It's kind of cryptic and searching for this error didn't lead me anywhere.

3) Mobile render seems a little buggy on my phone using FireFox or Chrome. Sometimes hitting the context menu icons, it will open up, group the column, and then close without me ever touching anything.

I finally got so fed up with grouping issues that I turned it off.

Outside of that, the hiding the column feature seems to work well and is at least something for a mobile user to cut down on the size of a big table.

Thanks,

Jay

 

 

 

Attila Antal
Telerik team
 answered on 19 Jan 2021
1 answer
231 views
Hi, I need to retrieve the text contents of AutoCompleteBox in Javascript (client side).
I tried this but it just alerts me nothing (blank result):
<script>
function CheckOE() {
            alert(document.getElementById('RadAutoCompleteBox1').value);
        }
</script>
<telerik:RadAutoCompleteBox RenderMode="Lightweight" runat="server" ID="RadAutoCompleteBox1" ClientID="RadAutoCompleteBox1" 
            autopostback="true"
            DataSourceID="blah" DataTextField="blah" DataValueField="blah" InputType="blah" Width="100%"
            AllowCustomEntry = "false"
            DropDownWidth="150px"
            onfocusout="CheckOE()"
            >
Any idea?
Thanks!
Yan Moura
Top achievements
Rank 1
Veteran
Iron
 answered on 18 Jan 2021
1 answer
578 views

We upgraded the Telerik control to 2020.3.915.45 after we were hit by the Blue Mockingbird Vulnerability.

However, last weekend, we were hit again by the Blue Mockingbird Vulnerability. An ASPX file that contained this mark up was uploaded.

<asp:FileUpload ID="uplDosya" runat="server" />
<br />
<asp:Button ID="bntGonder" runat="server" Text="Submit" OnClick="btnGonder_Click" />

I've double-checked, we do have the latest version and we don only allow JPG as file extension.

Has anyone else been hit by Blue Mockingbird Vulnerability lately?

Vessy
Telerik team
 answered on 18 Jan 2021
1 answer
292 views

I have added my rad grid inside radwindow and radwindow is place inside asp:UpdatePanel. whenever i click on the page link or change the page size or do filter or sorting, it will cause a full postback and radwindow will be closed. Opening the radwindow again, will reflect the change, like grid will reflect the filter result, etc.

how do i prevent this from happening. 

my code

01.<asp:UpdatePanel ID="uPResponder" runat="server" UpdateMode="Conditional">
02.    <ContentTemplate>
03.        <asp:Button ID="btnOpenModal" runat="server" Text="Select user" />
04.        <asp:Label ID="lblUserCount" runat="server"></asp:Label>
05.        <telerik:RadWindow RenderMode="Lightweight" ID="modalPopup" runat="server" CenterIfModal="true" Width="1400px" Height="650px"  Modal="true"
06.        OffsetElementID="main" Style="z-index: 100001;" OnClientClose="countSelected">
07.            <ContentTemplate>
08.                <telerik:RadGrid RenderMode="Lightweight" ClientIDMode="AutoID" CssClass="table" AutoGenerateColumns="false" ID="gvUsers" AllowFilteringByColumn="True" AllowSorting="True" Width="100%"
09.                AllowPaging="True" runat="server" AllowMultiRowSelection="true" OnPreRender="gvUsers_PreRender" OnItemCommand="gvUsers_ItemCommand" OnNeedDataSource="gvUsers_NeedDataSource">
10.                    <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric" PageSizeControlType="RadDropDownList" />
11.                    <MasterTableView DataKeyNames="LoginName" ShowHeader="true" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true" NoMasterRecordsText="No user found">
12.                    <Columns>
13.                        <telerik:GridTemplateColumn HeaderStyle-Width="10px" AllowFiltering="false" AllowSorting="false" UniqueName="UserCheckbox">
14.                            <HeaderTemplate>
15.                                <asp:CheckBox ID="chbCheckAll"  AutoPostBack="true" runat="server" OnCheckedChanged="chbAll_CheckedChanged" ClientIDMode="AutoID" />
16.                            </HeaderTemplate>
17.                            <ItemTemplate>
18.                                <asp:CheckBox ID="chbUser" runat="server" AutoPostBack="True" CausesValidation="false" Checked='<%# bool.Parse(Eval("isChecked").ToString()) %>'
19.                                OnCheckedChanged="chbUser_CheckedChanged" ClientIDMode="AutoID" />
20.                            </ItemTemplate>
21.                        </telerik:GridTemplateColumn>
22.                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name" ShowSortIcon="true"
23.                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
24.                        ShowFilterIcon="true">
25.                        </telerik:GridBoundColumn>
26.                    </Columns>
27.                    </MasterTableView>
28.                </telerik:RadGrid>
29.            </ContentTemplate>
30.        </telerik:RadWindow>                          
31.    </ContentTemplate>
32.</asp:UpdatePanel>
Doncho
Telerik team
 answered on 18 Jan 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?