Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
93 views
Hi I am trying to use the RadGrid and I keep getting the following Error:

The Controls collection cannot be modified because the control contains code blocks

Any help would be much appreciated.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PluginViewAndDownloadBillData.ascx.cs" Inherits="VIPEnergyClientPortal.Plugins.PluginViewAndDownloadBillData" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<telerik:RadScriptManager ID="sm1" runat="server" EnableTheming="True">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>

<telerik:RadGrid ID="RadGrid1" runat="server" GroupPanelPosition="Top"
    ResolvedRenderMode="Classic" AllowFilteringByColumn="True"
    DataSourceID="UtilityAccounts">
    <MasterTableView AutoGenerateColumns="False" DataSourceID="UtilityAccounts">
        <Columns>
            <telerik:GridBoundColumn DataField="LocationID"
                DataType="System.Guid"
                FilterControlAltText="Filter LocationID column"
                HeaderText="LocationID" SortExpression="LocationID"
                UniqueName="LocationID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AccountNumber"
                FilterControlAltText="Filter AccountNumber column"
                HeaderText="AccountNumber"
                SortExpression="AccountNumber"
                UniqueName="AccountNumber">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Utility"
                FilterControlAltText="Filter Utility column"
                HeaderText="Utility"
                SortExpression="Utility"
                UniqueName="Utility">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Commodities"
                FilterControlAltText="Filter Commodities column"
                HeaderText="Commodities"
                SortExpression="Commodities"
                UniqueName="Commodities" ReadOnly="True">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

<asp:ObjectDataSource ID="UtilityAccounts" runat="server"
    SelectMethod="UtilityAccountData"
    TypeName="VIPEnergyClientPortal.Plugins.PluginViewAndDownloadBillData">
    <SelectParameters>
        <asp:ControlParameter ControlID="txtAccountNumber" DbType="Guid"
            Name="LocationID" PropertyName="Text" />
    </SelectParameters>
</asp:ObjectDataSource>

<asp:TextBox ID="txtAccountNumber" runat="server" Visible="false"></asp:TextBox>
Viktor Tachev
Telerik team
 answered on 10 Dec 2014
1 answer
99 views
Hi 

Is there any way to achieve this? i would like to have a 'load more' button at the end of the list which posts back to server and then adds more data. 
This needs to be server side and NOT javascript please.

Thanks in advance!

Regards
Sean
Maria Ilieva
Telerik team
 answered on 10 Dec 2014
1 answer
35 views
I am attempting to validate some data in a cell before the datasource of the grid gets modified.

Which event would allow me to inspect this cell after the user has left the cell, but before the datasource is modified?
Viktor Tachev
Telerik team
 answered on 10 Dec 2014
1 answer
88 views
When loading a save grid setting all of the filtering, grouping and sorting is display correctly.  The problem is with the columns that are Checklist list not showing the filter icon as highlight and when you click on the icon the filter checklist items are not checked (loaded through the FilterCheckListItemsRequested event).  Is there a way to highlight the filter icon and check the appropriate items in the list?
Viktor Tachev
Telerik team
 answered on 10 Dec 2014
1 answer
420 views
Hi,

I have a simple page where I create a grid programmatically. I have to put custom column on this grid, so I simulate it in using simple CustomBoundColumn who extend GridBoundColumn.
When I manipulate the grid (paging, filtering, ...), I give this message :

Cannot create column with the specified type name: CustomBoundColumn

Here is my aspx file :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DynamicGrid.aspx.cs" Inherits="DEmosTelerik.DynamicGrid" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
    <div>
        <asp:PlaceHolder runat="server" ID="PlaceHolder"></asp:PlaceHolder>
    </div>
    </form>
</body>
</html>


And my aspx.cs file :

using System;
using System.Collections.Generic;
 
using Telerik.Web.UI;
 
namespace DEmosTelerik
{
    public partial class DynamicGrid : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadGrid grid = new RadGrid();
            grid.ID = "grid";
            grid.AllowPaging = true;
            grid.PageSize = 2;
            grid.MasterTableView.AutoGenerateColumns = false;
            grid.EnableViewState = true;
            grid.AllowFilteringByColumn = true;
            grid.PagerStyle.AlwaysVisible = true;
            grid.AllowSorting = true;
            grid.NeedDataSource += Grid_NeedDataSource;
 
