Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
120 views
I just downloaded the trial seeing if our company would like the software or not. 

first thing I did was try out the grid.
The columns do not align with the headers when using UseStaticHeaders="true"
see http://www.donordialogue.com/GridExample.gif

I added the below:
It does the same thing in both firefox, and Internet Explorer. Although firefox it is worse.
Am I doing something wrong?
         <telerik:RadGrid ID="rgDonors"  ShowStatusBar="true" Skin="Outlook" 
            ShowFooter="false" GridLines="Both" AllowSorting="True" AllowPaging="True" PageSize="50" 
             AutoGenerateColumns="false" 
            Width="500px" runat="server"> 
            <PagerStyle Mode="NumericPages" /> 
            <MasterTableView Width="100%"> 
            <Columns > 
            <telerik:GridBoundColumn DataField="DonorID" HeaderText="Donor ID" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" /> 
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left"/> 
            <telerik:GridBoundColumn DataField="LastName" HeaderText="First Name" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left"/> 
            <telerik:GridBoundColumn DataField="DateOfBirth" HeaderText="Date Of Birth" DataFormatString="{0:MM/dd/yyyy}" ItemStyle-Width="50" ItemStyle-HorizontalAlign="Left"/> 
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="[Select]" CommandName="Select" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left"/> 
            </Columns> 
            </MasterTableView>  
 
            <ClientSettings> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"></Scrolling> 
            </ClientSettings> 
        </telerik:RadGrid> 




Dimo
Telerik team
 answered on 23 Jun 2008
1 answer
53 views
Rad Text editor control is losing its style after a post back event. I dont want to show the word count and the entire bottom section at all. Before the a post back the section does not show but after the post back event it shows(the bottom section , which is the word count section).  I have multiple rad text editor controls in the same ascx control.

How should I go about fixing that.
Rumen
Telerik team
 answered on 23 Jun 2008
10 answers
439 views
Hello - I have upgraded my project to use "Prometheus" from the ASP.NET version.  I have a number of context menus in XML Files.  Can they be used with the Prometheus tree view control?

Thanks in advance

Kevin
Tampa FL
Phil C
Top achievements
Rank 2
 answered on 23 Jun 2008
1 answer
121 views
Hi,

I am trying to create a custom control with the help of below link.

http://www.telerik.com/demos/aspnet/editor/examples/CustomTools/DefaultCS.aspx

Rumen
Telerik team
 answered on 23 Jun 2008
2 answers
287 views
I'm having a bit of a problem with data binding on a hierarchical grid. I think I may have painted myself into a corner a bit by some of the choices I made along the way, but I'm hoping you guys can either tell me how to make this work or propose a different way of implementing it.
The basic problem I have is that the data objects I'm using are very complex and don't really fit into the normal mechanisms for data binding since they consist of field collections which vary from object to object (so I can't use accessor binding), and are of complex types (so I can't  use data sets directly).
The way I got around this was to use Template columns which accessed the objects directly from the source. Unfortunately when I use them in a hierarchical grid I'm running into problems with the fact that only the expanded detail table gets rebound.
In a previous post you guys pointed out that I need to recreate the control structure for the view state to be bound into it, which worked fine for simple examples. In my real life sample however I actually don't know how many controls I need to create without having the data available, which means that all the other rows on the grid disappear.
Ideally from my point of view I'd turn off the view state altogether and rebuild the entire grid every postback, but when I tried that it forgets which detail tables have been opened.
So, is there any way to force a data bind on all expanded rows? Or alternatively is there a way to turn off view state while maintaining  the detail table expansion state? Or am I on completely the wrong track with what I'm doing and there's a much easier way to do it?
I've knocked up a sample which pretty much does all the things I am doing for real, including the use of a hidden row count to associate with the real data set.
Hopefully this makes some sense :)

using System; 
using System.Collections.Generic; 
using System.Data; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.WebControls; 
 
namespace GridTest1.Hierarchy 
{ 
    public partial class HierarchyComplex : Page 
    { 
        private RadGrid RadGrid1; 
 
        private List<DataItem> data; 
 
