Thursday, March 28, 2024

How to increase font size of Object Explorer and Grid Result

 > Open SMSS (SQL Server Management Studio)

> Click on Tools

> Click on 'Option'

> Click on 'Font and Color'

> Click on 1st drop down and select 'Grid Result'

> Click on Ok and restart SMSS


For Object explorer increase font, Select  'Environment' instead of 'Grid Result. '

Tuesday, March 26, 2024

Using session How to save value of filters in other page - Search values and save values in session and textbox or dropdown in same values redirected from other page

  public long UserOfficeIdSession

        {

            get { return Convert.ToInt64(Session["UserOfficeId"]); }

            set { Session["UserOfficeId"] = value; }

        }


        public long RoleIdSession

        {

            get { return Convert.ToInt64(Session["RoleId"]); }

            set { Session["RoleId"] = value; }

        }


        public string ApplicationNoSession

        {

            get

            {

                object o = Session["ApplicationNo"];

                return (o == null) ? String.Empty : (string)o;

            }


            set

            {

                Session["ApplicationNo"] = value;

            }

        }


        public string RCNoSession

        {

            get

            {

                object o = Session["RCNo"];

                return (o == null) ? String.Empty : (string)o;

            }


            set

            {

                Session["RCNo"] = value;

            }

            

        }


        public int ApplicationTypeIdSession

        {

            get { return Convert.ToInt32(Session["ApplicationTypeId"]); }

            set { Session["ApplicationTypeId"] = value; }

        }


        public int StatusSession

        {

            get { return Convert.ToInt32(Session["Status"]); }

            set { Session["Status"] = value; }

        }

Friday, March 22, 2024

How to find non match elements from two list of csv files and how to import csv file in SQL - SQL two tables

 > Right click on Database in SQL Server and 

> Click on Task

> Click on Import Flat file

> Select CSV file and it will be saved in table as csv file name.


Now execute query below :-

select * from Courtapp t1 full outer join Dashboard t2 on t1.test = t2.test where t2.test is null


ref:- https://stackoverflow.com/questions/4044919/opposite-of-an-inner-join-query

Telerik Grid Rad grid serial number

 <telerik:GridTemplateColumn HeaderStyle-Font-Bold="true" HeaderText="S.No.">

                                                <ItemTemplate>

                                                       <%#(radGridAppeals.PageSize * radGridAppeals.CurrentPageIndex) + (Container.ItemIndex + 1)%>

                                                </ItemTemplate>

                                            </telerik:GridTemplateColumn>

Thursday, March 21, 2024

How to disable linkbutton in ASP.NET - in Grid - Hyperlink Style cssclass

 LinkButton lnkAppCNRno = Item.FindControl("lnkAppCNRNo") as LinkButton;

                if (string.IsNullOrWhiteSpace(lnkAppCNRno.Text))

                {

                    lnkAppCNRno.Text = Unavailable;

                    lnkAppCNRno.Enabled = false;

                    lnkAppCNRno.Style.Add("color", "red");

                    

                    lnkAppCNRno.Attributes.CssStyle[HtmlTextWriterStyle.BackgroundColor] = "unset !important";

                    lnkAppCNRno.Attributes.CssStyle[HtmlTextWriterStyle.TextDecoration] = "none";

                    lnkAppCNRno.Attributes.CssStyle[HtmlTextWriterStyle.Cursor] = "default";

                    

                }


ref:- https://docs.telerik.com/devtools/aspnet-ajax/knowledge-base/common-disable-link-button-completely


https://www.codeproject.com/Questions/295591/how-to-set-linkbutton-enable-false-in-csharp-net

Wednesday, March 20, 2024

How to change color in Mobile Android - Color to Black and white

 Search in settings and click on "Greyscale" or "Use color correction"

How to change color in window 11 - Change color in Windows 11

 > First click on Start button

> Search for "Intel graphics command center"

>Click on Display>Color and than saturation


or search for color filter


or use 

window + ctrl + C for enable or disable color filters.

Tuesday, March 19, 2024

