Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
312 views

I'm using the Rad Grid's ExportToPDF functionality in that i want to set left padding to header text. i tried to set programmatically but it doesn't work.

any solution for this..? please check attachment for your understanding.

Doncho
Telerik team
 answered on 02 Dec 2020
1 answer
281 views

Hi, i've a problem sorting a RadGrid

When i try to sort, rows data are sorted all except the last column "Allegati" that remains fixed. That column is compiled on the ItemDataBound event, based on the datatable. How can I correct this behavior? Radgrid is under Ajax. Thanks

<telerik:RadGrid ID="rgRichieste" runat="server" CellSpacing="-1" Culture="it-IT" GridLines="Both" AllowSorting="True" AutoGenerateColumns="False" PageSize="5" ShowStatusBar="True" AllowPaging="True"
        MasterTableView-NoMasterRecordsText="Nessun record da visualizzare." RenderMode="Lightweight" OnItemDataBound="rgRichieste_ItemDataBound" OnNeedDataSource="rgRichieste_NeedDataSource" FilterMenu-EnableScreenBoundaryDetection="True" Enabled="True">
    <SortingSettings SortToolTip="Click qui per ordinare" SortedAscToolTip="ordinato crescente" SortedDescToolTip="ordinato decrescente"></SortingSettings>
 
    <ExportSettings FileName="richieste" IgnorePaging="True" ExportOnlyData="True" OpenInNewWindow="True">
        <Pdf PageWidth="" AllowPrinting="False"></Pdf>
    </ExportSettings>
 
    <MasterTableView DataKeyNames="IDCompilazione">
 
        <RowIndicatorColumn Visible="False">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Created="True">
        </ExpandCollapseColumn>
     
        <Columns>
            <telerik:GridBoundColumn DataField="IDModulo" HeaderText="ID" SortExpression="IDModulo" UniqueName="IDModulo" FilterControlAltText="Filter IDModulo column" Visible="False">
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn DataField="IDCompilazione" HeaderText="ID" SortExpression="IDCompilazione" UniqueName="IDCompilazione" FilterControlAltText="Filter IDCompilazione column" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="NumeroDomanda" HeaderText="#" SortExpression="NumeroDomanda" UniqueName="NumeroDomanda" FilterControlAltText="Filter NumeroDomanda column" Visible="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Data" HeaderText="Data" SortExpression="Data" UniqueName="Data" DataType="System.DateTime" FilterControlAltText="Filter Data column" DataFormatString="{0:dd/MM/yyyy}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Nome" HeaderText="Nome" SortExpression="Nome" UniqueName="Nome" FilterControlAltText="Filter Nome column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Cognome" HeaderText="Cognome" SortExpression="Cognome" UniqueName="Cognome" FilterControlAltText="Filter Cognome column" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CodCorso" HeaderText="Codice CdS" SortExpression="CodCorso" UniqueName="CodCorso" FilterControlAltText="Filter CodCorso column" >
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn HeaderText="Allegati" UniqueName="Allegati" >
            </telerik:GridBoundColumn>
 
            <telerik:GridTemplateColumn HeaderText="Azione" AllowFiltering="false" UniqueName="Azione" Visible="True">
                <ItemTemplate>
                     
                    <telerik:RadButton ID="btnMerge" runat="server" CssClass="rbLeftMargin" Text="Unisce file" ButtonType="StandardButton" ToolTip="unisce i file allegati in un unico PDF" OnClick="btnMerge_Click" CommandArgument='<%# Eval("IDCompilazione").ToString()%>'>
                        <ContentTemplate>
                            <i class="fa fa-compress"></i>
                        </ContentTemplate>
                    </telerik:RadButton>
 
                    <telerik:RadButton ID="btnDownloadFile" runat="server" CssClass="rbLeftMargin" Text="Scarica file" ButtonType="LinkButton" ToolTip="scarica PDF unico" CommandArgument='<%# Eval("IDCompilazione").ToString()%>' Target="_blank" UseSubmitBehavior="False" AutoPostBack="False">
                        <ContentTemplate>
                            <i class="fa fa-file-pdf-o"></i>
                        </ContentTemplate>
                    </telerik:RadButton>
 
                    <telerik:RadButton ID="btnModificaAllegati" runat="server" CssClass="rbLeftMargin" Text="Modifica allegati" ButtonType="LinkButton" ToolTip="modifica allegati" CommandArgument='<%# Eval("IDCompilazione").ToString()%>' Target="_blank" UseSubmitBehavior="False" AutoPostBack="False" OnClientClicked="ShowExistingW">
                        <ContentTemplate>
                            <i class="fa fa-files-o"></i>
                        </ContentTemplate>
                    </telerik:RadButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
     </MasterTableView>
