Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
124 views
If I set the width of a column in the master table view (using HeaderStyle.Width) and then set the width again to something different, the width doesn't change and seems to get stuck at the first width that had been set. (this is using TableLayout=Fixed and UseStaticHeaders=true, and AutoGenerateColumns=true)

Is there any way to clear the columns completely in the master table view so they are recreated when autogenerating new columns?

Philip
Top achievements
Rank 1
 answered on 06 Jan 2011
2 answers
119 views

I have successfully added a radeditor control inside a server compositecontrol:

protected override void CreateChildControls() 
  
    Controls.Clear(); 
    _txtBox = new TextBox(); 
    _txtBox.ID = "txtEdit"; 
   _edrBox = new RadEditor();
    _edrBox.ID = "edrEdit";
     
    _txtBox.TextChanged += new EventHandler(txtBox_TextChanged); 
    _edrBox.ValueChanged += new EventHandler(edrBox_ValueChanged); 
    this.Controls.Add(_txtBox); 
    this.Controls.Add(_edrBox); 
  }

But the problem is, when the server control is placed inside a formview and that formview is ajaxified by a radgrid (ie, in a master/detail relationship, clicking a row on the radgrid should refresh the details inside a formview), an Ajax javascript error shows up that a null reference is detected at the time of sys.load????

Attached is the javascript code (from microsoft ajax) showing the error where variable a is NULL.

Jun
Top achievements
Rank 1
 answered on 06 Jan 2011
1 answer
127 views

Before to begin Ajax request (async postback), I execute JavaScript function, which validate and correct values of the form (removes hyphens from telephone number). Call of alert() shows that value of a field has changed. However, to the server transferred not changed value of a field (old value - before correction).

Example: I typed '55-55-55' in field and clicked button. Value of a field changes on '555555', but to the server transferred old value (before correction) - '55-55-55'. I need to transfer the corrected value. How it to make?

<%@ Page Language="C#" AutoEventWireup="true" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
  
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
      function formAdjustBeforeSubmit(sender, args) {
        var input = document.getElementById("phoneTextBox");
        //debugger;
        var val = input.value.replace(/-/g, "");
        input.value = val;    // Here we modified value of a field (remove '-' from phone number)
        alert(input.value);
      }
  </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" ClientEvents-OnRequestStart="formAdjustBeforeSubmit">
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="Panel1">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="Panel1" UpdatePanelHeight="" />
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>
  <asp:Panel ID="Panel1" runat="server">
    Phone: <asp:TextBox ID="phoneTextBox" runat="server" ClientIDMode="Static" />  
    <asp:Button ID="Button1" runat="server" Text="Save" style="margin-left:20px;"/>
  </asp:Panel>
</form>
  
</body>
</html>
Maria Ilieva
Telerik team
 answered on 06 Jan 2011
2 answers
54 views
I have a RadGrid that binds to a web service which pulls data from a SQL database. There is a Workflow that inserts records into the database which are displayed in the RadGrid, but I've noticed that when new records are inserted into the database from Workflow that the page index is reset to the first page. So, two questions: First, is this typical behavior for the RadGrid or did I do something on my own to cause this? Second, if this is typical behavior, is there anything I can do to maintain the page that I was on when the new record was inserted into the table?

Thx in advance!
Mike
Top achievements
Rank 1
 answered on 06 Jan 2011
1 answer
33 views
 <telerik:GridTemplateColumn DataField="GamePrice" HeaderText="Price" SortExpression="GamePrice"
                                    HeaderStyle-HorizontalAlign="Center" UniqueName="GamePrice" AutoPostBackOnFilter="True"
                                    FilterControlWidth="40px" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "GamePrice", "{0:C}")%>
                                        <%--<asp:Label ID="lblGamePrice" runat="server" Text='<%#  Eval("GamePrice")%>'></asp:Label>--%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtGamePrice" runat="server" onkeydown="return isNumericPrice(event.keyCode);"
                                            TabIndex="5" Text='<%# Eval("GamePrice")%>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="reqFieldValGamePrice" runat="server" ErrorMessage="RequiredFieldValidator"
                                            ControlToValidate="txtGamePrice" Text="Please enter Game price."></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>