How to Get all the data from database to Textbox and Dropdowns - For single row

  PageUtils.BindDropDownListFromLookup(ref ddlOverallResult, EnumLookupType.CourtApplicationResult);

            LoadCourtList();


            CourtApplicationDisposalsDTO courtApplicationDisposalsDTO = null;


            using (var client = ServiceClient<ICourtApplicationManager>.Create(ObjectConstants.CourtApplicationManager))

            {

                courtApplicationDisposalsDTO = new CourtApplicationDisposalsDTO();

                courtApplicationDisposalsDTO = client.Instance.GetCourtApplicationDisposals(ApplicationId);

            }


            //SET UI Controls


            if (courtApplicationDisposalsDTO != null && courtApplicationDisposalsDTO.DisposalsId > 0)

            {

                DisposalsId = courtApplicationDisposalsDTO.DisposalsId;


                if (courtApplicationDisposalsDTO.DtFinalJudOrder != null)

                {

                    txtDateOfFinalJudgement.Text = courtApplicationDisposalsDTO.DtFinalJudOrder.Value.ToShortDateString();

                }

                ddlCourtNames.SelectedValue = courtApplicationDisposalsDTO.CourtId.ToString();

                ddlOverallResult.SelectedValue = courtApplicationDisposalsDTO.CourtResult.ToString();            

            }

How to save data on save button in ASP.NET C# With Model (DTO) - Insert Or Update

 if (ApplicationId > 0)

                {

                    string Message = string.Empty;


                    CourtApplicationDisposalsDTO courtApplicationDisposalsDTO = new CourtApplicationDisposalsDTO();


                    if (courtApplicationDisposalsDTO != null)

                    {

                        courtApplicationDisposalsDTO.DisposalsId = DisposalsId;

                        courtApplicationDisposalsDTO.ApplicationId = ApplicationId;


                        if (!string.IsNullOrWhiteSpace(txtDateOfFinalJudgement.Text))

                        {

                            courtApplicationDisposalsDTO.DtFinalJudOrder = Convert.ToDateTime(txtDateOfFinalJudgement.Text);


                            //set disposal based on final order date

                            courtApplicationDisposalsDTO.IsDisposed = true;

                        }

                        else

                        {

                            courtApplicationDisposalsDTO.IsDisposed = false;

                        }


                        if (Convert.ToInt64(ddlCourtNames.SelectedValue) > 0)

                        {

                            courtApplicationDisposalsDTO.CourtId = Convert.ToInt64(ddlCourtNames.SelectedValue);

                        }


                        if (Convert.ToInt64(ddlOverallResult.SelectedValue) > 0)

                        {

                            courtApplicationDisposalsDTO.CourtResult = Convert.ToInt64(ddlOverallResult.SelectedValue);

                        }

                        //Update

                        if (courtApplicationDisposalsDTO.DisposalsId > 0)

                        {


                            courtApplicationDisposalsDTO.UpdatedBy = CurrentUser.UserId;

                            courtApplicationDisposalsDTO.UpdatedIPAddress = CurrentUser.IpAddress;


                            Message = "Disposal Details Updated Successfully";

                        }

                        else//Insert

                        {


                            courtApplicationDisposalsDTO.CreatedBy = CurrentUser.UserId;

                            courtApplicationDisposalsDTO.CreatedIPAddress = CurrentUser.IpAddress;

                            Message = "Disposal Details saved Successfully";

                        }


                        //Insert or Update

                        long retDisposalsId = 0;

                        using (var client = ServiceClient<ICourtApplicationManager>.Create(ObjectConstants.CourtApplicationManager))

                        {

                            retDisposalsId = client.Instance.InsertOrUpdateCourtApplicationDisposals(courtApplicationDisposalsDTO);


                        }


                        if (retDisposalsId > 0)

                        {

                            SetFadeMesssage(Message);

                        }

                        else

                        {

                            SetModalPopupMesssage("Error", "Disposal Details Failed to Save...");

                        }


                        DisposalsId = retDisposalsId;


                        //Refresh UI.

                        LoadUI();

                    }

                }

                else

                {

                    SetModalPopupMesssage("Error", "No Application Found...");

                }

Tuesday, March 12, 2024

Rad Combobox Loader or please wait not showing when selected index changed - Telerik Rad combobox

 <telerik:RadComboBox ID="ddlRCNo" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlRCNo_SelectedIndexChanged"  InitialValue="0" CssClass="uk-width-1-2" Filter="Contains" CheckBoxes="false" EnableCheckAllItemsCheckBox="false" Style="width: 50% !important;">

                                                            <Localization CheckAllString="Select All" />

                                                        </telerik:RadComboBox>

remove property ClientIDMode="Static" 


ASP.NET Texbox Autocomplete Off