        protected override void OnInit(EventArgs e) 
        { 
            RadGrid1 = new RadGrid(); 
            SetupGrid(); 
            SetupGridColumns(); 
            form1.Controls.Add(RadGrid1); 
        } 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsPostBack) 
            { 
                RadGrid1.DataSource = MakeDataSet(); 
            } 
        } 
 
        private void SetupGrid() 
        { 
            RadGrid1.EnableViewState = true; 
            RadGrid1.MasterTableView.EnableColumnsViewState = false; 
            RadGrid1.PageSize = 30; 
            RadGrid1.AllowPaging = true; 
            RadGrid1.AllowSorting = true; 
            RadGrid1.AutoGenerateColumns = false; 
            RadGrid1.ID = "Parent"; 
 
            RadGrid1.MasterTableView.Name = "Table1"; 
            RadGrid1.MasterTableView.ID = "Table1"; 
 
            RadGrid1.PagerStyle.AlwaysVisible = true; 
            RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced; 
            RadGrid1.PagerStyle.Position = GridPagerPosition.TopAndBottom; 
 
            //RadGrid1.ItemDataBound += BindTelericGridRow; 
            RadGrid1.DetailTableDataBind += grid_DetailTableDataBind; 
            RadGrid1.NeedDataSource += grid_NeedDataSource; 
        } 
        private void SetupGridColumns() 
        { 
            MakeData(); 
            AddTemplateColumn(RadGrid1.MasterTableView, "Column1"); 
 
            GridTableView childView = new GridTableView(RadGrid1, true); 
            RadGrid1.MasterTableView.DataKeyNames = new string[] { "Column1" }; 
 
            childView.Columns.Clear(); 
            AddTemplateColumn(childView, "Column1"); 
            AddTemplateColumn(childView, "Column2"); 
            AddTemplateColumn(childView, "RowNumber").Visible = false; 
            childView.Name = "Table2"; 
            childView.AllowPaging = false; 
            childView.AllowFilteringByColumn = false; 
            childView.EnableColumnsViewState = false; 
            childView.DataMember = "Table2"; 
 
            childView.DataKeyNames = new string[] { "Column1" }; 
            GridRelationFields rel = new GridRelationFields(); 
            rel.DetailKeyField = "Column1"; 
            rel.MasterKeyField = "Column1"; 
            childView.ParentTableRelation.Add(rel); 
 
            RadGrid1.MasterTableView.DetailTables.Clear(); 
            RadGrid1.MasterTableView.DetailTables.Add(childView); 
        } 
 
        void grid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            RadGrid grid = source as RadGrid; 
            if (!e.IsFromDetailTable) 
                grid.DataSource = MakeDataSet(); 
        } 
        private GridTemplateColumn AddTemplateColumn(GridTableView view, string columnName) 
        { 
 
            GridTemplateColumn template = new GridTemplateColumn(); 
            ColumnTemplate cTemplate = new ColumnTemplate(columnName, data); 
            template.ItemTemplate = cTemplate; 
 
            template.HeaderText = columnName; 
            template.UniqueName = columnName; 
            template.DataField = columnName; 
            template.DataType = typeof(string); 
            view.Columns.Add(template); 
            return template; 
        } 
        private void grid_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) 
        { 
            DataSet data = MakeDataSet(); 
            DataTable table = data.Tables[e.DetailTableView.DataMember]; 
            e.DetailTableView.DataSource = table; 
        } 
 
        public List<DataItem> MakeData() 
        { 
            data = new List<DataItem>(); 
            int parentCount = 5; 
            int childCount = 5; 
            for (int i = 0; i < parentCount; ++i) 
            { 
                for (int j = 0; j < childCount; j++) 
                { 
                    DataItem item = new DataItem(i, i * parentCount + j, (j % 3) + 1); 
                    data.Add(item); 
                } 
            } 
            return data; 
        } 
 
        private DataSet MakeDataSet() 
        { 
            DataSet dataSet = new DataSet("DataSet"); 
 
            DataTable table = new DataTable("Table1"); 
            table.Columns.Add(new DataColumn("Column1", typeof(string))); 
            dataSet.Tables.Add(table); 
            MakeData(); 
            int parentId = -1; 
            foreach (DataItem item in data) 
            { 
                if (item.ParentId != parentId) 
                { 
                    DataRow row = table.NewRow(); 
                    row["Column1"] = item.ParentId; 
                    table.Rows.Add(row); 
                    parentId = item.ParentId; 
                } 
            } 
 
            table = new DataTable("Table2"); 
            table.Columns.Add(new DataColumn("Column1", typeof(string))); 
            table.Columns.Add(new DataColumn("Column2", typeof(string))); 
            table.Columns.Add(new DataColumn("RowNumber", typeof(int))); 
            dataSet.Tables.Add(table); 
            int rowCount = 0; 
            foreach (DataItem item in data) 
            { 
                DataRow row = table.NewRow(); 
                row["Column1"] = item.ParentId; 
                row["Column2"] = item.Id; 
                row["RowNumber"] = rowCount++; 
                table.Rows.Add(row); 
            } 
 
            return dataSet; 
        } 
 
        public class ColumnTemplate : ITemplate 
        { 
            private readonly string columnName; 
            private readonly List<DataItem> dataSet; 
            public ColumnTemplate(string columnName, List<DataItem> dataSet) 
            { 
                this.columnName = columnName; 
                this.dataSet = dataSet; 
            } 
 
            #region ITemplate Members 
 
            public void InstantiateIn(Control container) 
            { 
                ColumnControl column = new ColumnControl(columnName, dataSet); 
                column.ID = "Column" + columnName; 
                container.Controls.Add(column); 
            } 
 
            #endregion 
        } 
 
        public class DataItem 
        { 
            private readonly int parentId; 
            private readonly int id; 
            private readonly int labelCount; 
 
            public DataItem(int parentId, int id, int labelCount) 
            { 
                this.parentId = parentId; 
                this.id = id; 
                this.labelCount = labelCount; 
            } 
 
            public int LabelCount 
            { 
                get { return labelCount; } 
            } 
            public int Id 
            { 
                get { return id; } 
            } 
            public int ParentId 
            { 
                get { return parentId; } 
            } 
            public List<Label> Labels 
            { 
                get 
                { 
                    List<Label> labels = new List<Label>(); 
                    for (int i = 0; i < labelCount; ++i) 
                    { 
                        Label l = new Label(); 
                        l.Text = i.ToString(); 
                        labels.Add(l); 
                    } 
 
                    return labels; 
                } 
            } 
        } 
 
        public class ColumnControl : Control 
        { 
            private DataItem data; 
            private string columnName; 
            private string tableName; 
            private readonly List<DataItem> dataSet; 
            public ColumnControl(string columnName, List<DataItem> dataSet) 
            { 
                this.columnName = columnName; 
                this.dataSet = dataSet; 
                DataBinding += ColumnControl_DataBinding; 
            } 
 
            void ColumnControl_DataBinding(object sender, EventArgs e) 
            { 
                GridDataItem gridData = (GridDataItem)Parent.Parent; 
                tableName = gridData.OwnerTableView.Name; 
                DataRowView dataRow = (DataRowView)(gridData).DataItem; 
                if (tableName == "Table1") 
                { 
                    string item = dataRow[columnName].ToString(); 
                    HyperLink l = (HyperLink)FindControl(string.Format("{0}Label", columnName)); 
                    l.Text = item; 
                    l.NavigateUrl = "~"; 
                } 
                if (tableName == "Table2") 
                { 
                    int rowNumber = (int)dataRow["RowNumber"]; 
                    data = dataSet[rowNumber]; 
                } 
            } 
 
            protected override void CreateChildControls() 
            { 
                //if (tableName == "Table1") 
                { 
                    HyperLink l = new HyperLink(); 
                    l.ID = string.Format("{0}Label", columnName); 
                    Controls.Add(l); 
                } 
                if (tableName == "Table2") 
                { 
                    foreach (Label c in data.Labels) 
                        Controls.Add(c); 
                } 
            } 
        } 
 
    } 
} 
 