            PlaceHolder.Controls.Add(grid);
            if (!IsPostBack)
            {
                CustomBoundColumn boundColumn;
 
                boundColumn = new CustomBoundColumn();
                grid.MasterTableView.Columns.Add(boundColumn);
                boundColumn.DataField = "Numero";
                boundColumn.HeaderText = "Numéro";
 
                boundColumn = new CustomBoundColumn();
                grid.MasterTableView.Columns.Add(boundColumn);
                boundColumn.DataField = "Nom";
                boundColumn.HeaderText = "Nom";
                boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
                boundColumn.DataFormatString = "<nobr>{0}<nobr>";
                boundColumn.AutoPostBackOnFilter = true;
                boundColumn.ShowFilterIcon = false;
 
                boundColumn = new CustomBoundColumn();
                grid.MasterTableView.Columns.Add(boundColumn);
                boundColumn.DataField = "Prenom";
                boundColumn.HeaderText = "Prénom";
                boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
                boundColumn.DataFormatString = "<nobr>{0}<nobr>";
                boundColumn.AutoPostBackOnFilter = true;
                boundColumn.ShowFilterIcon = false;
            }
        }
 
        protected void Grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            (sender as RadGrid).DataSource = SearchEleves();
        }
 
        private List<Eleve> SearchEleves()
        {
            List<Eleve> eleves = new List<Eleve>();
            eleves.Add(new Eleve { Numero = 12345, Nom = "Garnier", Prenom = "Francis" });
            eleves.Add(new Eleve { Numero = 1457, Nom = "Caillet", Prenom = "Jonas" });
            eleves.Add(new Eleve { Numero = 5487, Nom = "Delli Gatti", Prenom = "José" });
            eleves.Add(new Eleve { Numero = 8596, Nom = "Stoppani", Prenom = "Alexandre" });
            eleves.Add(new Eleve { Numero = 8529, Nom = "Benoit", Prenom = "Roland" });
            eleves.Add(new Eleve { Numero = 5589, Nom = "Paupe", Prenom = "Daniel" });
            eleves.Add(new Eleve { Numero = 25996, Nom = "Bellanca", Prenom = "David" });
 
            return eleves;
        }
    }
 
    public class Eleve
    {
        public decimal Numero { get; set; }
 
        public string Nom { get; set; }
        public string Prenom { get; set; }
    }
 
    public class CustomBoundColumn : GridBoundColumn
    {
         
    }
}

What is wrong ?


Thank you !
Konstantin Dikov
Telerik team
 answered on 10 Dec 2014
1 answer
258 views
Hi!
I use a RadScheduler in a project but I have a problem on delete appointments.
This is my aspx:

<telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="MonthView" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday"
       Width ="100%" Height="100%" Skin="Web20" DayStartTime="00:00:00" DayEndTime="00:00:00" AllowInsert="true" AllowEdit="false"
        DataKeyField="ID" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" onappointmentinsert="schedular_AppointmentInsert" onappointmentdelete ="schedular_AppointmentDelete" DisplayDeleteConfirmation="false">

and this is my code behind:

protected void schedular_AppointmentDelete(object sender, SchedulerCancelEventArgs e)
        {
        }

When I hit delete button on an appointment, the page refresh and nothing else; the method schedular_AppointmentDelete doesn't fire and so I can't do nothing inside it.
Instead, when I use the insert appointment it works perfectly and I reach my goal.

Here is the code for the insert, that, as I say previously, works:

protected void schedular_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
       {
          
       }

It works also with SchedulerCancelEventArgs.

I' ve tried to change into:

protected void schedular_AppointmentDelete(object sender, AppointmentDeleteEventArgs e)        {                  }

but nothing appens.
Any help would be appreciate.

Thanks in advance.
Bozhidar
Telerik team
 answered on 10 Dec 2014
1 answer
164 views
Radbutton is not displaying properly after clicking. Recently Telerik released an update. After updating locally we're facing this issue. Please find the screen shot in the attachment. Before clicking the button looks fine. It is named as first.png in the attachment. And after clicking the button, we're facing the problem.It is named as second.png in the attachment. Please reply ASAP. It's an production issue.
Danail Vasilev
Telerik team
 answered on 10 Dec 2014
1 answer
106 views
Hello,

I am using your 2014 q3 release for asp.net ajax and on my Rad editot a color picker tool is availabe but there are a lot of EXTRA color available in it which i do not require . How can i limitize these color for example i only want to show White black red green Yellow and Blue colors.

How can i do it?

is there any other way so that only limited color option is given to user. 
Ianko
Telerik team
 answered on 10 Dec 2014
10 answers
1.0K+ views
Howdy!

In the course of developing the validation for user input in the website I am working on, I believe I have found a bug in the behavior of RadTextBoxes.  My website's design calls for the user to be notified of invalid inputs by changing the color of the RadTextBox to red when the input is invalid.  When the user corrects the input, the RadTextBox is supposed to turn white.  However, after the second validation, the RadTextBox seems to retain a memory of the previous color and change to that color when the user mouses over the RadTextBox, despite no mouse-over behavior being defined.