<asp:TextBox ID="txtDateOfForwardingProposalToHO" runat="server" class="uk-width-1-2 form-control-sm datepickerIcon" MaxLength="16" AutoCompleteType="Disabled" onclick="judgementOrderDate(this.id)"/>



AutoCompleteType="Disabled"

or

autocomplete="off" in textbox


reference:- https://www.c-sharpcorner.com/blogs/disable-autocomplete-textbox-in-your-website

Grid data bound column empty text change Telerik - GridBoundColumn Text color change

 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 

    if (e.Item is GridDataItem) 

    { 

        GridDataItem item = (GridDataItem)e.Item; 

        item["ColumnUniqueName"].Style.Add("Color","Red"); 

    } 


 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 

GridDataItem item = (GridDataItem)Item;

                if (item["boundColumnApplicationSubject"].Text == Unavailable)

                {

                    item["boundColumnApplicationSubject"].Style.Add("Color", "Red");

                }

}

<telerik:GridBoundColumn HeaderStyle-Font-Bold="true" HeaderText="Subject" DataField="ApplicationSubject" UniqueName="boundColumnApplicationSubject" />


reference:- https://www.telerik.com/forums/change-text-color-on-gridboundcolum


Monday, March 11, 2024

Why Ctrl P on Websites not giving correct layout to A4 sheets

 Because websites are in landscape layout and A4 sheets are in portrait so layout goes wrong.

How to make my computer as home screen in window 10 windows explorer

 > Open Windows explorer

> Click on 3 dots option

>Click on Option

> Click general tab

> Click on dropdown 'Open File Explorer' to 'This PC'

Saturday, March 9, 2024

Telerik print Div javascirpt client side

 var content = $get("contentHolder").innerHTML;

var pwin = window.open('', 'print_content', 'width=300,height=300');

pwin.document.open();

pwin.document.write('<html><body onload="window.print()">' + content + '</body></html>');

pwin.document.close();

setTimeout(function () { pwin.close(); }, 1000);

Javascript window Print

   Telerik.Web.UI.Editor.CommandList["Print"] = function (commandName, editor, args) {

        var prtContent = editor.get_contentArea();

        var WinPrint = window.open('', '', 'left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0');

        WinPrint.document.write(prtContent.innerHTML);

        WinPrint.document.close();

        WinPrint.focus();

        WinPrint.print();

        setTimeout(function () {

            WinPrint.close();

        }, 1000);


    };

Export to PDF with Telerik javascript

 function exportElement() {


    var exp = $find("<%= RadClientExportManager1.ClientID %>");

    var divtoPrint = $telerik.$("#divtoPrint");

    var originalWidth = divtoPrint.width();

    divtoPrint.width("1000px")

    // https://www.telerik.com/support/kb/aspnet-ajax/gauge/details/radgauge-with-display-none-does-not-render-properly

    $telerik.$("#divtoPrint").find(".RadHtmlChart").each(function (index, elem) {

        if (elem && elem.control && elem.control.repaint) {

            elem.control.repaint();

        }

    });

  

    exp.exportPDF($telerik.$("#divtoPrint"));

}

Export to PDF with javascript


<script>

/* function exportexcel(){

//getting data from our div that contains the HTML table

/* var data_type = 'data:application/vnd.ms-excel';

var table_div = document.getElementById('skillreport1');

var table_html = table_div.outerHTML.replace(/ /g, '%20');

window.open(data_type + ', ' + table_html);

} */

$(document).ready(function() {

    $("#btnExport").click(function(e) {

        //getting values of current time for generating the file name

        var dt = new Date();

        var day = dt.getDate();

        var month = dt.getMonth() + 1;

        var year = dt.getFullYear();

        var hour = dt.getHours();

        var mins = dt.getMinutes();

        var postfix = day + "." + month + "." + year + "_" + hour + "." + mins;

        //creating a temporary HTML link element (they support setting file names)

        var a = document.createElement('a');

document.body.appendChild(a);

        //getting data from our div that contains the HTML table

        var data_type = 'data:application/vnd.ms-excel';

        var table_div = document.getElementById('skillreport');

        var table_html = table_div.outerHTML.replace(/ /g, '%20');

        a.href = data_type + ', ' + table_html;

        //setting the file name

        a.download = 'exported_table_' + postfix + '.xls';

        //triggering the function

        a.click();

        //just in case, prevent default behaviour

        e.preventDefault();

    });

});

