Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
137 views

 Hi,

 I need to remove an hyperlink look from my tree nodes.  Tryed TreeNodeOver style like "text-decoration: none". However it is not working.

I used the below css code on aspx page:

<style type="text/css">
.myNodeHoveredCss .rtIn
{
    text-decoration: none !important;

.myNodeSelectedCss .rtIn
{
    text-decoration: none !important;
}
</style>

Code behind used below line:
stNode.HoveredCssClass = "myNodeHoveredCss";

Can you please tell me how to remove Hyperlink look from tree node?.

Venkadesh Babu
Top achievements
Rank 1
 answered on 18 Oct 2011
3 answers
1.1K+ views
Hey everyone,

How to get the value selected from datepicker in codebehind?...

Thanks
Amit
Maria Ilieva
Telerik team
 answered on 18 Oct 2011
1 answer
192 views
I am getting the following Javascript error:

Line: 8
Error: Object doesn't support this property or method

the following line of code is shown when debugging the code. 

!v&&b.length>1&&d(b,"")>-1&&(j=RegExp(this.source,e.replace.call(c(this),"g","")),e.replace.call(a.slice(b.index),j,function(){for(var a=1;a<arguments.length-2;a++)arguments[a]===void 0&&(b[a]=void 0)

The javascript file that is purporting the error is in "itn.js". 

I am getting this error when a Rad combo box is used as an editor for a column and when I click the drop down button to display the list of items within the drop down. Now I get the error only in IE Version 8.0.7601.17514 and not the other browsers. I checked to see if it was something in my code but its not. I am also receiving the error from your Demo site on the following page:

http://demos.telerik.com/aspnet-ajax/treelist/examples/columns/columntypes/defaultcs.aspx

it is on the second treelist control where the "Title Of Courtesy" contains a RadComboBox. Again when I click the drop down button on the control it throws the above javascript error. It never drops down the list of items on the control.

Any help on this I would greatly appreciate it.

Thanks

Radoslav
Telerik team
 answered on 18 Oct 2011
1 answer
95 views
Hi,

I see the sample on how to resize RadGrid inside RadSplitter but how do i resize a RadGrid inside a User Control that is inside a RadSplitter from a Master Page?  I hope this make sense.  Any example is greatly appreciated.

Thank you.
Andrey
Telerik team
 answered on 18 Oct 2011
1 answer
152 views
I need to access controls in GroupTemplate when ever a new group is created.
Is that possible?
Andrey
Telerik team
 answered on 18 Oct 2011
3 answers
103 views
Hello,

I have a problem with my treeview events :

Normaly, the clickNode event is fired before the dataBound event.
But sometimes, it is the dataBound event which is fired before the clickNode.

Is there a solution to force clickNode first?


Donatien
Plamen
Telerik team
 answered on 18 Oct 2011
2 answers
113 views
I want to create a RadGrid bulk editing by code behide. In GridDataItem have TextBox to show data in my datasource and it's can change data in textbox. Then after I press button save it's will read every data in TextBox in RadGrid and save changed data to datasource.

I will try to make my program like this by using GridTemplateColumn (in programmatic) I can bind data to textbox in TemplateColumn but when I press save button.... Textbox in RadGrid are disappear o_O!!. I don't know what's going on. Please help me I'm so tried to fine solution :'(
Jadesada
Top achievements
Rank 1
 answered on 18 Oct 2011
3 answers
134 views
I am trying to access the calculated aggregate value as I want to use the calculated value as the value of the cell. I can see their are some private items but I can not access them server side. Is there any way to achieve this?
Mira
Telerik team
 answered on 18 Oct 2011
3 answers
194 views
I want to be able to skin my Telerik RadControls on my asp.net page on the fly.
To do this I've made sure all these controls have an ID that starts "Rad" and when the page loads I have a method that cycles through all controls on a page and creates a List<Control> of those starting with "Rad".

Now all I need to do is cycle through my list and set the skin property to my selected skin. However, Control has no concept of "Skin" so I am trying to cast each of these to RadControl but am getting errors when casting, such as

Unable to cast object of type 'Telerik.Web.UI.RadPanelBar' to type 'Telerik.Web.UI.RadControl'.

My Code below...

protected void SetSkins(string colorScheme)
{
    List<Control> RadControls = new List<Control>();
    LoopControls(this.Page.Controls, ref RadControls);
  
    foreach (Control c in RadControls)
    {
        ((RadControl)c).Skin = colorScheme;
    }
}
  
  
public void LoopControls(ControlCollection controls, ref List<Control> RadControls)
{
    string output = string.Empty;
    foreach (Control control in controls)
    {
        if (!string.IsNullOrEmpty(control.ID) && control.ID.StartsWith("Rad"))
        {
            RadControls.Add(control);
        }
        LoopControls(control.Controls, ref RadControls);
    }
}

I suppose I could pass the skin name across and set the skin in the LoopControls method, but would still like an answer to my question.



Stuart Hemming
Top achievements
Rank 2
 answered on 18 Oct 2011
3 answers
412 views
Hi,

I have a radGrid to which I am trying to export using standard radGrid export options. But I am have few issues as below:

1) Export to CSV is not giving me data.
2) Export to Excel is giving data with extra columns.
3) Export to PDF is giving data with extra columns.

I am using the following code to do the same. Please let me know what the issue is.

ExportRadGrid.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ExportRadGrid.aspx.cs" Inherits="ExportRadGrid" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <telerik:RadScriptManager ID="scrip" runat="server"></telerik:RadScriptManager>
     <telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                AllowSorting="true" AllowCustomPaging="true" PageSize="5" AllowFilteringByColumn="true"
               Skin="Office2007">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
               
            </telerik:RadGrid>
            
            <asp:Button ID="btnCSV" Text="CSV" runat="server" OnClick="btnCSV_Click"/>
            <asp:Button ID="btnExcel" Text="Excel" runat="server" OnClick="btnExcel_Click"/>
            <asp:Button ID="btnPDF" Text="PDF" runat="server" OnClick="btnPDF_Click"/>
    </div>
    </form>
</body>
</html>


ExportRadGrid.aspx.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;

public partial class ExportRadGrid : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
         GridTemplateColumn column1 = new GridTemplateColumn();
            column1.UniqueName = "RollNo";
            column1.HeaderText = "RollNo";
            column1.ItemTemplate = new LabelTemplate("RollNo", string.Empty);

            GridTemplateColumn column2 = new GridTemplateColumn();
            column2.UniqueName = "Name";
            column2.HeaderText = "Name";
            column2.ItemTemplate = new LabelTemplate("Name", string.Empty);

            GridTemplateColumn column3 = new GridTemplateColumn();
            column3.UniqueName = "Address";
            column3.HeaderText = "Address";
            column3.ItemTemplate = new LabelTemplate("Address", string.Empty);


            radGrid.MasterTableView.Columns.Add(column1);
            radGrid.MasterTableView.Columns.Add(column2);
            radGrid.MasterTableView.Columns.Add(column3);

            radGrid.DataSource = GetDataTable();
            radGrid.DataBind();
        
    }

    protected void btnCSV_Click(object sender, EventArgs e)
    {
        SetReportSettings();
        radGrid.MasterTableView.ExportToCSV();
    }
    protected void btnExcel_Click(object sender, EventArgs e)
    {
        SetReportSettings();
        radGrid.MasterTableView.ExportToExcel();
    }
    protected void btnPDF_Click(object sender, EventArgs e)
    {
        SetReportSettings();
        radGrid.MasterTableView.ExportToPdf();
    }

    private void SetReportSettings()
    {
        this.radGrid.ExportSettings.ExportOnlyData = true;
        this.radGrid.ExportSettings.IgnorePaging = true;
        this.radGrid.ExportSettings.OpenInNewWindow = true;
    }

    private DataTable GetDataTable()
    {
        DataTable dt = new DataTable("MyTable");
        dt.Columns.Add("RollNo");
        dt.Columns.Add("Name");
        dt.Columns.Add("Address");

        DataRow dr1 = dt.NewRow();
        dr1["RollNo"] = 1;
        dr1["Name"] = "Mahesh";
        dr1["Address"] = "Addr1";


        DataRow dr2 = dt.NewRow();
        dr2["RollNo"] = 1;
        dr2["Name"] = "Kishore";
        dr2["Address"] = "Addr2";


        DataRow dr3 = dt.NewRow();
        dr3["RollNo"] = 1;
        dr3["Name"] = "Rajesh";
        dr3["Address"] = "Addr3";

        dt.Rows.Add(dr1);
        dt.Rows.Add(dr2);
        dt.Rows.Add(dr3);

        return dt;



    }
}

public class LabelTemplate : ITemplate
{
    public string DataField { get; set; }
    public string DataFormat { get; set; }

    private LabelTemplate()
    {
    }

    public LabelTemplate(string dataField, string dataFormat)
    {
        DataField = dataField;
        DataFormat = dataFormat;
    }

    #region ITemplate Members

    public void InstantiateIn(Control container)
    {
        Label label = new Label();
        label.DataBinding += new EventHandler(Label_DataBinding);
        container.Controls.Add(label);
    }

    void Label_DataBinding(object sender, EventArgs e)
    {
        Label label = (Label)sender;
        GridDataItem container = (GridDataItem)label.NamingContainer;
        if (DataFormat != string.Empty)
            label.Text = string.Format(DataFormat, ((DataRowView)container.DataItem)[DataField].ToString());
        else
            label.Text = ((DataRowView)container.DataItem)[DataField].ToString();
    }

    #endregion
}



Thanks,
Mahesh


Daniel
Telerik team
 answered on 18 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?