Hello i want to find the value in itemtemplate

  if (e.CommandName == "Edit")
            {
                if (ds != null)
                {
                    grdGameInfo.DataSource = ds;
                    grdGameInfo.DataBind();


                    GridDataItem eItem = (GridDataItem)e.Item;
                    string gameGID = Convert.ToString(((Label)eItem.FindControl("lblGameGID")).Text);
                    string oldGameName = Convert.ToString(((Label)eItem.FindControl("lblGameName")).Text);
                  string oldGamePrice = Convert.ToString(e.Item.DataItem );

but oldgameprice contains null..

How find ?


                 

Pavlina
Telerik team
 answered on 06 Jan 2011
1 answer
37 views
Even in your second example of your demos page "Yahoo-style scrolling" i'm experiancing the problem : http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpaging/defaultcs.aspx 

while scrolling the bar with dragging, updates the records well, update panel is also working fine. but if i scroll the grid by scroll button down to the end, the update panel just blinks and seems to lose it's visibility, the records get updated after a while. By the time the update panel is lost and the grid refreshes with the newer records, neither client nor server events can be fired...

Exactly the same problem i'm having here, using IE8. But in Chrome it works perfectly fine...

Any solutions to this???
Mira
Telerik team
 answered on 06 Jan 2011
2 answers
71 views
When I'm not in debug mode on my machine, I am not able to test the functionality of the menu control due to a javascript error (I've seen another post detailing this limitation). I need to be able to do this to ensure that this control works on a Blackberry browser before I'll be able to make a case for buying the control for my company. Is there any way around this problem?

Thank you.
Alex
Top achievements
Rank 1
 answered on 06 Jan 2011
5 answers
185 views
Hi All,
DestroyOnClose seems to be one of those topics that reoccurs but never really gets resolved.
I am suffering from the continued caching problem regardless of the DestroyOnClose variable. The thing that has ended most other threads on this has been a Telerik support person being unable to replicate or asking for an example. So I have done one up. The simplest I can think of.  Since I cannot attach the project here, please see the code below.
Using this example :
  1. Start the solution using MainPage as the start page
  2. Click on the Launch1 button
  3. A modal popup window will appear, with the string "Launch1" on the second line - as expected.
  4. Close the window.
  5. Now click on the Launch2 button.
  6. The modal reappears, bearing the same content - is should say "Launch2" in the text.

I am using 2010.3.1109.40 version of the Telerik.Web.UI.

Please help me out with this.
Thanks,
Steele.

MainPage.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="TestTelerikWebApp.MainPage" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="buttLaunch1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="buttLaunch1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="buttLaunch2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="buttLaunch2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
        DestroyOnClose="True">
    </telerik:RadWindowManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function OpenMyWindow() {
            var oManager = null;
            if (typeof (GetRadWindowManager) == 'function') // there is a radwindowmanager in scope, so use it
                oManager = GetRadWindowManager();
  
            var oWnd = oManager.open('TestPopup.aspx', 'This is a test');
        }
    </script>
    </telerik:RadCodeBlock>
    <div>
      
        <asp:Button ID="buttLaunch1" runat="server" Text="Launch1" 
            onclick="buttLaunch1_Click" />
        <asp:Button ID="buttLaunch2" runat="server" Text="Launch2" 
            onclick="buttLaunch2_Click" />
      
    </div>
    </form>
</body>
</html>

MainPage.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
namespace TestTelerikWebApp
{
    public partial class MainPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
  
        }
  
        protected void buttLaunch1_Click(object sender, EventArgs e)
        {
            Session["ErrorInfo"] = "Launch1";
            RadAjaxManager1.ResponseScripts.Add("OpenMyWindow();");
        }
  
        protected void buttLaunch2_Click(object sender, EventArgs e)
        {
            Session["ErrorInfo"] = "Launch2";
            RadAjaxManager1.ResponseScripts.Add("OpenMyWindow();");
        }
    }
}

TestPopup.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPopup.aspx.cs" Inherits="TestTelerikWebApp.TestPopup" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      
        I am a popup<br />
        <asp:Label ID="lblMessage" runat="server"></asp:Label>
      
    </div>
    </form>
</body>
</html>

TestPopup.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
namespace TestTelerikWebApp
{
    public partial class TestPopup : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblMessage.Text = Session["ErrorInfo"].ToString();
        }
    }
}
Georgi Tunev
Telerik team
 answered on 06 Jan 2011
4 answers
177 views
Hi

I wanted to remove the Size column from the built in Media/Flash/Image Manager dialogs in the editor but on reading this posting it appears that the only solution is to hide it.

I have already customised the built in dialogs by extracting their .ascx files to a folder in my solution and from what I can see it appears that the FileBrowser.ascx is the file that i need to change.  The above posting suggests that I need to use the code below to hide the Size column.  What I cannot determine however is how to hook up this code.  There is no codebehind for fileBrowser.ascx and despite adding an inline Page_Load event to the fileBrowsers.ascx markup I cannot seem to tap into the page load event which would allow me to use the code below

GridColumn SizeColumn = RadFileExplorer1.Grid.Columns.FindByUniqueNameSafe("Size");
SizeColumn.ItemStyle.Width = Unit.Pixel(1);
SizeColumn.HeaderStyle.Width = Unit.Pixel(1);

Any suggestions on how I can achieve this ?

thanks in advance
Rumen
Telerik team
 answered on 06 Jan 2011
1 answer
187 views

Hello,