Thursday, March 7, 2024

Telerik Rad Editor - Export to PDF

 https://demos.telerik.com/aspnet-ajax/editor/examples/import-export/pdf-export/defaultcs.aspx

Telerik rad PDF viewer

 https://demos.telerik.com/aspnet-ajax/pdfviewer/overview/defaultcs.aspx

Window in telerik - Telerik rad window

 https://demos.telerik.com/aspnet-ajax/window/examples/overview/defaultcs.aspx

How to Print Div or Print Element or Print Panel with Javascript and ASP.NET

 <script type="text/javascript">


       

        function PrintPanel() {

            var panel = document.getElementById("<%=div_print.ClientID %>");

            var printWindow = window.open('', '', 'height=700,width=800');

            printWindow.document.write(panel.innerHTML);

            printWindow.document.close();

            setTimeout(function () {

                printWindow.print();

            }, 500);

            return false;

        }

        function PrintElem() {

            debugger;

            var panel = document.getElementById("<%=div_print.ClientID %>");

            var mywindow = window.open('', 'PRINT', 'height=400,width=600');


            mywindow.document.write('<html><head><title>' + document.title + '</title>');

            mywindow.document.write('</head><body >');

            mywindow.document.write('<h1>' + document.title + '</h1>');

            mywindow.document.write(panel.innerHTML);

            mywindow.document.write('</body></html>');


            mywindow.document.close(); // necessary for IE >= 10

            mywindow.focus(); // necessary for IE >= 10*/


            mywindow.print();

            mywindow.close();


            return true;

        }

    </script>




and calling of Javascript function in ASP.NET

protected void btnPrint_Click(object sender, EventArgs e)

        {

            if (string.IsNullOrEmpty(txtFileNumber.Text))

            {

                return;

            }

            LoadReport();

            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Javascript", "javascript:PrintPanel(); ", true);

        }

How to convert div to PDF with Nreco

  if (string.IsNullOrEmpty(txtFileNumber.Text))

            {

                return;

            }

            LoadReport();


            var sb1 = new StringBuilder();

            var sb2 = new StringBuilder();

            var sb = new StringBuilder();


            sb1.Append("<html>");

            sb1.Append("<head>");

            sb1.Append("<meta http-equiv='content-type' content='text/html; charset=utf-8'/>");

            sb1.Append("<style>");

            sb1.Append(strPrintCSS);

            sb1.Append("</style></head><body>");


            try

            {

                div_print.RenderControl(new HtmlTextWriter(new StringWriter(sb)));

            }

            catch (Exception ex)

            {

                ProcessException(ex);

            }


            sb2.Append("</body></html>");


            var htmlContent = sb1.ToString() + sb.ToString() + sb2.ToString();


            var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();

            byte[] bytes = htmlToPdf.GeneratePdf(htmlContent);


            string fileNumber = String.Concat(txtFileNumber.Text.Where(c => !Char.IsWhiteSpace(c)));


            Response.Clear();

            MemoryStream ms = new MemoryStream(bytes);

            Response.ContentType = "application/pdf";

            Response.AddHeader("content-disposition", "attachment;filename=" + fileNumber + ".pdf");

            Response.Buffer = true;

            ms.WriteTo(Response.OutputStream);

            btnFileMetaDataDownload.Enabled = true;

            btnSave.Enabled = true;

            btnClear.Enabled = true;

            formUpdatePanel.Update();

            PrintUpdatePanel.Update();

            Response.End();

        }


        #region PrintCSS


        public const string strPrintCSS = "table,td,th{border:solid 1px #ddd;padding:5px 5px}";