Steve Bough
Top achievements
Rank 1
 answered on 23 Jun 2008
1 answer
204 views
Hi everyone.
I have downloaded the latest version for the RadControls suite and I am having problems with the following code:

aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4._Default" %> 
 
<%@ 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"> 
    <telerik:RadScriptManager runat="server"> 
    </telerik:RadScriptManager> 
    <telerik:RadEditor ID="RadEditor1" runat="server"> 
        <Content> 
        </Content> 
    </telerik:RadEditor> 
    </form> 
</body> 
</html> 
 

cs:

using System; 
using Telerik.Web.UI; 
 
namespace WebApplication4 
{ 
    public partial class _Default : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            RadEditor1.Language = "en-US"; 
            RadEditor1.EditModes = EditModes.Design | EditModes.Html; 
            RadEditor1.SpellCheckSettings.AllowAddCustom = false; 
            RadEditor1.SpellCheckSettings.SpellCheckProvider = SpellCheckProvider.EditDistanceProvider; 
            RadEditor1.SpellCheckSettings.EditDistance = 1; 
            RadEditor1.SpellCheckSettings.DictionaryLanguage = "en-US"; 
            RadEditor1.Skin = "Vista"; 
            RadEditor1.Content = @"After having talked a bit with these nice people we learned that we 
learned that we were headed for the same destination, they were in fact 
also on their other way to Italy. It turned out that we actually had 
some things in common, all the four of us were interested in ancient 
history and wished to see Vesuvius and Pompeii.<br /> 
<br /> 
<br /> 
<a href=""#"">test</a> 
<table> 
    <tbody> 
        <tr> 
            <td>test</td> 
        </tr> 
    </tbody> 
</table> 
<br /> 
<img /> 
"; 
        } 
    } 
} 
 

