Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
1.2K+ 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
250 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
3 answers
97 views
We have a RadMenu that is worked perfectly all pages, except this one page.  On this one page we have a WPF form (i.e. XBAP file) being loaded in a iframe.  On this page, the RadMenu stops working.  I am able to see the parent buttons, but all of the drop down areas no longer appear.

How can the RadMenu co-exist with this WPF component?

Thanks
Scott Manning
Top achievements
Rank 1
 answered on 09 Dec 2014
9 answers
544 views
I just  want to do a caps lock is on tooltip before hitting any key and on key press.
Mehmet
Top achievements
Rank 1
 answered on 09 Dec 2014
3 answers
165 views
Hi,
I am using VS2013 with Q3 2014 controls, setting a textbox label property works fine at runtime but in the designer the width has no effect. Not sure if this is a bug bug?
Maria Ilieva
Telerik team
 answered on 09 Dec 2014
8 answers
184 views
I have a Scheduler bind to a datasource that is linked to a SQL-server.
When I have a schedule with a reminder, I want to save the response to the reminder (Snooze or Dismiss).  When I now Snooze or Dismiss and I close my website and restart the Snooze or Dismiss are gone.

I have set the DataReminderField to my field in the database, I use AppointUpdate and appointsInsert events.  This all works fine.

How can I save the Snooze selection and the Dismiss to the Reminder field in the database?

​
Boyan Dimitrov
Telerik team
 answered on 09 Dec 2014
1 answer
290 views
I am building a datable from Active Directory data and using this as datasource for my grid but I get the error:

"Cannot find any bindable properties in an item from the datasource "

The error is because I am using: dt.Columns.Add(new DataColumn(property, typeof(Object)));

I don't know if this is a bug or not but I can use that same datable as datasource for winforms DataGridView just fine.
Konstantin Dikov
Telerik team
 answered on 09 Dec 2014
1 answer
106 views
I'm sure that would make a good name for a dance.

To see what I consider to be the problem go to any  image editor demo such as this one.
http://demos.telerik.com/aspnet-ajax/imageeditor/examples/overview/defaultcs.aspx

Click on the crop icon. The crop box appears at the top left of the image and the dialog box opens as well.
Move the crop box from the top left corner to somewhere around the center of the image.
Now try to resize the crop box using any of the nodes on the left side of the crop box.
You will see the crop box jump to the right of the image.

This seems to me to be a bug in the javascript code and should be very easy to fix. I'm not a javascript coder but I believe the offending code is in the ascx file that defines how the crop box works.
Vessy
Telerik team
 answered on 09 Dec 2014
7 answers
252 views
Hi,

I am currently evaluating my options for reading an iCalendar file and displaying it on the web in a read only format.

I am considering using the RadScheduler for this purpose, however in looking in the documentation, I don't see a way to import/read an iCalendar file for RadScheduler.

Is there such an option or could some custom code allow me to read an iCalendar file?

This iCalendar file will be updated periodically through WebDAV from Microsoft Exchange. Thanks.

Andre
Ricard Bertran Vall
Top achievements
Rank 1
 answered on 09 Dec 2014
7 answers
295 views
Hi All,

I'm trying to find a way to correctly hide the master table row if there are now details.

protected void myGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {


        if (!e.IsFromDetailTable)
        {
         myGrid.DataSource = GetMasterData(Val1, Val2);  // filter by values
        }
 }


protected voidmyGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
        GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem;
        if (parentItem.Edit)
        {
            return;
        }

        if (e.DetailTableView.Name == "ChildItems")
        {
            e.DetailTableView.DataSource = GetChildItems(int.Parse(parentItem.GetDataKeyValue("ID").ToString()), val1, val2, val3); // filter the rows off of other values
        }
}


Now my issue is that GetChildItems may return 0 rows if the filters don't return any matches.  I've tried looping over the data on a pre_render, but paging gets messed up because it's still part of the datasource.  I've seen that you have to remove it from the datasource, but how is that done if I only know if it should be removed after the detail is bound to it?


    protected void myGrid_PreRender(object sender, EventArgs e)
    {

       
        foreach (GridDataItem gdi in myGrid.MasterTableView.Items)
        {
            //LineCount is the count of child items that the parent actually has.
//so if the MasterData.ChildTable doesn't have items, but  it actually has lines in the DB, hide it.
            if (gdi.ChildItem.NestedTableViews[0].Items.Count == 0 && gdi["LineCount"].Text != "0")
            {
               //this messes up the paging.
                gdi.Display = false;
                gdi.ChildItem.Display = false;
            }
        }

Ideally I don't want to have to pass the child parameters into the GetMasterData() function.

Thanks in advanced.







Angel Petrov
Telerik team
 answered on 09 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?