How to convert div to PDF with Itextsharp without font size change

 DataTable dt = new DataTable();

          

            dt = ObjBAL.GetBudgetCompilationRptDetails(ddlfinancialyr.SelectedValue);


            iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4_LANDSCAPE, 10f, 10f, 10, 0f);

            //PdfPTable table1 = new PdfPTable(3);

            //table1.HorizontalAlignment = 0;

            //table1.WidthPercentage = 100;

            //table1.SetWidths(new float[] { 5, 15, 15 });  // then set the column's __relative__ widths

            //table1.SpacingAfter = 40f;

            //table1.SpacingBefore = 20f;


            //table1.AddCell("S.No");

            //table1.AddCell("Name");

            //table1.AddCell("PNR No");


            //foreach (DataRow row in dt.Rows)

            //{

            //    table1.AddCell(new Phrase(row["RowNumber"].ToString()));

            //    table1.AddCell(new Phrase(row["PassengerName"].ToString()));

            //    table1.AddCell(new Phrase(row["PnrNo"].ToString()));

            //}


            if (dt.Rows.Count > 0)

            {

                //Create a dummy GridView

                GridView GridView1 = new GridView();

                GridView1.AllowPaging = false;

                GridView1.DataSource = dt;

                GridView1.DataBind();


                Response.ContentType = "application/pdf";

                Response.AddHeader("content-disposition", "attachment;filename=BudgetCompilationRpt.pdf");

                Response.Cache.SetCacheability(HttpCacheability.NoCache);

                StringWriter sw = new StringWriter();

                HtmlTextWriter hw = new HtmlTextWriter(sw);

                GridView1.RenderControl(hw);

                StringReader sr = new StringReader(sw.ToString());

                // Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);



                HTMLWorker htmlparser = new HTMLWorker(pdfDoc);

                PdfWriter.GetInstance(pdfDoc, Response.OutputStream);

                pdfDoc.Open();

                htmlparser.Parse(sr);

                pdfDoc.Close();

                Response.Write(pdfDoc);

                Response.End();

            }

            else

            {

                //string strSuccessMsg = "Data Not Saved. Some error occured while saving the data.";

                //ScriptManager.RegisterStartupScript(formUpdatePanel, formUpdatePanel.GetType(), Guid.NewGuid().ToString(), String.Format("OpenMessageNotification('" + strSuccessMsg + "'); "), true);

            }



reference:-https://www.c-sharpcorner.com/UploadFile/raj1979/export-div-content-to-pdf-using-itextsharp/

How to export div to PDF in Telerik

 https://docs.telerik.com/devtools/aspnet-ajax/controls/clientexportmanager/functionality/export-html-elements


 function exportPdfOnClient() {

        var editorHtml = $find("<%=RadEditor1.ClientID%>").get_html(true);

        var dummyContainer = $telerik.$("#dummyContentWrapper");

        dummyContainer.html(editorHtml);

        $find("<%=RadClientExportManager1.ClientID%>").exportPDF(dummyContainer);

        dummyContainer.html("");

    }

How to resolve error getting error 'must be placed inside a form tag with runat=server', but it is

 public override void VerifyRenderingInServerForm(Control control)


        {


            /* Verifies that the control is rendered */


        }

How to find element id with jquery Javascript - ClientID - Find id of textbox (server side) in javascript - Find server control in JS file

Server side control

 $find("<%= RadClientExportManager1.ClientID %>");

in aspx page or aspx javascript script section

$("#<%=divViewProfile.ClientID %>")


in js file

$('[id$=hfUserVsRoleValue]').val

===================

client side control

$("#divViewProfile")


in javascript client side control

==================================

document.getElementById('ContentBody_hfUserVsRoleValue')

reference:- https://stackoverflow.com/questions/16147288/not-getting-clientid-in-asp-net


https://www.aspsnippets.com/Articles/1018/Get-Client-ID-of-ASPNet-control-in-JavaScript-and-jQuery/#:~:text=return%20%24(%22%5Bid%24%3D%22,of%20any%20ASP.Net%20control.

Wednesday, March 6, 2024

How to download a file in asp.net c# linkbutton

aspx

 string filePath = (sender as LinkButton).CommandArgument;

            Response.ContentType = ContentType;

            Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(filePath));

            Response.WriteFile(filePath);

            Response.End();

aspx.cs

Tuesday, March 5, 2024

How to make a list of Viewstate in ASP.NET

 List<CourtApplicationDTO> FilteredAppealList { set { ViewState["FilteredAppealList"] = value; } get { return (List<CourtApplicationDTO>)(ViewState["FilteredAppealList"]); } }

Telerik Grid Page size, page index and need datasource events

In telerik grid, we have to just give data source

 protected void radGridAppeals_PageIndexChanged(object sender, GridPageChangedEventArgs e)

        {

            

            this.radGridAppeals.DataSource = FilteredAppealList;

        }


               protected void radGridAppeals_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)

        {

            

            this.radGridAppeals.DataSource = FilteredAppealList;


        }


Also we dont need to add e.new page size or e.newpageindex And we also need virtualitemcount may be


