Rad Grid Export To Excel

65 posts, 0 answers
  1. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 23 Jun 2014 in reply to Asutosh Link to this post

    Ashutosh

    Problem seems to be solved

    When needdatasouruce is called then value of dv.value = 1 so it will exit sub

    then on button click

    dv.value=2
    grid.visible = true
    grid.rebind() This will call need datasource again and this time the dv.value = 2 so it wall the database

    Now at end of the recordset

    Me.session("grd") = rs

    next time when it comes in need datasource then it will read from session object so will be faster


    Regards

  2. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 23 Jun 2014 in reply to SANJAY Link to this post

    It is ok

    Post the code of aspx page and vb file here and I will make the necessary changes and sent to you

    Regards
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 23 Jun 2014 in reply to Asutosh Link to this post

    my .aspx file code
          <div id="firstgrid" runat="server" visible="false">

                                                                <telerik:RadGrid ID="grd_firstchart_aco" runat="server" Width="99.5%" ShowStatusBar="true" AutoGenerateColumns="false"
                                                                    AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="false" Skin="Silk"
                                                                    OnDetailTableDataBind="grd_firstchart_aco_DetailTableDataBind">
                                                                    <GroupingSettings CaseSensitive="false" />
                                                                    <PagerStyle Mode="Slider"></PagerStyle>
                                                                    <MasterTableView Width="100%" DataKeyNames="Gender,ACoId" AllowMultiColumnSorting="True">
                                                                        <DetailTables>
                                                                            <telerik:GridTableView Name="" Width="100%" AllowFilteringByColumn="true" PageSize="10" AllowPaging="true">
                                                                                <Columns>
                                                                                    <telerik:GridBoundColumn SortExpression="Benehicno" HeaderText="Hic No." HeaderButtonType="TextButton"
                                                                                        DataField="Benehicno">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn SortExpression="BeneName" HeaderText="Patient Name" HeaderButtonType="TextButton"
                                                                                        DataField="BeneName">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn SortExpression="State" HeaderText="State" HeaderButtonType="TextButton"
                                                                                        DataField="State">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn SortExpression="County" HeaderText="County" HeaderButtonType="TextButton"
                                                                                        DataField="County">
                                                                                    </telerik:GridBoundColumn>
                                                                                </Columns>
                                                                            </telerik:GridTableView>
                                                                        </DetailTables>
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn SortExpression="ACoId" HeaderText="ACoId" HeaderButtonType="TextButton"
                                                                                DataField="ACoId">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn SortExpression="Gender" HeaderText="Gender" HeaderButtonType="TextButton"
                                                                                DataField="Gender">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn SortExpression="CountBenehicNo" HeaderText="Count" HeaderButtonType="TextButton"
                                                                                DataField="CountBenehicNo">
                                                                            </telerik:GridBoundColumn>

                                                                        </Columns>
                                                                    </MasterTableView>
                                                                </telerik:RadGrid>
                                                            </div>


    my aspx.cs file code as below
     public void load_first_graph(string where)//for aco
        {
            try
            {
                pie.Visible = true;
                stackbar.Visible = false;
                string where1 = check_user();
                if (!string.IsNullOrEmpty(where))
                {
                    where1 = where1 + " and " + where;
                }
                ViewState["count_check"] = 0;
                ViewState["first_grp"] = "group";
                hdnfield_firstchartclick.Value = "group";
                DataTable table1 = new DataTable();
                int id = 1;
                table1 = _obj_360PatientPopulationProfiledal.Fetch_All_patient_data_For_AllD(where1, id);
                Active_patient_count_chart.DataSource = table1;
                Active_patient_count_chart.PlotArea.XAxis.DataLabelsField = "AcoId";
                Active_patient_count_chart.PlotArea.Series[0].DataFieldY = "CountBenehicNo";
                Active_patient_count_chart.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = "Active Patient Gender : " + "#= dataItem.Gender#" + ",</br> Total Count:" + "#= dataItem.CountBenehicNo#";

                // ViewState["Favorite_Query_Activepatientcount"] = "select CountBenehicNo=count(distinct ba.benehicno),ba.ACoId,Gender=case when SexCd=1 then 'M' else 'F' end from [dbo].[BeneficiaryAcoPhysicianRel] ba  inner join [dbo].[Beneficiary_Details] bd on ba.BenehicNo=bd.benehicno " + where1 + " group by ba.ACoId , case when SexCd=1 then 'M' else 'F' end order by AcoId";
                ViewState["Favorite_Query_Activepatientcount"] = "select DisplayData=count(distinct ba.benehicno),ba.ACoId as DisplayName,ba.Gender as [Group] from [dbo].[BeneficiaryAcoPhysicianRel] ba inner join [ACOData].[BeneCohortdata] bc on bc.benehicno=ba.benehicno " + where1 + " group by ba.ACoId , gender order by DisplayName"; ;
                ViewState["Favorite_ChartType_Activepatientcount"] = "PIE-STACKBARCHART";
                lblactivepatientcountheader.Text = "Active Patient Count by Gender by ACO";
                lblactivepatientcountheader.ToolTip = "Active Patient Count by Gender by ACO";

                patient_pop_profile_grdfirstgraph.DataSource = table1;
                patient_pop_profile_grdfirstgraph.DataBind();
                DataConvert_gridfisrt.DataSource = table1;
                DataConvert_gridfisrt.DataBind();

                int chekfavt = chekfavourite_filter(lblactivepatientcountheader.Text.ToString());
                if (chekfavt == 1)
                {
                    btn_Favtchart_ActivePatientCountByGender_Grey.Visible = false;
                    btn_Favtchart_ActivePatientCountByGender_Yellow.Visible = true;
                }
                else
                {
                    btn_Favtchart_ActivePatientCountByGender_Grey.Visible = true;
                    btn_Favtchart_ActivePatientCountByGender_Yellow.Visible = false;
                }

               
              //  this.GridGroupingControl1.DataSourceControlRowUpdating += new GridDataSourceControlRowUpdateEventHandler(this.RowUpdating);

               

                grd_firstchart_aco.DataSource = table1;
                grd_firstchart_aco.DataBind();

                UpdatePanel6.Update();
                updtpnlfirst_chart.Update();

            }
            catch (Exception ex)
            {
                throw ex;
            }

        }


      protected void grd_third_aco_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

            string where = null;

            string AcoId = dataItem.GetDataKeyValue("acoid").ToString();
            string filter = Convert.ToString(ViewState["patient_population_filter"]);
            if (string.IsNullOrEmpty(filter))
            {
                where = " where ba.acoid ='" + AcoId + "'";
            }
            else
            {
                where = " where ba.acoid ='" + AcoId + "' and " + filter;
            }
            Div_secondchart_firstgrid.Visible = true;
            Div_secondchart_secondgrid.Visible = false;
            Div_secondchart_thirdgrid.Visible = false;
            DataTable _dt1 = new DataTable();
            _dt1 = _obj_360PatientPopulationProfiledal.Fetch_All_Patient_Data_ThirdChart(where, 1);
            if (_dt1.Rows.Count > 0)
            {
                e.DetailTableView.DataSource = _dt1;

            }
            ScriptManager.RegisterStartupScript(this, typeof(Page), "Testing", "lnk_PatientAverageRiskScorebyYearbyACO_Showdata();", true);
            upd_third_data.Update();
        }

  5. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 23 Jun 2014 in reply to Kostadin Link to this post

    hi kistdian
    i have attached my complete schenarion here
    can you tell me how i can use onneed datasource for gridview to excel export in my schenario

    .aspx.cs code
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;

    public partial class radgridchartdemo : System.Web.UI.Page
    {

        _360PatientPopulationProfiledal _obj_360PatientPopulationProfiledal = new _360PatientPopulationProfiledal();
        User_Chart_FavoriteDAL _objUser_Chart_FavoriteDAL = new User_Chart_FavoriteDAL();
        FinancialPerformanceDAL _objFinancialPerformanceDAL = new FinancialPerformanceDAL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                fill_filter_of_group();
                fill_Costby_Genderby_Chronic_Disease_Aco(null, null, null);
            }

        }
        public void fill_Costby_Genderby_Chronic_Disease_Aco(string usertype, string wherecondition, string whereForPopup)
        {
            try
            {
                string user = null;
                string _where = null;
                int id = 0;
                string usertype_fourth = null;
                if (string.IsNullOrEmpty(usertype) && string.IsNullOrEmpty(wherecondition))
                {

                    if (Session["AcoManager"] != null)   // For AcoManager Login  
                    {
                        string acoid = Session["AcoManager"].ToString();
                        user = "where ba.Acoid ='" + acoid + "'";
                        id = 1;
                        usertype_fourth = "aco";
                    }
                    else if (Session["rolename"].ToString() == "ACOADMIN") // For Aco Login 
                    {
                        string acoid = Session["ACOid"].ToString();
                        user = "where ba.AcoId ='" + acoid + "'";
                        id = 1;
                        usertype_fourth = "aco";
                    }
                    else if (Session["rolename"].ToString() == "PHYSICIAN")  // for participents 
                    {
                        string acoid = Session["ACOParID"].ToString();
                        string query = "select ACOParNPI from [dbo].ACOParicipants where ACOPariD = '" + acoid + "'";
                        DataTable _dt = new DataTable();
                        _dt = _objUser_Chart_FavoriteDAL.FetchAll(query);
                        string acoparnpi = _dt.Rows[0]["ACOParNPI"].ToString();
                        user = "where ba.ACOParNPI ='" + acoparnpi + "'";
                        id = 3;
                        usertype_fourth = "participant";
                    }
                    else if (Session["rolename"].ToString() == "ACOPARTICIPANTSGROUP")  // for participents group
                    {
                        string grpname = Session["group_tinlegalbuisenessname"].ToString();


                        user = "where TIN_LegalBusinessName ='" + grpname + "'";
                        id = 2;
                        usertype_fourth = "group";
                    }
                    else // For Idesigns 
                    {
                        // When No chenge in Dropdown 


                    }
                    _where = user;
                }
                else
                {
                    if (usertype == "participant")  // for participents 
                    {
                        string query = "select ACOParNpi from [dbo].[ACOParicipants] where ACOPARFIRSTNAME+' '+AcoParLastName ='" + wherecondition + "'";
                        DataTable _dt = new DataTable();
                        _dt = _objUser_Chart_FavoriteDAL.FetchAll(query);
                        string acoparnpi = _dt.Rows[0]["ACOParNPI"].ToString();
                        user = "where ba.ACOParNPI ='" + acoparnpi + "'";
                        usertype_fourth = "participant";
                        id = 3;

                    }
                    else if (usertype == "group")  // for participents group
                    {
                        string grpname = wherecondition;


                        user = "where TIN_LegalBusinessName ='" + grpname + "'";
                        id = 2;
                        usertype_fourth = "group";

                    }
                    else // For Idesigns 
                    {
                        // When No chenge in Dropdown 


                    }
                    _where = user;
                }
                DataTable table1 = new DataTable();
                table1 = _obj_360PatientPopulationProfiledal.Fetch_All_Costby_Genderby_Chronic_Disease(_where, id);

                Costby_Gendeby_Chronic_Disease_Chart.DataSource = table1;
                Costby_Gendeby_Chronic_Disease_Chart.PlotArea.XAxis.DataLabelsField = "CohortName";
                Costby_Gendeby_Chronic_Disease_Chart.PlotArea.Series[0].DataFieldY = "TotalCost";
                Costby_Gendeby_Chronic_Disease_Chart.PlotArea.Series[0].TooltipsAppearance.ClientTemplate = "#= dataItem.CohortName#" + ",</br> Cost: $" + "#= dataItem.TotalCost#";
            

                if (usertype_fourth == "aco")
                {
                    grd_forth_aco.DataSource = table1;
                    //  grd_forth_aco.DataBind();
                    Div_fourth_aco.Visible = true;
                    Div_fourth_group.Visible = false;
                    div_fourth_participant.Visible = false;
                }
                else if (usertype_fourth == "group")
                {
                    grd_fourth_group.DataSource = table1;
                    grd_fourth_group.DataBind();
                    Div_fourth_aco.Visible = false;
                    Div_fourth_group.Visible = true;
                    div_fourth_participant.Visible = false;
                }
                else if (usertype_fourth == "participant")
                {
                    grd_fourth_participant.DataSource = table1;
                    grd_fourth_participant.DataBind();
                    Div_fourth_aco.Visible = false;
                    Div_fourth_group.Visible = false;
                    div_fourth_participant.Visible = true;
                }
    //frogrp


            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        protected void grd_forth_aco_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

            string where = null;
            string CohortName = dataItem.GetDataKeyValue("CohortName").ToString();
            string AcoId = dataItem.GetDataKeyValue("AcoId").ToString();
            where = "where ba.AcoId='" + AcoId + "' and ba.CohortName = '" + CohortName + "'";


            DataTable _dt1 = new DataTable();
            _dt1 = _objFinancialPerformanceDAL.Fetch_All_Patient_Data_fourthChart(where, 1);
            if (_dt1.Rows.Count > 0)
            {
                e.DetailTableView.DataSource = _dt1;

            }

            ScriptManager.RegisterStartupScript(this, typeof(Page), "Testing", "lnk_Costby_Gendeby_Chronic_Disease_showchart();", true);
        }
        protected void grd_fourth_participant_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

            string where = null;

            string CohortName = dataItem.GetDataKeyValue("CohortName").ToString();
            string ACOParName = dataItem.GetDataKeyValue("AcoParName").ToString();
            where = " where ba.ACOParName ='" + ACOParName + "' and ba.CohortName = '" + CohortName + "'";



            DataTable _dt1 = new DataTable();
            _dt1 = _objFinancialPerformanceDAL.Fetch_All_Patient_Data_fourthChart(where, 3);
            if (_dt1.Rows.Count > 0)
            {
                e.DetailTableView.DataSource = _dt1;

            }

            ScriptManager.RegisterStartupScript(this, typeof(Page), "Testing", "lnk_Costby_Gendeby_Chronic_Disease_showchart();", true);
        }
        protected void grd_fourth_group_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

            string where = null;

            string CohortName = dataItem.GetDataKeyValue("CohortName").ToString();
            string groupname = dataItem.GetDataKeyValue("TIN_LegalBusinessName").ToString();
            where = " where TIN_LegalBusinessName='" + groupname + "' and ba.CohortName = '" + CohortName + "'";


            DataTable _dt1 = new DataTable();
            _dt1 = _objFinancialPerformanceDAL.Fetch_All_Patient_Data_fourthChart(where, 2);
            if (_dt1.Rows.Count > 0)
            {
                e.DetailTableView.DataSource = _dt1;

            }

            ScriptManager.RegisterStartupScript(this, typeof(Page), "Testing", "lnk_Costby_Gendeby_Chronic_Disease_showchart();", true);
        }

        protected void drpgroupname_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            string grpname = drpgroupname.SelectedValue.ToString();
            DataTable _dt = new DataTable();
            _dt = _objFinancialPerformanceDAL.Fetch_All_Participant_Name(grpname);
            if (_dt.Rows.Count > 0)
            {
                drpparticipant.DataSource = _dt;
                drpparticipant.DataValueField = "Name";

                drpparticipant.DataBind();
                drpparticipant.Enabled = true;
                lblerror.Text = null;
            }
            else
            {
                drpparticipant.DataSource = _dt;
                drpparticipant.DataValueField = "Name";
                drpparticipant.DataBind();
                drpparticipant.Enabled = false;
                lblerror.Text = "No Participant Found...";
            }

        }

        public void fill_filter_of_group()
        {
            if (Session["AcoManager"] != null)   // For AcoManager Login  
            {
                string acoid = Session["AcoManager"].ToString();
                fill_filter_group_name(acoid);
            }
            else if (Session["rolename"].ToString() == "ACOADMIN") // For Aco Login 
            {
                string acoid = Session["ACOid"].ToString();
                fill_filter_group_name(acoid);
            }
            else if (Session["rolename"].ToString() == "PHYSICIAN")  // for participents 
            {
                string acoid = Session["ACOParID"].ToString();
             
                participant.Visible = false;
                group.Visible = false;
                div_submit.Visible = false;

            }
            else if (Session["rolename"].ToString() == "ACOPARTICIPANTSGROUP")  // for participents group
            {
                string grpname = Session["group_tinlegalbuisenessname"].ToString();
                fill_filter_participant_name(grpname);
                participant.Visible = true;
                group.Visible = false;
                div_submit.Visible = true;

            }
            else // For Idesigns 
            {
                // When No chenge in Dropdown 


            }
        }

        public void fill_filter_group_name(string acoid)
        {
            DataTable _dt = new DataTable();
            _dt = _objFinancialPerformanceDAL.Fetch_All_group_Name(acoid);

            drpgroupname.DataSource = _dt;
            drpgroupname.DataValueField = "TIN_LegalBusinessName";

            drpgroupname.DataBind();

        }

        public void fill_filter_participant_name(string grpname)
        {
            DataTable _dt = new DataTable();
            _dt = _objFinancialPerformanceDAL.Fetch_All_Participant_Name(grpname);
            if (_dt.Rows.Count > 0)
            {
                drpparticipant.DataSource = _dt;
                drpparticipant.DataValueField = "Name";

                drpparticipant.DataBind();
                drpparticipant.Enabled = true;
                lblerror.Text = null;
            }
        }
        protected void btn_all_Filter_financial_performance_submit_Click(object sender, EventArgs e)
        {
            string usertype = null;
            string WhereCondtn = null;
            string WhereCondtn_par = null;
            string whereForPopup = null;

            WhereCondtn = drpgroupname.SelectedValue.ToString();
            if (!string.IsNullOrEmpty(WhereCondtn))
                usertype = "group";


            if (drpparticipant.Enabled == true)
            {

                WhereCondtn_par = drpparticipant.SelectedValue.ToString();
                if (!string.IsNullOrEmpty(WhereCondtn_par))
                {
                    usertype = "participant";
                    WhereCondtn = WhereCondtn_par;
                }
            }
            string count_check = hdn_all_Filter_financial_performance_count.Value.ToString();
            if (!string.IsNullOrEmpty(usertype))
            {
                switch (count_check)
                {
                  
                    case "fourth":
                        {
                            fill_Costby_Genderby_Chronic_Disease_Aco(usertype, WhereCondtn, whereForPopup);
                            break;
                        }
                }
            }
            drpgroupname.ClearSelection();
            drpparticipant.ClearSelection();

            drpparticipant.Enabled = false;
            if (Session["rolename"].ToString() == "ACOPARTICIPANTSGROUP")
            {
                drpparticipant.Enabled = true;
            }
            ScriptManager.RegisterStartupScript(this, typeof(Page), "Testing", "closewindow_filter();", true);

        }
      
        protected void btnexporttoexcel_Click(object sender, EventArgs e)
        {
            if (Div_fourth_aco.Visible == true)
            {
                exceltoexport(grd_forth_aco);
            }
            else if (Div_fourth_group.Visible == true)
            {
                exceltoexport(grd_fourth_group);
            }
            else
            {
                exceltoexport(grd_fourth_participant);
            }

        }

        public void exceltoexport(RadGrid gridname)
        {
            gridname.ExportSettings.ExportOnlyData = true;
            gridname.ExportSettings.IgnorePaging = true;
            gridname.ExportSettings.OpenInNewWindow = true;
            gridname.ExportSettings.FileName = "fileName";
            gridname.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
            gridname.ExportSettings.HideStructureColumns = true;
            gridname.MasterTableView.HierarchyDefaultExpanded = true;
            gridname.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;
            gridname.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
            gridname.MasterTableView.DetailTables[0].HierarchyLoadMode = GridChildLoadMode.Client;
            gridname.MasterTableView.ExportToExcel();
        }
    }

    .aspx code

    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="radgridchartdemo.aspx.cs" Inherits="radgridchartdemo" %>


    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

        <asp:UpdatePanel runat="server">
            <ContentTemplate>

            
        <div>
            <asp:HiddenField runat="server" ID="hdnfield_firstchartclick" />
              <asp:HiddenField runat="server" ID="hdn_all_Filter_financial_performance_count" />
            <div id="controls">
                <asp:Button runat="server" ID="lnk_paientpop_showdata_first" Text="Show Data" Style="display: block; font-size: 16px; margin-top: -3px; text-decoration: none; color: black; margin-left: 10px; float: right; margin-left: 0px; background: none; border: none; font-family: Times New Roman" OnClientClick="showdata();return false;" />
                  <asp:Button runat="server" ID="Button1" Text="Show chart" Style="display: block; font-size: 16px; margin-top: -3px; text-decoration: none; color: black; margin-left: 10px; float: right; margin-left: 0px; background: none; border: none; font-family: Times New Roman" OnClientClick="showchart();return false;" />
               <asp:LinkButton ID="lnk_Costby_Gendeby_Chronic_Disease_cohort_1" runat="server" ToolTip="Filter" Style="color: black; float: right; margin-top: -3px; margin-left: 10px;" OnClientClick="return fourth_financial_performance_myfiles();">Apply Filter</i></asp:LinkButton>
                <asp:Button Text="Export-excel" runat="server" OnClick="btnexporttoexcel_Click" ID="btnexporttoexcel" />
            </div>
            <div id="div_chart" runat="server" >

             
                        <div id="Div_Costby_Gendeby_Chronic_Disease_Chart" runat="server" visible="true" style="display: block">
                            <div runat="server" id="Div_Costby_Gendeby_Chronic_Disease_Chart1" style="width: 100%" visible="true">
                                <telerik:RadHtmlChart runat="server" ID="Costby_Gendeby_Chronic_Disease_Chart"
                                    Height="225" Transitions="true" Style="margin-top: 15px"
                                    Skin="Silk">
                                    <Appearance>
                                        <FillStyle BackgroundColor="White"></FillStyle>
                                    </Appearance>
                                    <ChartTitle>
                                        <%--<Appearance Align="Center" BackgroundColor="White" Position="Top">
                                                         </Appearance>--%>
                                    </ChartTitle>
                                    <Legend>
                                        <Appearance BackgroundColor="White" Position="Right" Visible="false">
                                        </Appearance>
                                    </Legend>
                                    <PlotArea>
                                        <Appearance>
                                            <%--<FillStyle BackgroundColor="White"></FillStyle>--%>
                                        </Appearance>
                                        <Series>
                                            <telerik:PieSeries Name="Gendr1" StartAngle="120">
                                                <LabelsAppearance DataFormatString="{0:C}">
                                                </LabelsAppearance>
                                                <TooltipsAppearance Color="White" DataFormatString="${0}"></TooltipsAppearance>
                                                <SeriesItems>
                                                    <%--  <telerik:PieSeriesItem Exploded="true"></telerik:PieSeriesItem>--%>
                                                </SeriesItems>
                                            </telerik:PieSeries>
                                        </Series>
                                    </PlotArea>
                                </telerik:RadHtmlChart>
                            </div>

                        </div>
                 
            </div>

            <div id="div_grid" runat="server" style="display:none">

                <div id="Div_fourth_aco" runat="server" visible="true">
                    <telerik:RadGrid ID="grd_forth_aco" runat="server" Width="99.5%" ShowStatusBar="true" AutoGenerateColumns="false"
                        AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="false" Skin="Silk"
                        OnDetailTableDataBind="grd_forth_aco_DetailTableDataBind">
                        <PagerStyle Mode="Slider"></PagerStyle>
                        <GroupingSettings CaseSensitive="false" />
                        <MasterTableView Width="100%" DataKeyNames="CohortName,AcoId" AllowMultiColumnSorting="True" PageSize="10">
                            <DetailTables>
                                <telerik:GridTableView Name="" Width="100%" AllowFilteringByColumn="true" PageSize="10" AllowPaging="true">
                                    <Columns>

                                        <telerik:GridBoundColumn SortExpression="Benehicno" HeaderText="Hic No." HeaderButtonType="TextButton"
                                            DataField="Benehicno">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="BeneName" HeaderText="Patient Name" HeaderButtonType="TextButton"
                                            DataField="BeneName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="State" HeaderText="State" HeaderButtonType="TextButton"
                                            DataField="State">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="County" HeaderText="County" HeaderButtonType="TextButton"
                                            DataField="County">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="TotalCost" HeaderText="Total Cost" HeaderButtonType="TextButton" DataFormatString=" {0:C} "
                                            DataField="TotalCost">
                                        </telerik:GridBoundColumn>

                                    </Columns>
                                </telerik:GridTableView>
                            </DetailTables>
                            <Columns>
                                <telerik:GridBoundColumn SortExpression="AcoId" HeaderText="ACoId" HeaderButtonType="TextButton"
                                    DataField="AcoId">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="CohortName" HeaderText="Cohort Name" HeaderButtonType="TextButton"
                                    DataField="CohortName">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="TotalCost" HeaderText="Total Cost" HeaderButtonType="TextButton" DataFormatString=" {0:C} "
                                    DataField="TotalCost">
                                </telerik:GridBoundColumn>

                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>


                <asp:Panel ID="Div_fourth_group" runat="server" Style="display: block" Visible="false">
                    <telerik:RadGrid ID="grd_fourth_group" runat="server" Width="99.5%" ShowStatusBar="true" AutoGenerateColumns="false"
                        AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="false" Skin="Silk"
                        OnDetailTableDataBind="grd_fourth_group_DetailTableDataBind"
                        Visible="true">
                        <PagerStyle Mode="Slider"></PagerStyle>
                        <GroupingSettings CaseSensitive="false" />
                        <MasterTableView Width="100%" DataKeyNames="CohortName,TIN_LegalBusinessName" AllowMultiColumnSorting="True" PageSize="10">
                            <DetailTables>
                                <telerik:GridTableView Name="" Width="100%" AllowFilteringByColumn="true" PageSize="10" AllowPaging="true">
                                    <Columns>

                                        <telerik:GridBoundColumn SortExpression="Benehicno" HeaderText="Hic No." HeaderButtonType="TextButton"
                                            DataField="Benehicno">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="BeneName" HeaderText="Patient Name" HeaderButtonType="TextButton"
                                            DataField="BeneName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="State" HeaderText="State" HeaderButtonType="TextButton"
                                            DataField="State">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="County" HeaderText="County" HeaderButtonType="TextButton"
                                            DataField="County">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="TotalCost" HeaderText="Total Cost" HeaderButtonType="TextButton" DataFormatString=" {0:C} "
                                            DataField="TotalCost">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </telerik:GridTableView>
                            </DetailTables>
                            <Columns>

                                <telerik:GridBoundColumn SortExpression="TIN_LegalBusinessName" HeaderText="Group Name" HeaderButtonType="TextButton"
                                    DataField="TIN_LegalBusinessName">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="CohortName" HeaderText="Cohort Name" HeaderButtonType="TextButton"
                                    DataField="CohortName">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="TotalCost" HeaderText="Total Cost" HeaderButtonType="TextButton" DataFormatString=" {0:C} "
                                    DataField="TotalCost">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </asp:Panel>

                <asp:Panel ID="div_fourth_participant" runat="server" Style="display: block" Visible="false">
                    <telerik:RadGrid ID="grd_fourth_participant" runat="server" Width="99.5%" ShowStatusBar="true" AutoGenerateColumns="false"
                        AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="false" Skin="Silk"
                        OnDetailTableDataBind="grd_fourth_participant_DetailTableDataBind" 
                        Visible="true">
                        <PagerStyle Mode="Slider"></PagerStyle>
                        <GroupingSettings CaseSensitive="false" />
                        <MasterTableView Width="100%" DataKeyNames="CohortName,AcoParName" AllowMultiColumnSorting="True" PageSize="10">
                            <DetailTables>
                                <telerik:GridTableView Name="" Width="99.5%" AllowFilteringByColumn="true" PageSize="10" AllowPaging="true">
                                    <Columns>

                                        <telerik:GridBoundColumn SortExpression="Benehicno" HeaderText="Hic No." HeaderButtonType="TextButton"
                                            DataField="Benehicno">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="BeneName" HeaderText="Patient Name" HeaderButtonType="TextButton"
                                            DataField="BeneName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="State" HeaderText="State" HeaderButtonType="TextButton"
                                            DataField="State">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="County" HeaderText="County" HeaderButtonType="TextButton"
                                            DataField="County">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="TotalCost" HeaderText="Total Cost" HeaderButtonType="TextButton" DataFormatString=" {0:C} "
                                            DataField="TotalCost">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </telerik:GridTableView>
                            </DetailTables>
                            <Columns>
                                <telerik:GridBoundColumn SortExpression="AcoParname" HeaderText="Physician Name" HeaderButtonType="TextButton"
                                    DataField="AcoParname">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="CohortName" HeaderText="Cohort Name" HeaderButtonType="TextButton"
                                    DataField="CohortName">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="TotalCost" HeaderText="Total Cost" HeaderButtonType="TextButton" DataFormatString=" {0:C} "
                                    DataField="TotalCost">
                                </telerik:GridBoundColumn>

                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </asp:Panel>

            </div>
        </div>
        </ContentTemplate>
        </asp:UpdatePanel>
           <div>


            <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Title="Filter" Skin="Metro" Behaviors="Close,Maximize,Minimize" AutoSize="false" OnClientClose="windowOnClientClose_filter">
                <ContentTemplate>
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel6" runat="server" Skin="Vista">
                    </telerik:RadAjaxLoadingPanel>
                    <telerik:RadAjaxPanel ID="RadAjaxPanel6" runat="server" LoadingPanelID="RadAjaxLoadingPanel6" Skin="Vista">

                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:Panel ID="Panel1" runat="server" Style="width: 100%">
                                    <div>
                                        <div>
                                            <div class="tabbable custom-tab">
                                                <ul class="nav nav-tabs">
                                                    <li id="li_first" class="active" data-toggle="tab"><a href="#Div1" data-toggle="tab" onclick="return tabclass_1();">Groups</a></li>
                                                    <li id="li_data"><a href="#Div2" data-toggle="tab"></a></li>

                                                </ul>
                                                <div class="tab-content">
                                                    <div class="tab-pane active" id="Div1" style="Overflow: Auto; min-height: 178px">
                                                        <div>
                                                            <div id="group" runat="server" style="float: left; padding-left: 10px">
                                                                <asp:Label ID="Label1" runat="server" Text="Group Name : "></asp:Label>
                                                                <telerik:RadComboBox ID="drpgroupname" runat="server" Width="180" Height="140"
                                                                    EmptyMessage="Type an Group Name..." DataTextField="TIN_LegalBusinessName"
                                                                    AllowCustomText="true" Filter="Contains" Skin="Silk" OnSelectedIndexChanged="drpgroupname_SelectedIndexChanged" AutoPostBack="true">
                                                                </telerik:RadComboBox>
                                                            </div>
                                                            <div id="participant" runat="server" style="float: left; padding-left: 10px">
                                                                <asp:Label ID="Label2" runat="server" Text="Participant Name : "></asp:Label>
                                                                <telerik:RadComboBox ID="drpparticipant" runat="server" Width="180" Height="140"
                                                                    EmptyMessage="Type an Participant Name..." DataTextField="Name"
                                                                    AllowCustomText="true" Filter="Contains" Skin="Silk" Enabled="false">
                                                                </telerik:RadComboBox>
                                                            </div>
                                                            <div style="float: left; padding-left: 10px" id="div_submit" runat="server">
                                                                <asp:Button runat="server" ID="btn_all_Filter_financial_performance_submit" Text="Submit" OnClick="btn_all_Filter_financial_performance_submit_Click" CssClass="btn btn-primary" />
                                                            </div>
                                                            <div style="padding-left: 10px; float: left">
                                                                <asp:Label ID="lblerror" runat="server" Style="color: red; font-size: 16px"></asp:Label>
                                                            </div>

                                                        </div>

                                                    </div>
                                                    <div class="tab-pane" id="Div2">
                                                    </div>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </telerik:RadAjaxPanel>
                </ContentTemplate>
            </telerik:RadWindow>

        

            <asp:HiddenField ID="wndPercentageValue" runat="server" />

            <script type="text/javascript">
                var TO_abc;
                var oWnd_abc;
                function pageLoad() {
                    //populate the global variable that holds a reference to the RadWindow

                }

                function showWindowInPercentage(value) {
                    oWnd_abc = $find("<%=RadWindow1.ClientID %>");

                    //attach to the window.resize event to resize the RadWindow when the browser changes size
                    $telerik.$(window).resize(function () {
                        clearTimeout(TO_abc);

                        TO_abc = setTimeout(sizeWindowInPercentage, 100);
                    });
                    $telerik.$("#wndPercentageValue").attr("value", value);
                    oWnd_abc.show();
                    sizeWindowInPercentage();

                }

                function sizeWindowInPercentage() {
                    //check first if the RadWindow is shown, if it is not we cannot resize it
                    if (oWnd_abc.isVisible()) {
                        //obtain the necessary values - percent and viewport size
                        var value = 80;
                        var browserWidth = $telerik.$(window).width();
                        var browserHeight = $telerik.$(window).height();

                        //resize the RadWindow
                        oWnd_abc.setSize(Math.ceil(browserWidth * value / 100), 310);
                        value = 0;
                        //optionally you may also center the RadWindow
                        //otherwise it will stay where the original calculation for its top left corner leaves it
                        oWnd_abc.center();
                    }
                }

                function closewindow_filter() {
                    var window = $find('<%=RadWindow1.ClientID %>');
                    window.close();
                    return false;
                }
                function windowOnClientClose_filter(sender, args) {
                    var comboDeactivateReasonTruck = $find("<%= drpgroupname.ClientID %>");
                    comboDeactivateReasonTruck.clearSelection();
                    comboDeactivateReasonTruck.commitChanges();
                    var comboDeactivateReasonTruck = $find("<%= drpparticipant.ClientID %>");
                    comboDeactivateReasonTruck.clearSelection();
                    comboDeactivateReasonTruck.commitChanges();
                }

            </script>
        </div>



        <script type="text/javascript">
            function showdata() {

                document.getElementById("ContentPlaceHolder1_div_chart").style.display = "none";
                document.getElementById("ContentPlaceHolder1_div_grid").style.display = "block";

               
            }
            function showchart() {

                document.getElementById("ContentPlaceHolder1_div_chart").style.display = "block";
                document.getElementById("ContentPlaceHolder1_div_grid").style.display = "none";


            }
            function fourth_financial_performance_myfiles() {

                var x = document.getElementById('<%= hdn_all_Filter_financial_performance_count.ClientID %>');
               x.value = 'fourth';
               showWindowInPercentage(80);
               return false;

           }
        </script>
    </asp:Content>

  6. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 23 Jun 2014 in reply to Asutosh Link to this post

    Ashutosh

    Donot do this
                grd_firstchart_aco.DataSource = table1;
                grd_firstchart_aco.DataBind();

    me.session(gridrs) = table1

    Make the Grid visibile / Invisible

    Call grd_firstchart_aco_NeedDatasource as spoken

    In grd_third_aco_DetailTableDataBind
    Also call if dv.value = 1 exit sub
    'You donot need to call this if grid is invisible


    then all the button code as discussed

    my suggestion is make a duplicate page and check it should work

    after calling
    grid.datasource = rs
    donot call grid.bind (It is called automatically)


    In need datasource

    if dv.value = 1 then exit sub
    dim r as new data.dataset
    r = ctype(me.session(gridrs), data.dataset)
    grid.datasource = r

  7. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 23 Jun 2014 in reply to SANJAY Link to this post

    hi sanjay
    thanks a lot for reply
    its work in my case
    now the problem is that my hierarchy grid has pagging and its size is 10 so when i export it as excel only 10 rows is exported
    i used below code to export as excel
    thanks
      gridname.ExportSettings.FileName = "filename";
                gridname.ExportSettings.IgnorePaging = true;
                gridname.ExportSettings.ExportOnlyData = true;
                gridname.ExportSettings.OpenInNewWindow = true;
                gridname.MasterTableView.UseAllDataFields = true;
                gridname.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;

                gridname.MasterTableView.HierarchyDefaultExpanded = true;
                gridname.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;

                gridname.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
                gridname.MasterTableView.DetailTables[0].HierarchyLoadMode = GridChildLoadMode.Client;

                gridname.MasterTableView.ExportToExcel();
  8. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 23 Jun 2014 Link to this post

    can anybody please reply asap. we have deadline for our project.
  9. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    check this link

    http://www.telerik.com/forums/how-to-export-data-of-all-pages-when-using-radgrid
  10. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    hi
    i am following that but still same problem arise in my case
  11. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    Hi Aushotosh

    Just to be doubly sure

    1) You are binding to grid before exporting with complete recordset (All records) with grid.allowPaging = false. This will show the grid with all your records and export with all records

    2) The grid to best of my understanding only exports the records which are supposed to be visible on that page

    3) After the export change the value of Allow Paging to true. When you change that to true it will call need datasource.


    Regards

    Sanjay
  12. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    Probably the problem is that you have called

    allowpaging to true but you have not rebound your grid again with all the data and have not called rebind

    Please try that

    Regards


  13. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    i have done this but still same problem arise
     gridname.AllowPaging = false;
            gridname.Rebind();
          
            gridname.ExportSettings.ExportOnlyData = true;
            gridname.ExportSettings.IgnorePaging = true;
            gridname.ExportSettings.OpenInNewWindow = true;
            gridname.ExportSettings.FileName = "fileName";
            gridname.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
            gridname.ExportSettings.HideStructureColumns = true;
            gridname.MasterTableView.HierarchyDefaultExpanded = true;
            gridname.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;
            gridname.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
            gridname.MasterTableView.DetailTables[0].HierarchyLoadMode = GridChildLoadMode.Client;
            gridname.MasterTableView.ExportToExcel();
            gridname.AllowPaging = true;
  14. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    Ashutosh

    Technically
    Kindly check in debug mode if the code goes to need datasource after you call rebind

    in need datasource ensure that all records are passed to grid

    After if comes back from need datasource the code on export should be called

    please let me know if the needdatasouce is called before the export function call

  15. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    yaa
    i have check that
    need datasource is call before ExportToExcel

  16. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    if i set allow paging false in my grid code in .aspx file then its works fine
    but if i set pagging then it only export show data
  17. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to Kostadin Link to this post

    hi kostdian 
    can you give me sample code to export heirarchy  grid as excel with paging
    means i have paging in my hierarchy grid and page size is 10
    when i export it as excel it export only 10 row which is visible
    help me out of this
  18. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    Ashutosh

    In code file set allow paging to false

    When you show the grid and you are not exporting change value of allow paging to true

    again before exporting change value to false

    Turnaround

    If the above doesnot work. Put a new grid which is used only for exporting. Keep the grid hidden and use this grid for the purpose of exporting only. if you do this then add another hiddenfield keep the value of this field = 0 in need datasource exit sub if value = 0 when you have to export first change value to 1 then call rebind and then export

  19. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    is this possible in rad grid to export hierarchy grid n excel?
    because i have reefer admin demo in that also export only show data not paging data
  20. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 Link to this post

    hi sanjay,

    Turnaround

    If the above doesnot work. Put a new grid which is used only for exporting. Keep the grid hidden and use this grid for the purpose of exporting only. if you do this then add another hiddenfield keep the value of this field = 0 in need datasource exit sub if value = 0 when you have to export first change value to 1 then call rebind and then export 

    above has solved my problem and it works well but thing is we have 6 charts on one page and we have 3 grids already for each chart to display level1 group data, level2 group data and level3 group data. so in this solution we need to add another 18 grids per page . and i guess it will create performace issues.

    any other workaround ?
  21. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    can you show me the link on webserver to see your page
  22. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    Hi Aushotosh

    Then what you can do is create a new page and have 3 grids on the same

    The dataset which populates the grid keep in session / ViewState

    On export button open the new page in window and load the grids from the session object ( Intention is that it will not consume your resources) then export the grid. to xml in same window

    if you are using ony one grid to export then load only one grid

    Regards

  23. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    Ashutosh

    Are you through

    Regards
  24. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 24 Jun 2014 in reply to SANJAY Link to this post

    Hi Sanjay,

    Hi Aushotosh

    Then what you can do is create a new page and have 3 grids on the same

    The dataset which populates the grid keep in session / ViewState

    On export button open the new page in window and load the grids from the session object ( Intention is that it will not consume your resources) then export the grid. to xml in same window

    if you are using ony one grid to export then load only one grid

    above didnt worked for me so i ended up putting 18 grids per page. i really appreciate your prompt responses. thank you very much
  25. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2014 in reply to Asutosh Link to this post

    Hi Ashutosh

    1) 18 grids should not make the page slow because if you store the recordset in session object then you donot have to recreate it and saves a lot of time

    2) Principally I keep a hidden field and populate the grid only if it is to be visible to user ie like when in TABS and if the grid is not visible then donot populate the data

    3) My Profile Age 50 years / Qualification MS Surgery / Software by self study

    4) If possible for my satisfaction if you can give me link on development server (if not inconvienient)


    Regards

  26. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 25 Jun 2014 in reply to SANJAY Link to this post

    i am getting a window asking to select yes or no while i try to open excel file which is exported from grid. check attached screenshot. is there any way to remove this ?

    and sanjay i cannot send you link directly as it is on local host
  27. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 25 Jun 2014 in reply to Asutosh Link to this post

    Hi Ashutosh

    The window is from EXCEL Application. This window is because the extension of your file is .xls and new version of office by default uses .xlsx. It may not be possible to remove the window. But I guess you can check with Telerik if it possible to change the format to .xlsx

    It is ok about the link

    Regards
  28. Shahista
    Shahista avatar
    3 posts
    Member since:
    Feb 2012

    Posted 26 Jun 2014 in reply to Daniel Link to this post

    Hi Im having an issue on the export to excel. The value is displaying correctly in textbox but not GridBound column, here it gets cut off halfway. My code is shown as below
    <telerik:RadGrid ID="GridView4"  runat="server" OnGridExporting="gv_GridExporting" GridLines="None" Width="100%" AutoGenerateColumns="false" ImagesPath="Images/Grid/" AllowSorting="True" ShowGroupPanel="True" ItemStyle-Wrap="false"  OnDataBound="GridView4_DataBound" BorderWidth="0">
    <ExportSettings FileName="WorkflowExport" HideStructureColumns="True" ExportOnlyData="true" IgnorePaging="True" OpenInNewWindow="True">
    </ExportSettings>
    <ClientSettings AllowDragToGroup="True"></ClientSettings>
    <MasterTableView Font-Names="Tahoma,Helvetica" Font-Size="11px">
    <CommandItemSettings ExportToExcelImageUrl="Images/ExcelIcon.png" ShowExportToExcelButton="true"></CommandItemSettings>
    <Columns>
    <telerik:GridBoundColumn DataField="CampaignNo" HeaderText="Campaign No" SortExpression="CampaignNo" />
    <telerik:GridBoundColumn  DataField="JobNo" HeaderText="Job No" SortExpression="JobNo" />
    <telerik:GridBoundColumn  DataField="CampDescription" HeaderText="Camp Description" SortExpression="CampDescription" />
    <telerik:GridBoundColumn  DataField="Medium" HeaderText="Medium" SortExpression="Medium" />
    <telerik:GridBoundColumn  DataField="Category" HeaderText="Category" SortExpression="Category" />
    <telerik:GridBoundColumn ReadOnly="True" DataField="BriefDesc" HeaderText="Brief Desc" SortExpression="BriefDesc" />
    <telerik:GridBoundColumn  DataField="Region" HeaderText="Region" SortExpression="Region" />
    <telerik:GridBoundColumn DataField="Language" HeaderText="Language" SortExpression="Language" />
    <telerik:GridBoundColumn  DataField="Week" HeaderText="Week" SortExpression="Week" />
    <telerik:GridBoundColumn  DataField="CurrentCPAStage" HeaderText="Current CPA Stage" SortExpression="CurrentCPAStage" />
    <telerik:GridBoundColumn  DataField="CurrentCPADate" HeaderText="Current CPA Date" SortExpression="CurrentCPADate" Display="False" />
    <telerik:GridBoundColumn  DataField="ProjectedCPAStage" HeaderText="Projected CPA Stage" SortExpression="ProjectedCPAStage" />
    <telerik:GridBoundColumn  DataField="ProjectedCPADate" HeaderText="Projected CPA Date" SortExpression="ProjectedCPADate" Display="False" />
    <telerik:GridBoundColumn  DataField="NextCPAStage" HeaderText="Next CPA Stage" SortExpression="NextCPAStage" />
    <telerik:GridBoundColumn  DataField="NextCPAStageDate" HeaderText="Next CPA Stage Date" SortExpression="NextCPAStageDate" />
    <telerik:GridBoundColumn  DataField="Comments" HeaderText="Comments" MaxLength="5000"  DataType="System.String"  SortExpression="Comments" />
    <telerik:GridBoundColumn DataField="MediaList"  HeaderText="Media" SortExpression="MediaList" >
    <ItemStyle Width="150px"></ItemStyle>
    </telerik:GridBoundColumn>
    </Columns>
    <RowIndicatorColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
    <ExpandCollapseColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
    <EditFormSettings>
    <EditColumn InsertImageUrl="Images/Grid/Update.gif" UpdateImageUrl="Images/Grid/Update.gif"
    EditImageUrl="Images/Grid/Edit.gif" CancelImageUrl="Images/Grid/Cancel.gif" FilterImageUrl="Images/Grid/Filter.gif"
    SortAscImageUrl="Images/Grid/SortAsc.gif" SortDescImageUrl="Images/Grid/SortDesc.gif">
    </EditColumn>
    </EditFormSettings>
    <PagerStyle PrevPageImageUrl="Images/Grid/PagingPrev.gif" NextPageImageUrl="Images/Grid/PagingNext.gif"
    FirstPageImageUrl="Images/Grid/PagingFirst.gif" LastPageImageUrl="Images/Grid/PagingLast.gif"></PagerStyle>
    <PagerStyle PrevPageImageUrl="Images/Grid/PagingPrev.gif" NextPageImageUrl="Images/Grid/PagingNext.gif"
       FirstPageImageUrl="Images/Grid/PagingFirst.gif" LastPageImageUrl="Images/Grid/PagingLast.gif"></PagerStyle>
    </MasterTableView>
                                                                            <PagerStyle FirstPageImageUrl="Images/Grid/PagingFirst.gif"
                                                                                LastPageImageUrl="Images/Grid/PagingLast.gif"
                                                                                NextPageImageUrl="Images/Grid/PagingNext.gif"
                                                                                PrevPageImageUrl="Images/Grid/PagingPrev.gif" />
                                                                        </telerik:RadGrid> 
  29. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jun 2014 in reply to Shahista Link to this post

    Hi Shahista,

    I'm not able to replicate such an issue at my end. Can you try increasing the width of that column by using HeaderStyle-Width="..." or try setting TableLayout="Fixed" in MasterTableView and check if the issue is resolved.

    Thanks,
    Shinu
  30. Vaibhav
    Vaibhav avatar
    15 posts
    Member since:
    Feb 2014

    Posted 08 Sep 2014 Link to this post

    Hi.
    I need  to export only selected rows to excel.
    I am able to hide columns before exporting.
    I have searched a lot regarding hiding unselected rows/Exporting only selected rows in telerik threads.
    In all my search results I found the below line of code. 

    ​ if (Grid.SelectedItems.Count != 0)
    {
    foreach (GridDataItem item in Grid.MasterTableView.Items)
    {
    if (!item.Selected)
    item.Visible = false;
    }
    } My excel format is"BIFF".
    Its very urgent.
    Please help
  31. Shahista
    Shahista avatar
    3 posts
    Member since:
    Feb 2012

    Posted 08 Sep 2014 in reply to Vaibhav Link to this post

    hi

    just an idea
    why dont you have a hidden grid on your page that you bind with your dataset of all selected rows and then just import that hidden grid?

    shahistas@hc.co.za
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017