Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
69 views
Hello Telerik Team,

I have developed a Hierarchial RadGrid using the approach given here:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

Then added 'Export to Excel' functionality to the grid.
The code for the same is given here.

There are 2 issues with 'Export to Excel' functionality
1. 'Export to Excel' button when clicked first time works fine. But when I click it again, it does not work.
2. Data is exported only for the first level, not for the hierarchy tables.

<asp:Button runat="server" ID="Button1" OnClick="Button1_Click" Text="Export to Excel" />
protected void Button1_Click(object sender, EventArgs e)
       {
           ConfigureExport();
            
           RadGrid1.MasterTableView.ExportToExcel();
       }
       public void ConfigureExport()
       {
           RadGrid1.ExportSettings.ExportOnlyData = true;
 
       }
Please provide solution asap
Princy
Top achievements
Rank 2
 answered on 08 Jun 2011
1 answer
160 views
When i enable AllowFilterByColumn in RadGrid and custom paging with NeedDataSource.  I have a problem which is filter is ok but paging of RadGrid is show wrong. If i dont use AllowFilterByColumn Paging is ok. But when i use AllowFilterByColumn Paging will show wrong Please help me. Thanks. This is my code : 
 
protected void RgProductNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{           
int startRowIndex = rgProduct.CurrentPageIndex * rgProduct.PageSize;        
        
int totalRows;            
        int maximumRows = rgProduct.PageSize;          
        var pageIndex = startRowIndex / maximumRows;          
        rgProduct.DataSource = _datacontext.Products.Page(pageIndex, maximumRows, p => p.ProductCode,
true, out totalRows);

 
Pavlina
Telerik team
 answered on 08 Jun 2011
2 answers
94 views
Hi,
I've localized RadEditor DialogBox and set CdnSettings-TelerikCdn="Disabled" of RadScriptManager and RadStyleSheetManager.
But when I watch the requests with FireBug it connects to telerik website.
And when internet is not connected the style of dialogs is disassembled.
Actually Telerik.Web.UI.DialogHandler.axd refers to telerikstatic.com.
Mehrdad
Top achievements
Rank 1
 answered on 08 Jun 2011
1 answer
70 views
Hello,

I have a control in a master page that I want to display only when the master page is not in a RadWindow; when in a RadWindow, it should be hidden.  Is that possible to do, to detect when the page request is inside the RadWindow?

Thanks.
Georgi Tunev
Telerik team
 answered on 08 Jun 2011
2 answers
103 views
I am generating tabs at runtime with close button for each tab,  when i select any item from dropdown then it generating tab with close button but without text, check the attached image. when i select another item from dropdown it adding text to already generated tab, but for the tab which is generated last not showing the text, how to solve the issue..

aspx.cs page
protected override void OnInit(EventArgs e)
 {
       RadTabStrip1.TabTemplate = new TabTemplate();
       base.OnInit(e);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
       if (!Page.IsPostBack)
            BindUsers();
       RadTabStrip1.DataBind();
 }
 
 private void BindUsers()
{
 .  .. . . . .
}
protected void ddlUsers_SelectedIndexChanged(object sender, EventArgs e)
{
     if (ddlUsers.SelectedIndex != 0)
     {
          if (RadTabStrip1.Tabs.Count == 0)
          {
              RadTab Separator = new RadTab();
              Separator.IsSeparator = true;
              Separator.Width = Unit.Pixel(50);
              RadTabStrip1.Tabs.Add(Separator);
              RadTab tab1 = new RadTab(ddlUsers.SelectedItem.Text, ddlUsers.SelectedItem.Value);
              RadTabStrip1.Tabs.Add(tab1);
              RadTabStrip1.Tabs.FindTabByText(ddlUsers.SelectedItem.Text).Selected = true;
         }
        else if (RadTabStrip1.Tabs.Count > 0 && RadTabStrip1.FindTabByText(ddlUsers.SelectedItem.Text) == null)
        {
                    //RadTab Separator = new RadTab();
                    //Separator.IsSeparator = true;
                    //Separator.Width = Unit.Pixel(5);
                    //RadTabStrip1.Tabs.Add(Separator);
 
              RadTab tab1 = new RadTab(ddlUsers.SelectedItem.Text, ddlUsers.SelectedItem.Value);
              RadTabStrip1.Tabs.Add(tab1);
              RadTabStrip1.Tabs.FindTabByText(ddlUsers.SelectedItem.Text).Selected = true;
         }
        else
             RadTabStrip1.Tabs.FindTabByText(ddlUsers.SelectedItem.Text).Selected = true;
             GetDashboards(ddlUsers.SelectedItem.Text);
       }
      else
       {
           ddlDashboards.Items.Clear();
           ddlDashboards.DataSource = CreateEmptyDataTable();
           ddlDashboards.DataTextField = "DashboardTitle";
           ddlDashboards.DataValueField = "DashboardKey";
           ddlDashboards.DataBind();
       }
}

class file
class TabTemplate : ITemplate
    {
        public void InstantiateIn(Control container)
        {
            Label lbl = new Label();
            lbl.ID = "ItemLabel";
            //lbl.Text = "";
            lbl.DataBinding += new EventHandler(lbl_DataBinding);
            ImageButton ImgBtnClose = new ImageButton()
            {
                ImageUrl = "../../Images/delete1.gif",
                CssClass = "image"
            };
            ImgBtnClose.Click += new ImageClickEventHandler(ImgBtnClose_Click);
            ImgBtnClose.Attributes.Add("onclick", "return confirm('Do you want to close this tab.');");
            container.Controls.Add(lbl);
            container.Controls.Add(ImgBtnClose);
        }
 
        void ImgBtnClose_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton target = (ImageButton)sender;
            RadTab tab = (RadTab)target.BindingContainer;
            RadTabStrip tabStrip = (RadTabStrip)tab.Parent;
            tabStrip.Tabs.Remove(tab);
        }
 
        private void lbl_DataBinding(object sender, EventArgs e)
        {
            Label target = (Label)sender;
            RadTab tab = (RadTab)target.BindingContainer;
            string tabText = (string)DataBinder.Eval(tab, "Text");
            target.Text = tabText;
        }
    }