OR we can use NeedDataSource instead of the above functions

        protected void radGridAppeals_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)

        {

            this.radGridAppeals.DataSource = FilteredAppealList;

        }

Telerik Grid Edit update delete Pageindex changed , pagesize changed Paging

cs file


 public static T GetAllDraftPreliminaryEnquiryByOfficeIDUserIDWithPaging<T>(long officeId, long currentUserID, int pageIndex, int pageSize)

        {

            try

            {

                using (var connection = ConnectionManager.Create(ConnectionManager.ConnectTo.CBIConnection))

                {

                    IDbCommand command = new SqlCommand("SSP_GetAllDraftPreliminaryEnquiryByOfficeIDUserIDWithPaging", connection);

                    command.CommandType = CommandType.StoredProcedure;



                    command.Parameters.Add(new SqlParameter("@officeId", SqlDbType.BigInt)

                    {

                        Value = officeId

                    });


                    command.Parameters.Add(new SqlParameter("@CurrentUserID", SqlDbType.BigInt)

                    {

                        Value = currentUserID

                    });

                    command.Parameters.Add(new SqlParameter("@PageIndex", SqlDbType.Int)

                    {

                        Value = pageIndex

                    });

                    command.Parameters.Add(new SqlParameter("@PageSize", SqlDbType.Int)

                    {

                        Value = pageSize

                    });


                    connection.Open();


                    return DBHelper.Execute<T>(ref command);

                }

            }

            catch (Exception ex)

            {

                //DataAccessExceptionHandler.HandleException(ref ex);

            }

            return default(T);

        }


--------------------aspx file


<%@ Page Title="Draft Preliminary Enquiry" Language="C#" MasterPageFile="~/CBILayout.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="DraftPreliminaryEnquiryMigration.aspx.cs" Inherits="CBI.Portal.DraftPreliminaryEnquiryMigration" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <style type="text/css">

     .RadGrid_Default .rgSelectedRow a {

            color: #428bca !important

        }

    .grid {

            overflow: auto;

            overflow-x: hidden;

        }


            .grid table tr td {

                word-break: break-all !important;

                text-align: left;

                letter-spacing: 0;

                color: #676767;

                opacity: 1;

                font-size: small;

                padding: 5px !important;

                vertical-align: top;

                line-height: 15px;

            }


        .RadGrid_Default .rgHeader {

            font: 12px Open Sans !important;

            /*font-size: 14px !important;*/

            color: #FFFFFF !important;

            background: #8E8B8B 0% 0% no-repeat padding-box !important;

        }


        .checked {

            color: red;

            display: block;

        }

Monday, March 4, 2024

Radgrid Telerik grid export to PDF

 https://www.telerik.com/blogs/how-to-format-radgrid-pdfs


https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/pdf

https://docs.telerik.com/devtools/aspnet-ajax/knowledge-base/grid-customize-content-when-exporting-radgrid-to-pdf


https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/overview


https://www.telerik.com/forums/export-to-pdf-and-save-programmatically


https://www.telerik.com/blogs/how-to-export-grid-to-pdf-file-and-show-the-result-using-the-window?-gl=1*bugbjp*-ga*Mjg3MjEwMjA2LjE3MDc3Mjc0NTU.*-ga-9JSNBCSF54*MTcwOTU0NjIzMi4xMC4xLjE3MDk1NTIyNzAuNjAuMC4w*-gcl-au*MTI1MjY4NjIzNC4xNzA3NzI3NDU1

Telerik Rad Grid Item command


aspx file

  <telerik:RadGrid runat="server" ID="radGridOtherPet" ClientSettings-EnableRowHoverStyle="true" OnItemDataBound="radGridOtherPet_ItemDataBound" ShowHeader="true" EnableEmbeddedBaseStylesheet="True"  OnItemCommand="radGrid_ItemCommand"



aspx.cs file

 protected void radGrid_ItemCommand(object sender, GridCommandEventArgs e)

        {

            if (e.CommandName == "Edit")

            {

                Response.Redirect(CourtApplication.Constants.EditUrl + "?ApplicationId=" + CryptologyFunctions.Encrypt(e.CommandArgument.ToString()));


            }


            if (e.CommandName == "Select")

            {

                Response.Redirect(CourtApplication.Constants.ViewProfileUrl + "?ApplicationId=" + CryptologyFunctions.Encrypt(e.CommandArgument.ToString()));


            }


        }