</telerik:RadGrid>

 

Here the code:

protected void rgRichieste_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
     // salva i dati in memoria
    _dt = pc.GetDataTable(_query, connDb);
    // bind
    rgRichieste.DataSource = _dt;
}
 
protected void rgRichieste_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    int i = 0;
 
    string path = Master.targetFolder;
 
    if (e.Item is GridDataItem) // GridDataItem
    {
        GridDataItem item = (GridDataItem)e.Item;
 
        int id = (int)item.OwnerTableView.DataKeyValues[item.ItemIndex]["IDCompilazione"];
        int indiceRiga = item.DataSetIndex;
 
        // link ai file allegati
 
         // IDCorsoDiStudio serve per puntare alla cartella corretta
        string idCdS = _dt.Rows[indiceRiga]["IDCorsoDiStudio"].ToString();
 
        // imposta lista campi in funzione del modulo
        string listaCampi = "";
        int idModulo = Convert.ToInt32(_dt.Rows[indiceRiga]["IDModulo"].ToString());
        if (idModulo == 1)
            listaCampi = ProcComuni.listaCampiNome[0]; //"FileCurriculumVitae,FileBachelorDegree,FilePersonalStatement";
        else
            listaCampi = ProcComuni.listaCampiNome[1]; // "FileDeclarationForm,FileCurriculumVitae,FileResidenceCertificate,FileUniversityDegree,FileAcademicRecord,FileEnglishProficiency,FileIdentityDocument,FileMotivationLetter,FileReferenceLetter1,FileReferenceLetter2,FileOther";
 
        string[] hlFields = listaCampi.Split(new Char[] { ',' });
        int nFields = hlFields.Count<string>();
        // per ogni campo crea il link
        int nCampi = 0;
        foreach (string hlField in hlFields)
        {
            nCampi++;
            string nomeCampo = hlField.Trim();
            // questo valore potrebbe essere a sua volta una lista separata da '|'
            string valoreCampo = _dt.Rows[indiceRiga][nomeCampo].ToString();
 
            if (valoreCampo != "")
            {
                string[] nomiSingoli = valoreCampo.Split(new Char[] { '|' });
 
                int nNomi = 0;
                foreach (string nomeSingolo in nomiSingoli)
                {
                    nNomi++;
                    string nome = nomeSingolo.Trim();
 
                    HyperLink lnkFile = new HyperLink();
                    lnkFile.Text = nome;
                    lnkFile.NavigateUrl = path + idCdS + "/" + lnkFile.Text;
                    lnkFile.Target = "_blank";
 
                    if (nNomi > 1)
                        item["Allegati"].Controls.Add(new LiteralControl(" | "));
 
                    item["Allegati"].Controls.Add(lnkFile);
                }
 
                if (nCampi < nFields)
                    item["Allegati"].Controls.Add(new LiteralControl("<br />"));
            }
        }
 
        // imposta i pulsanti per la gestione del pdf unico
        string fileUnito = _dt.Rows[indiceRiga]["FileUnito"].ToString();
        RadButton rbMerge = (RadButton)item["Azione"].FindControl("btnMerge");
        RadButton rbDownloadFile = (RadButton)item["Azione"].FindControl("btnDownloadFile");
 
        if (idModulo < 2)
        {
            rbMerge.Visible = false;
            rbDownloadFile.Visible = false;
        }
        else
        {
            // modulo 2,3: gestione abilitata
 
            switch (fileUnito)
            {
                case "":
                    rbDownloadFile.Visible = false;
                    break;
 
                case "ERRORE":
                    rbDownloadFile.Visible = false;
                    rbMerge.BackColor = System.Drawing.Color.Bisque;
                    rbMerge.ToolTip = "Ci sono stati problemi nell'ultimo tentativo di unione.";
                    break;
 
                default:
                    rbMerge.Visible = false;
                    rbDownloadFile.NavigateUrl = path + idCdS + "/" + fileUnito;
                    break;
            }
        }
    }
}

 

Vessy
Telerik team
 answered on 02 Dec 2020
1 answer
396 views
Randomly, I'm getting the this error when the tree is getting loaded in Chrome. Never saw this in other browsers, it happens only in chrome.
Doncho
Telerik team
 answered on 01 Dec 2020
3 answers
247 views
Hi,

