Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
244 views
I am getting an error when attempting to show a RadAlert in an Ajaxified control's Try/Catch block.
Here is the code from the page:
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="LinkButton1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
        Width="75px">  
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
            style="border: 0px;" /> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    </telerik:RadWindowManager> 
    <div id="left" style="float:left;width:200px">  
        <center> 
            <h3>Menu</h3> 
            <ul> 
                <li> 
                    <asp:LinkButton ID="LinkButton1" runat="server">Test RadAlert in Ajax</asp:LinkButton> 
                </li> 
            </ul> 
        </center> 
    </div> 
    <div id="content" style="float:left;width:800px">  
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="800px">  
            <asp:Label ID="lblMessage" runat="server">Main Page</asp:Label> 
        </telerik:RadAjaxPanel> 
    </div> 
    </form> 
Here is the code behind for the button:
    Private Sub LinkButton1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles LinkButton1.Click  
        Try 
            System.Threading.Thread.Sleep(3000)  
            Throw New Exception("Test of Rad Alert in Ajax")  
            Me.lblMessage.Text = "Label value changed on click of Link Button" 
        Catch ex As Exception  
            'Me.RadAjaxManager1.ResponseScripts.Add("radalert('" & ex.Message & "', 330, 210);")  
            'Me.RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function() { var f = function() { radalert('" & ex.Message & "', 330, 210, 'Test RadAlert'); Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()")  
            Me.RadAjaxManager1.ResponseScripts.Add("(function(){var f = function() { radalert('" & ex.Message & "', 330, 210, 'Test RadAlert');Sys.Application.remove_load(f);}; Sys.Application.add_load(f);})()")  
        End Try 
    End Sub 
 As you can see I have tried several ways to show the RadAlert based on threads I found on the Telerik site.  I get the following error on the first attempt to show the RadAlert, i.e. the active code.