Then I load the page and click in the AJAX Spellchecker button in the toolbar, everything is fine (no mistakes in the content), but after a while (1 second approx.) you will get an error from  /Telerik.Web.UI.SpellCheckHandler.axd ( I can see that using FireBug to trace the responses):
<html> 
<head> 
    <title>Value cannot be null.<br> 
        Parameter name: InString</title> 
    <style> 
        body 
        { 
            font-family: "Verdana"; 
            font-weight: normal; 
            font-size: .7em; 
            color: black; 
        } 
        p 
        { 
            font-family: "Verdana"; 
            font-weight: normal; 
            color: black; 
            margin-top: -5px; 
        } 
        b 
        { 
            font-family: "Verdana"; 
            font-weight: bold; 
            color: black; 
            margin-top: -5px; 
        } 
        H1 
        { 
            font-family: "Verdana"; 
            font-weight: normal; 
            font-size: 18pt; 
            color: red; 
        } 
        H2 
        { 
            font-family: "Verdana"; 
            font-weight: normal; 
            font-size: 14pt; 
            color: maroon; 
        } 
        pre 
        { 
            font-family: "Lucida Console"; 
            font-size: .9em; 
        } 
        .marker 
        { 
            font-weight: bold; 
            color: black; 
            text-decoration: none; 
        } 
        .version 
        { 
            color: gray; 
        } 
        .error 
        { 
            margin-bottom: 10px; 
        } 
        .expandable 
        { 
            text-decoration: underline; 
            font-weight: bold; 
            color: navy; 
            cursor: hand; 
        } 
    </style> 
</head> 
<body bgcolor="white"> 
    <span> 
        <h1> 
            Server Error in '/' Application.<hr width="100%" size="1" color="silver"> 
        </h1> 
        <h2> 
            <i>Value cannot be null.<br> 
                Parameter name: InString</i> 
        </h2> 
    </span><font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><b>Description: 
    </b>An unhandled exception occurred during the execution of the current web request. 
        Please review the stack trace for more information about the error and where it 
        originated in the code. 
        <br> 
        <br> 
        <b>Exception Details: </b>System.ArgumentNullException: Value cannot be null.<br> 
        Parameter name: InString<br> 
        <br> 
        <b>Source Error:</b> 
        <br> 
        <br> 
        <table width="100%" bgcolor="#ffffcc"> 
            <tr> 
                <td> 
                    <code>An unhandled exception was generated during the execution of the current web request. 
                        Information regarding the origin and location of the exception can be identified 
                        using the exception stack trace below.</code> 
                </td> 
            </tr> 
        </table> 
        <br> 
        <b>Stack Trace:</b> 
        <br> 
        <br> 
        <table width="100%" bgcolor="#ffffcc"> 
            <tr> 
                <td> 
                    <code> 
                        <pre> 
 