In my User Control I got a ScriptManagerProxy with a ScriptReference property in which I load a Javascript file.

 

<asp:ScriptManagerProxy ID="smp" runat="server">  
    <Scripts> 
        <asp:ScriptReference Path="~/Scripts/myScript.js" />    
    </Scripts> 
</asp:ScriptManagerProxy> 

This Javascript file contains this function:

 

function onNodeClicked(sender, args) {  
    ...  

Finally, in my User Control, I have a RadTreeView:

<telerik:RadTreeView ID="myTree" runat="server OnClientNodeClicked="onNodeClicked"> 
    ...  
</telerik:RadTreeView> 


This control is loaded dynamically in a aspx page. When I execute this, I receive this message:
                
                            Microsoft JScript runtime error: 'onNodeClicked' is undefined

What's wrong ?



 

 

 

 

Peter Milchev
Telerik team
 answered on 30 Nov 2020
1 answer
958 views

While I am dragging a node from a RadTreeView, I want the page to scroll up or down when the element hits a certain position on either the top or bottom area of the inner height of the page.

The best solution thus far has been this post: https://www.telerik.com/forums/radtreeview-drag-and-drop-scrolling

01.function nodeDragging(sender, args)
02.        {
03.            var container = sender.get_element();
04.            var divYCoord = $telerik.getLocation(container).y;
05. 
06.            var currentYCoord = args.get_domEvent().clientY;
07.            var textbox = $get("textbox");
08.                     
09.            if (currentYCoord > (document.body.clientHeight - 20))
10.                window.scrollBy(0, 20);
11.           
12.            window.status = "document.body.clientHeight:" + document.body.clientHeight + ":currentYCoord:" + currentYCoord + ":document.body.scrollTop:" + document.body.scrollTop + ":iTop:" + (currentYCoord - document.body.scrollTop) + ":" + args.get_domEvent().screenY + ":" + divYCoord;
13.            if(currentYCoord < 20)
14.                window.scrollBy(0, -20);
15.        }

 

I placed a code in a client node dragging function, but the issue is that the scrolling only happens once until I move the cursor again.

I would like to know if there is a way where the page continues to scroll while the dragging tree node remains within an area of the page. 

 

 

 

 

Peter Milchev
Telerik team
 answered on 27 Nov 2020
1 answer
153 views

actually there is a method get_itemIndex(), which would be equivalent to a method set_selectedIndex(index) from RadMultipage or one method like select()
from RadComboBox

How could I implement it or a code javascript would help me a lot

thanks

Peter Milchev
Telerik team
 answered on 27 Nov 2020
1 answer
744 views

 

I have a panel bar in my application. The use case with my application is, I wanted to change the color of Panel bar when my project goes through various stages, Ex: Stage 1,2,3,4. May be like

For Stage 1: Red,

Stage 2: Orange,

Stage 3: Blue,

Stage 4: Green

Is this possible? If possible how to do it.

Thanks,

SC

 

 

 

 

 

Peter Milchev
Telerik team
 answered on 27 Nov 2020
1 answer
140 views

I am looking into the code for our scheduler control and trying to get my head around the data provider approach to binding a scheduler.

I can't seem to find the place where the control is bound with data, before its event handlers are called (e.g. item data bound, data bound, etc.).

I may have overlooked it in the docs since the ones I've found are more introductory, and I couldn't much from the setup article.

Is there a specific place in code where an instance of a scheduler control bound? E.g. scheduler.DataBind() (just for illustrative purposes, we do not use the DataSource property)

Peter Milchev
Telerik team
 answered on 27 Nov 2020
1 answer
377 views
I have a RadDropDownTree. The tree exists within a table and uses a percentage width. If the selected text property is longer than the allowed width, the control just grows to accommodate that text. I need it to cut off the text and just use an ellipsis at the end like text-overflow: ellipsis. Does anyone know how to get this to work for the RadDropDownTree? I don't care about the width of the actual dropdown, just the selected text portion. It looks like that is either rddtFakeInput or rddtInner but neither of those seem to make the text overflow instead of just allowing the control to expand. I cannot use a hard pixel width - it has to be a percentage width.
Peter Milchev
Telerik team
 answered on 27 Nov 2020
3 answers
167 views

Hi..

I'm trying to get radgrid data on radpdfviewer and wanted to print. Is it possible? If yes then how ( recommand code please )? If now then what is another way to print radgrid data only using formatting...

Thank you in advance.

Rumen
Telerik team
 answered on 27 Nov 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?