Hiren
Top achievements
Rank 1
 answered on 08 Jun 2011
3 answers
239 views
I'm creating 8 series in my chart - 4 lines, 4 points, one point series for each line. Data is displaying fine. I have used the Hay skin but have opted to change the color of one of my lines. However, I can't seem to get the pointmarks in the point series to change color.

I'm creating my series as follows:-

protected RadChart SetChartData(RadChart radChart, DataTable chartDataTable)
        {
            radChart.DataSource = chartDataTable;
            
            radChart.Series.Add(CreateChartSeries("Assets", ChartSeriesType.Line, "Assets"));
            radChart.Series[0].Appearance.LabelAppearance.Visible = false;
 
            radChart.Series.Add(CreateChartSeries("Assets calibrations", ChartSeriesType.Point, Color.Red, "AssetCalibrations"));
            //radChart.Series[1].Appearance.PointMark.FillStyle.MainColor = System.Drawing.Color.Red;
            radChart.Series[1].Appearance.LabelAppearance.Visible = false;
 and so forth for the other 6 series
            return radChart;
        }
 
which calls my CreateChartSeries method:-
 
protected ChartSeries CreateChartSeries(string name, ChartSeriesType type, Color seriesColor, string dataYColumn)
        {
            ChartSeries chartSeries = new ChartSeries();
            chartSeries.Name = name;
            chartSeries.Type = type;
            if (type == Telerik.Charting.ChartSeriesType.Line) { chartSeries.Appearance.LineSeriesAppearance.Color = seriesColor; }
            if (type == Telerik.Charting.ChartSeriesType.Point) { chartSeries.Appearance.PointMark.FillStyle.MainColor = seriesColor; }
 
            chartSeries.DataYColumn = dataYColumn;
 
            return chartSeries;
        }

I know my code is stepping into the 2nd if (type==Point) and it appears to set the color, but when my chart is rendered, the points are all colored by the Hay skin. I've even tried setting the color after the series.add (commented out now in my SetChartData method.

Hopefully I'm doing something daft?
thanks
--Michael

Ves
Telerik team
 answered on 08 Jun 2011
2 answers
73 views
Hi.. am new to RedSlider, I have placed the RadSlider in the asp.net page..

but when I scroll the page, Radslider also moves along with the page which I DO NOT want to..

How can I avoid this?

thanks
Pramod
pramodh
Top achievements
Rank 1
 answered on 08 Jun 2011
4 answers
111 views
This is an odd one.  I've put a couple of listboxes on my page and bound them to data.  For some reason they both have a little 'double arrow' at the top left of each list item.  The double arrow faces right and is present except when hovering over it.

I figure it must be intended for drag or 'move from listbox to listbox' type functionality, but I've set as many properties to 'false' as I can and they refuse to depart!!

Any help would be appreciated.

Mark
Peter Filipov
Telerik team
 answered on 08 Jun 2011
3 answers
201 views
Hi,

i am working on telerik tree view context menu. kindly tell me is there any way to add checkbox in context menu of telerik tree view.

with regards,

Faisal
Princy
Top achievements
Rank 2
 answered on 08 Jun 2011
1 answer
98 views
Hello every one,

See The Image ,
After clicking the add layout button ,
what ever i click rad tool bar button assigned rows are come like "System.Data.DataRowView"
please replay as soon as possible

Thanks,
Mohamed.
Veronica
Telerik team
 answered on 08 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?