I have a problem with RadFormDecorator control.

Here is my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<%@ 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">
  
<head id="Head1" runat="server">  
    <title>Test Page</title>  
    <link rel="stylesheet" type="text/css" href="Skins/FormDecorator/00ccff/FormDecorator.00ccff.css" />
    <link rel="stylesheet" type="text/css" href="Skins/FormDecorator/00ff00/FormDecorator.00ff00.css" />
</head>  
<body>  
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager>  
    <telerik:RadFormDecorator runat="server" ID="RadFormDecorator1" Skin="00ccff" EnableEmbeddedSkins="false" DecoratedControls="CheckBoxes" DecorationZoneID="00ccffZoneID1" />
    <telerik:RadFormDecorator runat="server" ID="RadFormDecorator2" Skin="00ff00" EnableEmbeddedSkins="false" DecoratedControls="CheckBoxes" DecorationZoneID="00ff00ZoneID1" />
                                
    <span id="00ccffZoneID1" >
        <asp:CheckBox ID="CheckBox1" runat="server" />
    </span>
  
    <span id="00ff00ZoneID1">
        <asp:CheckBox ID="CheckBox2" runat="server" />
    </span>
    </form>  
</body>  
</html>

By running the above code using Chrome or Safari then I get the result which is shown in the attached image 1.jpg, and by running the above code using other browsers, I get the result which is shown in 2.jpg.

Here is FormDecorator.00ccff.css:
/* RadFormDecorator for ASP.NET 00ccff Skin */
  
/* CSS class for styling the decoration zone or the <html /> tag of the page */
.RadForm_00ccff.rfdZone
{
    background-color: Green;
    color:#00ccff;
}
  
  
/* Decorate <input type="checkbox" /> */
.RadForm_00ccff .rfdCheckboxUnchecked,
.RadForm_00ccff .rfdInputDisabled.rfdCheckboxUnchecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 0;
}
  
.RadForm_00ccff .rfdCheckboxUnchecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -200px;
}
  
.RadForm_00ccff .rfdCheckboxChecked,
.RadForm_00ccff .rfdInputDisabled.rfdCheckboxChecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -420px;
}
  
.RadForm_00ccff .rfdCheckboxChecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -640px;
}
  
  
/* the styling of radiobuttons and checkboxes in Safari and Chrome is already fully achieved with CSS */
@media screen and (-webkit-min-device-pixel-ratio: 0)
{
    /* checkboxes */
    .rfdCheckbox input[type="checkbox"],
    .rfdCheckbox input[type="checkbox"][disabled]:hover
    {
        background-image: url('CheckBox/CheckBoxSprites.gif');
    }
}
  
@media screen and (-webkit-min-device-pixel-ratio: 0)
{
    /* checkboxes */
    #cc00ffZoneID1 input[type="checkbox"],
    #cc00ffZoneID1 input[type="checkbox"][disabled]:hover
    {
        background-image: url('CheckBox/CheckBoxSprites.gif');
    }
}

And FormDecorator.00ff00.css:
/* RadFormDecorator for ASP.NET 00ff00 Skin */
  
/* CSS class for styling the decoration zone or the <html /> tag of the page */
.RadForm_00ff00.rfdZone
{
    background-color: Green;
    color:#00ff00;
}
  
  
/* Decorate <input type="checkbox" /> */
.RadForm_00ff00 .rfdCheckboxUnchecked,
.RadForm_00ff00 .rfdInputDisabled.rfdCheckboxUnchecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 0;
}
  
.RadForm_00ff00 .rfdCheckboxUnchecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -200px;
}
  
.RadForm_00ff00 .rfdCheckboxChecked,
.RadForm_00ff00 .rfdInputDisabled.rfdCheckboxChecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -420px;
}
  
.RadForm_00ff00 .rfdCheckboxChecked:hover
{
    background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -640px;
}
  
  
/* the styling of radiobuttons and checkboxes in Safari and Chrome is already fully achieved with CSS */
@media screen and (-webkit-min-device-pixel-ratio: 0)
{
    /* checkboxes */
    .rfdCheckbox input[type="checkbox"],
    .rfdCheckbox input[type="checkbox"][disabled]:hover
    {
        background-image: url('CheckBox/CheckBoxSprites.gif');
    }
}
  
/* the styling of radiobuttons and checkboxes in Safari and Chrome is already fully achieved with CSS */
@media screen and (-webkit-min-device-pixel-ratio: 0)
{
    /* checkboxes */
    #00ff00ZoneID1 input[type="checkbox"],
    #00ff00ZoneID1 input[type="checkbox"][disabled]:hover
    {
        background-image: url('CheckBox/CheckBoxSprites.gif');
    }
}

Please, I need your help,
It is appreciated to send me the modified code.

Regards,
Bader
Georgi Tunev
Telerik team
 answered on 06 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?