Error message dialog box:  htmlfile: Unspecified error
With the following code hightlighted.  The line that says "_46.SetActive();" is the line of code that is highlighted.
if(_46&&_46.focus){  
window.setTimeout(function(){  
if(_46.setActive){  
_46.setActive();  
}else{  
_46.focus();  
}  
},0);  

The second choice in the Catch from the codebehind produces this error: Microsoft JScript runtime error: Object expected.

The first choice produces the exact same error as the 3rd choice.

Thanks in advance for your help with this issue!

Svetlina Anati
Telerik team
 answered on 18 Nov 2008
5 answers
641 views
I get this error when I am trying to run my app.
I am using as a datasource for a detail table  a SELECT command with two inner joins.
Should I use a stored procedure instead?
I cannot post the code because it contains greek characters.
I can upload the code somewhere if you want.
Iana Tsolova
Telerik team
 answered on 18 Nov 2008
1 answer
126 views

1. I have two events itemsrequested  and selected indexchanged on my combo box.
On pageload combo box is loaded with a single value.
On text search the selected values get loaded and after that post back occurs. After post back if I expand the dropdown original single value( the value on page load is present). Why the searched value is not present?

For Example:
I have control which displays Manufacturers. On page load I get all the manufacturers in the datatable and load the selected value(eg. 'caterpilllar') in the dropdown(By filering all the other values). So my dropdown has one value only.
Now if I type 'a' all the records starting 'a' gets filtred and loaded in the dropdown. I select one of them and post back happens so as to bring the values related to the selected. But now the dropdown has only one value i.e. 'caterpillar' which is wrong. I am not modifying the value that is attached to thew control.

2. Once I erase all the text from the text area, I want all the records coming into the dropdown list but I see this going for infinite loop in the ItemsRequested event handler.
I have put  ItemRequestTimeout="500". It is going in an infinite loop between item requested and page load. The total records are 1267.
Any help would be highly appreciated.

Veselin Vasilev
Telerik team
 answered on 18 Nov 2008
1 answer
60 views

Hi,

I'm experiencing an issue in Firefox 3.0 where the overlying dimensions of the drag handle extend down about 200 pixels, way out of the boundaries of the actual RadSlider.  Doesn't seem to happen in other browsers.  If I turn off the inline styles via the Web Developer plugin, it seems to work normally (but obviously that has other side effects).  I have verified this happens even in a completely blank page with no other styles.

Tsvetie
Telerik team
 answered on 18 Nov 2008
1 answer
68 views
You know how in your forums you allow me to Mark as post as the answer?

It would be quite useful if when I viewed my list of forum posts, that this flag would display in the list somehow so that I can tell which ones are still opened and which are closed.

In fact, if we could also sort on that and filter on that.

Right now I have pages of posts and it's hard to know which ones are closed and which are opened. It would be great to be able to just see the open ones.

Would that be possible to implement, soon?

thanks.
Moon
Paul
Telerik team
 answered on 18 Nov 2008
2 answers
114 views
Hi all

I have a RadComboBox placed inside the PagerTemplate of RadGrid

<PagerTemplate>
                                    <br /><br />
                                    <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td align="left">
                                                Selected: &nbsp;
                                                <telerik:RadComboBox ID="ActionBox" SkinID="NotFixed" runat="server">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="Delete" Value="1" />
                                                        <telerik:RadComboBoxItem Text="Mark as Read" Value="2" />
                                                        <telerik:RadComboBoxItem Text="Add to Black List" Value="3" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                                &nbsp;
                                                <asp:Button ID="GoBtn" CssClass="SmallGreenBtn" OnClick="ActionGo_Clicked" runat="server" Text="Go" />
                                            </td>
                                            <td align="right">
                                                <asp:Panel runat="server" HorizontalAlign="Right" ID="NumericPagerPlaceHolder"></asp:Panel>
                                            </td>
                                        </tr>
                                    </table>  
                                </PagerTemplate>

And a button GoBtn which fires click event, I am getting the ComboBox from Pager using the following method

private RadComboBox GetActionBox()
        {
            GridItem pagerItem = InboxGrid.MasterTableView.GetItems(GridItemType.Pager)[0];
            RadComboBox ActionBox = (RadComboBox) pagerItem.FindControl("ActionBox");
            return ActionBox;
        }

It successfully finds the Combo but the selected value is always the first item's value in the Combo, I am stack with this and cannot move forward , any help is much appreciated.

I also fire OnItemDataBound event to add the numeric pager, (just for more info)

if (e.Item is GridPagerItem)
            {
                GridPagerItem gridPager = e.Item as GridPagerItem;
                Control numericPagerControl = gridPager.GetNumericPager();
                Control placeHolder = gridPager.FindControl("NumericPagerPlaceHolder");
                placeHolder.Controls.Add(numericPagerControl);
            }

Data binding is done during the page load inside if(!IsPostBack)
Karen
Top achievements
Rank 1
 answered on 18 Nov 2008
3 answers
211 views
Dear Sir ,
plz i need help
I have two forms , form1   Called 
Assgine employe to postion.aspx   which contain radgrid and  searchemployee.aspx
1- Assgine employe to postion.aspx  contains button Called Search employee   which open Radwindow Manger  Contains  RadGrid Have all employeesNAME ,and Code
the problem that .
I want to select t employee from  radgrid in radwindow and assgin selected  value in row  to  textbox in otherfrom (assgin employee to postion )

thanks
Yavor
Telerik team
 answered on 18 Nov 2008
1 answer
86 views
I am having issues with a custom user control that only seems to be happening in IE6.  The custom control contains a radcolorpicker and a radtextbox.  When the page gets posted back, the textbox is supposed to have the hex value of the color picked in the color picker as its text.  This works correctly in IE7 and FireFox, but in IE6 the control never gets updated.   When I walk throught the code while debugging, in the OnPreRender event, the textbox is set to the correct value, but when the page renders, it has changed.  Anybody have any suggestions or have you run across this before?  The html for the user control is as follows:


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucColorPicker.ascx.cs" Inherits="userControls_ucColorPicker" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <div style="width: 100%;">  
        <div style="width: 410px; float: left">  
            <asp:Label ID="Label2" runat="server" Text="Select a color:" CssClass="normalTextBold"></asp:Label> 
        </div> 
        <div> 
            <asp:Label ID="Label1" runat="server" Text="Or enter color code:" CssClass="normalTextBold"></asp:Label> 
        </div> 
        <div style="width: 410px; float: left">  
            <telerik:RadColorPicker ID="rcpColor" runat="server" Preset="Default" AutoPostBack="True" 
                OnColorChanged="rcpColor_ColorChanged" PreviewColor="False">  
            </telerik:RadColorPicker> 
        </div> 
          
        <telerik:RadTextBox ID="rtbxColor" runat="server" Height="16px" InvalidStyleDuration="100" 
            Skin="Outlook" Width="60px" EmptyMessage="#000000" OnTextChanged="rtbxColor_TextChanged">  
        </telerik:RadTextBox> 
        <br /> 
        <asp:RegularExpressionValidator ID="revColor" runat="server" ErrorMessage="Format: # followed by 6 hex digits." 
            ControlToValidate="rtbxColor" ValidationExpression="^\#[0-9a-fA-f]{6}$">  
        </asp:RegularExpressionValidator> 
    </div> 
 

The c# code is as follows:

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
 
public partial class userControls_ucColorPicker : System.Web.UI.UserControl  
{  
    public string SelectedColor   
    {  
        get 
        {  
            return (string)ViewState["Color"];  
        }  
        set 
        {  
            ViewState["Color"] = value;  
        }   
    }  
 
    protected void Page_Load(object sender, EventArgs e)  
    {  
    }  
 
 
    //  *********************************  
    //  ***** rcpColor_ColorChanged *****  
    //  *********************************  
 
    protected void rcpColor_ColorChanged(object sender, EventArgs e)  
    {  
        SelectedColor = "#" + String.Format("{0:X2}", rcpColor.SelectedColor.R) + String.Format("{0:X2}", rcpColor.SelectedColor.G) + String.Format("{0:X2}", rcpColor.SelectedColor.B);  
        rtbxColor.Text = SelectedColor;  
    }  
 
 
    //  *********************************  
    //  ***** rtbxColor_TextChanged *****  
    //  *********************************  
 
    protected void rtbxColor_TextChanged(object sender, EventArgs e)  
    {  
        SelectedColor = rtbxColor.Text;  
    }  
 
 
    //  ***********************  
    //  ***** OnPreRender *****  
    //  ***********************  
 
    protected override void OnPreRender(EventArgs e)  
    {  
        rtbxColor.Text = SelectedColor;  
    }  
}  
 

 

 

Pavel
Telerik team
 answered on 18 Nov 2008
1 answer
122 views
Is there a way to two way data bind (<%# Bind%>) a TimeSpan object in a grid?
Yavor
Telerik team
 answered on 18 Nov 2008
2 answers
123 views
hi, I'm a newbie with radgrid, and I was wondering if it is possible to set all rows in edit mode so can be edited in a excel-like edit mode, and then commit all changes altogether.

thanks!

Ganso
Top achievements
Rank 1
 answered on 18 Nov 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?