For example, let us say that the RadTextBox is first loaded onto the page with white BackColor and no text.  The user then enters some valid text, so the color stays white.  If the user enters invalid text, the RadTextBox turns red (like it is supposed to).  However, when the user mouses over the red RadTextBox, it turns white. 

Now let us say that the RadTextBox is first loaded onto the page with white BackColor and some default text.  The user then enters invalid text and the RadTextBox turns red (like it is supposed to).  If the user then changes the text to something valid, the RadTextBox turns white, but when the user mouses over it, it turns red. 

By playing around with how many valid inputs/invalid inputs are entered, it is possible to get the mouse over color to flash either the valid or invalid color.  Note that this behavior DOES NOT occur with regular TextBoxes

I have included some sample HTML and C# below that demonstrates the issue.  I would greatly appreciate some assistance in getting my RadTextBoxes to stay the proper color.

Thanks!

-----------------------------------------------------------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadTextboxExample.aspx.cs"
    Inherits="RadTextboxExample" %>

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <asp:Label ID="Label1" runat="server" Text="RadTextBox - Start Empty"></asp:Label>
        <telerik:RadTextBox ID="RadTextBox1" runat="server" AutoPostBack="True" CausesValidation="True"
            OnTextChanged="RadTextBox1_TextChanged">
        </telerik:RadTextBox>
        <br />
        <br />
        <asp:Label ID="Label2" runat="server" Text="RadTextBox - Start Full"></asp:Label>
        <telerik:RadTextBox ID="RadTextBox2" runat="server" AutoPostBack="True" CausesValidation="True"
            OnTextChanged="RadTextBox2_TextChanged" Text="Default Input">
        </telerik:RadTextBox>
        <br />
        <br />
        <asp:Label ID="Label3" runat="server" Text="TextBox"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" CausesValidation="True"
            OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
    </div>
    </form>
</body>
</html>
-----------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class RadTextboxExample : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {

    }

    protected void RadTextBox1_TextChanged(object sender, EventArgs e) {
        if (RadTextBox1.Text == "" || RadTextBox1.Text == null) {
            RadTextBox1.BackColor = System.Drawing.Color.Red;
        } else {
            RadTextBox1.BackColor = System.Drawing.Color.White;
        }
    }

    protected void RadTextBox2_TextChanged(object sender, EventArgs e) {
        if (RadTextBox2.Text == "" || RadTextBox2.Text == null) {
            RadTextBox2.BackColor = System.Drawing.Color.Red;
        } else {
            RadTextBox2.BackColor = System.Drawing.Color.White;
        }
    }

    protected void TextBox1_TextChanged(object sender, EventArgs e) {
        if (TextBox1.Text == "" || TextBox1.Text == null) {
            TextBox1.BackColor = System.Drawing.Color.Red;
        } else {
            TextBox1.BackColor = System.Drawing.Color.White;
        }
    }
}
-----------------------------------------------------------------------------------------------------------------------------------------------------
Vasil
Telerik team
 answered on 10 Dec 2014
5 answers
194 views
Hello, I am attempting to automate file upload using a third party site. The site is using AsyncUpload. I am able to manually click on the Telerik control to activate the Dialog. But unable to activate the Dialog using VB.Net and the WebBrowser control (See screen shot attachment).

Thank you very much for help!

3rd Party HTML Section:
<tr align="top"> 
    <td nowrap="nowrap" align="right"><font color="#ff0000">*</font> File:</td> 
    <td> 
    <div id="ctl00_ContentPlaceHolder1_SendFile" class="RadAsyncUpload RadUpload RadUpload_Default"> 
        <input id="ctl00_ContentPlaceHolder1_SendFile_ClientState" name="ctl00_ContentPlaceHolder1_SendFile_ClientState" type="hidden" /> 
    </div> 
    </td>
</tr>
<tr> 
    <td align="right" colspan="2"><input type="image" name="ctl00$ContentPlaceHolder1$ibSendBatchSubmit" id="ctl00_ContentPlaceHolder1_ibSendBatchSubmit" class="ibBatchSendSubmit" src="images/btn_send.gif" alt="Send Batch" style="border-width:0px;" /></td>
</tr>

vb.net logic:

WebBrowser.Document.GetElementById("ctl00_ContentPlaceHolder1_SendFile_ClientState").InvokeMember(

 

"click")

I also tried using the <div> ID "ctl00_ContentPlaceHolder1_SendFile" class without success

 



Plamen
Telerik team
 answered on 10 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?