[ArgumentNullException: Value cannot be null. 
 
Parameter name: InString] 
 
   System.Convert.FromBase64String(String s) +0 
 
   Telerik.Web.Dialogs.DialogParametersSerializer.Deserialize(String serialized) +169 
 
   Telerik.Web.UI.DialogParameters.Deserialize(String source) +6 
 
   Telerik.Web.UI.SpellCheckHandler.ProcessRequest(HttpContext context) +225 
 
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358 
 
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)  
 
+64 
 
</pre> 
                    </code> 
                </td> 
            </tr> 
        </table> 
        <br> 
        <hr width="100%" size="1" color="silver"> 
        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.1433; 
        ASP.NET Version:2.0.50727.1433 </font> 
</body> 
</html> 
<!--  
 
[ArgumentNullException]: Value cannot be null. 
 
Parameter name: InString 
 
   at System.Convert.FromBase64String(String s) 
 
   at Telerik.Web.Dialogs.DialogParametersSerializer.Deserialize(String serialized) 
 
   at Telerik.Web.UI.DialogParameters.Deserialize(String source) 
 
   at Telerik.Web.UI.SpellCheckHandler.ProcessRequest(HttpContext context) 
 
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute 
 
() 
 
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
 
--> 
 

We have acquired the telerik suite with the source code also, and looking at the code I have detected an issue related to the SpellDialogParameters and the DialogParametersSerializer. I dont know if I should discuss this issue in the forum, but it has something to do with the serialization/deserialization process.

I am using the telerik dll for .net 3.5 and also the web.config is correctly configured, Windows 2003 Enterprise Edition Service Pack 2, Intel Core Duo 2.0, 1 gb RAM.

I hope that this issue could be solved by yours.

Thanks in advance.




Tervel
Telerik team
 answered on 23 Jun 2008
5 answers
137 views
Hi,

If yes, please point me in the right direction.

Thanks
Sunil

Veselin Vasilev
Telerik team
 answered on 23 Jun 2008
1 answer
140 views
I´m having some problems with the radmenu not showing up correctly in Firefox, IE works perfectly but in FF none of the visual apperiance turns up at all, and the alignment is wrong as well.

This is kind of a problem since one of our customers saw this on our live website, www.netred.se

any ideas?
Atanas Korchev
Telerik team
 answered on 23 Jun 2008
2 answers
164 views
I get this Unknown Runtime Error at this statement:

   updatePanelElement.innerHTML = rendering;

within MicrosoftAjaxWebForms.js (ScriptResource.axd) when I try to save content entered into the editor box. One posting I found on Google pointed to this error occurring due to a form tag within the content (which is true in my case - I am saving an entire htm file).

The actual save does work and the javascript error occurs after and the yellow error icon shows up on the bottom left of the IE7 window.

Is there some setting I need to set to allow any content within the editor box?

Thanks,
Gary Davis
Gary Davis
Top achievements
Rank 2
 answered on 23 Jun 2008
4 answers
112 views
Hi everybody,

on a aspx web site I placed a Grid using  the GridClientSelectColumn in order to select one single row.

However, if a user pushes the Browser's back button, the selected check box is still checkd.
When the user now checks another checkbox, there are 2 selected checkboxes, the previous and the currently selected.

However, I just want to have on checkbox selected.

Is this a bug? Does someone (telerik) have an idea how to prevent multiple checkbox selection in this scenario?

Sincerely
Oliver
Oliver
Top achievements
Rank 1
 answered on 23 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?