Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
Thanks for your help.  :-)
Schlurk
Top achievements
Rank 2
 answered on 04 Dec 2009
4 answers
252 views
Going crazy here:
I am trying to validate a dynamically created RadNumericInput box. I have wired the OnValueCHanged event as follows:

newControl.ClientEvents.OnValueChanged = "CheckAllocation"

I have a javascript routine as follows (stripped down for example):

function CheckAllocation(sender, eventArgs) {
 
...(do some checking and if number not good then...)

sender.set_value(eventArgs.get_oldValue());
    eventArgs.set_cancel(true);
     sender.focus();
    return false;
    }

I simply want to put the old value back in the box and return focus to the sender. The event fires fine and code seems to run, but the focus goes to wherever I clicked, and when I put the old value back in the box it fires OnValueChanged event again...

Is there something I am missing? This seems like it should be pretty simple...

Many Thanks
Ford



Maas Prog
Top achievements
Rank 1
 answered on 04 Dec 2009
8 answers
568 views
Hi,

Don't know if there is a fix for this, but I get a System.OutOfMemoryException when exporting data to pdf using the RadGrid 5.1.2.0

My stack trace is : 

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
  at Telerik.Apoc.Layout.BorderAndPadding.Clone()
  at Telerik.Apoc.Fo.Flow.TableCell.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.TableRow.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.Table.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.Block.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
  at Telerik.Apoc.Fo.Flow.Flow.Layout(Area area)
  at Telerik.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
  at Telerik.Apoc.StreamRenderer.Render(PageSequence pageSequence)
  at Telerik.Apoc.Fo.FOTreeBuilder.EndElement()
  at Telerik.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)

Description: 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.

Exception Details: System.SystemException: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
  at Telerik.Apoc.Layout.BorderAndPadding.Clone()
  at Telerik.Apoc.Fo.Flow.TableCell.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.TableRow.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.Table.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.Block.Layout(Area area)
  at Telerik.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
  at Telerik.Apoc.Fo.Flow.Flow.Layout(Area area)
  at Telerik.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
  at Telerik.Apoc.StreamRenderer.Render(PageSequence pageSequence)
  at Telerik.Apoc.Fo.FOTreeBuilder.EndElement()
  at Telerik.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)

Source Error:

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.

Stack Trace:

[SystemException: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at Telerik.Apoc.Layout.BorderAndPadding.Clone()
   at Telerik.Apoc.Fo.Flow.TableCell.Layout(Area area)
   at Telerik.Apoc.Fo.Flow.TableRow.Layout(Area area)
   at Telerik.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
   at Telerik.Apoc.Fo.Flow.Table.Layout(Area area)
   at Telerik.Apoc.Fo.Flow.Block.Layout(Area area)
   at Telerik.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
   at Telerik.Apoc.Fo.Flow.Flow.Layout(Area area)
   at Telerik.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
   at Telerik.Apoc.StreamRenderer.Render(PageSequence pageSequence)
   at Telerik.Apoc.Fo.FOTreeBuilder.EndElement()
   at Telerik.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)]
   Telerik.Apoc.ApocDriver.FireApocError(String message) +78
   Telerik.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader) +628
   Telerik.Apoc.ApocDriver.Render(XmlReader inputReader, Stream outputStream) +334
   Telerik.Apoc.ApocDriver.Render(TextReader inputReader, Stream outputStream) +41
   Telerik.WebControls.Grid.Export.TableViewExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form) +1072
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2065835
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
   Telerik.WebControls.Grid.Export.TableViewExporter.PdfExportRenderPage(HtmlTextWriter nullWriter, Control page) +102
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2065835
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896

Any feedback is appreciated
dany7487
Top achievements
Rank 1
 answered on 04 Dec 2009
1 answer
101 views
I have a chart that uses a sql stored procedure as a data source.
The issue that i'm having is that I can't seem to set the X Axis DataLabelsColumn.

It seems stuck on just a generic 1,2,3,4,5,6,7.....etc.
I'm using the following line: 
    RadChart1.PlotArea.XAxis.DataLabelsColumn = "Column1"
with Column1 being a column in the sql stored procedure data results.
It doesn't work.
Is there something that I'm missing or doing wrong? Should i be using a "SELECT statement" rather than a stored procedure?
Thanks.

Dan Schmecker
Top achievements
Rank 1
 answered on 04 Dec 2009
2 answers
644 views
I am trying to convert a standard asp.net GridView to a RadGrid.

My set up is Windows XP Pro SP3, ASP.NET AJAX controls 2009 Q1 and Visual Studio 2008 3.5 Framework.

In the GridView I have code that will allow me to edit/update/cancel a record.

Please see below the asp.net code with standard GridView
protected void Page_Load(object sender, EventArgs e) 
    { 
        //Load the categories grid only the first tim the page is loaded 
        if (!IsPostBack) 
        { 
            //Load the categories grid 
            BindGrid(); 
 
        } 
    } 
 
    //Populate the GrdView with data 
    private void BindGrid() 
    { 
        //Get category from query string 
        string categoryId = Request.QueryString["CategoryID"]; 
 
        //Get a DataTable object containing the categories 
        grid.DataSource = CatalogAccess.CatalogGetCategories(); 
 
        //Bind the data to the grid 
        grid.DataBind(); 
    } 
 
    //Enter row into edit mode 
    protected void grid_RowEditing(object sender, GridViewEditEventArgs e) 
    { 
        //set the row for which to enale edit mode 
        grid.EditIndex = e.NewEditIndex; 
 
        //set status message 
        statusLabel.Text = "Editing row " + e.NewEditIndex.ToString(); 
 
        //Reload the grid 
        BindGrid(); 
    } 


protected void grid_RowUpdating(object sender, GridViewUpdateEventArgs e) 
    { 
        //retrieve the updated data 
        string id = grid.DataKeys[e.RowIndex].Value.ToString(); 
        string name = ((TextBox)grid.Rows[e.RowIndex].Cells[0].Controls[0]).Text; 
        string description = ((TextBox)grid.Rows[e.RowIndex].FindControl("descriptionTextBox")).Text; 
 
        //execute the update command 
        bool success = CatalogAccess.UpdateCategory(id, name, description); 
 
        //cancel edit mode 
        grid.EditIndex = -1; 
 
        //display status message 
        statusLabel.Text = success ? "Update successful" : "Update failed"; 
 
        //reload the grid 
        BindGrid(); 
 
    } 
 


Is there a way to achieve the same thing with the RadGrid?  I would appreciate it if anyone could point me in the right direction.

Many thanks

Simon
Simon
Top achievements
Rank 1
 answered on 04 Dec 2009
5 answers
175 views
I have MANY controls on a page that can UPDATE one control, but it will only do one!

This is a sample code:

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" />

 

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >

 

 

 

    <AjaxSettings>

 

 

 

        <telerik:AjaxSetting AjaxControlID="btnBack">

 

 

 

            <UpdatedControls>

 

 

 

                <telerik:AjaxUpdatedControl ControlID="tp"/>

 

 

 

            </UpdatedControls>

 

 

 

        </telerik:AjaxSetting>

 

 

 

    <telerik:AjaxSetting AjaxControlID="btnForward">

 

 

 

            <UpdatedControls>

 

 

 

                <telerik:AjaxUpdatedControl ControlID="tp"/>

 

 

 

            </UpdatedControls>

 

 

 

    </telerik:AjaxSetting>

 

 

 

    </AjaxSettings>

 

 

 

 

</telerik:RadAjaxManager>

Why is it that only the top control works but the Manager ignores the other?

Thanks

 

 

O'Man
Top achievements
Rank 1
 answered on 04 Dec 2009
2 answers
111 views
After a postback, I expand the splitter to show the top pane and it's blank.  I inspected the markup and see that the width and height of the top pane are 0px.  This only seems to happen after a postback has occurred.  Has anyone else encountered this?
Jason Reis
Top achievements
Rank 1
 answered on 04 Dec 2009
2 answers
655 views
not sure if I'm missing something obvious here - but is there a way to right align a single menu item?
Basically I have a 100% width menu - where I want most of the menu items to appear normally (aligned to the left) but the last item (a logoff button) to always appear at the right side (end) of the menu.

Possible?
barshj
Top achievements
Rank 1
 answered on 04 Dec 2009
3 answers
135 views
I have a simple page with a listbox and two buttons. I use a RadAjaxManager and an RadAjaxPanel. I have tried setting the manager to handle the panel requests and I have tried using to the panel itself to handle the ajax requests.  Neither method will raise the OnRequestStart event when I click a button and handle the buttons click event.

I have this working in plenty of other places.  I cant seem to determine why in this case it is not working. Functionally, they are identical.

any ideas?  Is there any absolute method to try which will always cause the event to fire?



Pavlina
Telerik team
 answered on 04 Dec 2009
10 answers
404 views
We are implementing a Month/Year picker (http://www.telerik.com/community/code-library/aspnet-ajax/calendar/month-year-picker.aspx#944510) in the FilterTemplate of a RadGrid. I have copied the code from the grid below.  I have not been able to get the javascript to get a reference to the pickers ClientID - the compiler complains it does not know the TechManListPicker control.

Thanks

<telerik:GridDateTimeColumn HeaderText="Technical Manual Date" ReadOnly="true" DataField="TechnicalManualDate" DataFormatString="{0:MM/yyyy}">
                    <FilterTemplate>
                        <telerik:RadDatePicker ID="TechManListDatePicker" runat="server">
                            <DateInput DateFormat="MM/yyyy">
                            </DateInput>
                            <Calendar>
                                <FastNavigationSettings TodayButtonCaption="current date" />
                            </Calendar>
                        </telerik:RadDatePicker>
                        <telerik:RadScriptBlock ID="radScriptBlock" runat="server" >
                            <script type="text/javascript">
                                //override the onload event handler to change the picker after the page is loaded
                                //Sys.Application.add_load(setCalendarTable);

                                function setCalendarTable() {

                                    var picker = $find("<%= TechManListDatePicker.ClientID %>");
                                    var calendar = picker.get_calendar();
                                    var fastNavigation = calendar._getFastNavigation();

                                    $clearHandlers(picker.get_popupButton());
                                    picker.get_popupButton().href = "javascript:void(0);";
                                    $addHandler(picker.get_popupButton(), "click", function() {
                                        var textbox = picker.get_textBox();
                                        //adjust where to show the popup table
                                        var x, y;
                                        var adjustElement = textbox;
                                        if (textbox.style.display == "none")
                                            adjustElement = picker.get_popupImage();

                                        var pos = picker.getElementPosition(adjustElement);
                                        x = pos.x;
                                        y = pos.y + adjustElement.offsetHeight;

                                        var e = {
                                            clientX: x,
                                            clientY: y - document.documentElement.scrollTop
                                        };
                                        //synchronize the input date if set with the picker one
                                        var date = picker.get_selectedDate();
                                        if (date) {
                                            calendar.get_focusedDate()[0] = date.getFullYear();
                                            calendar.get_focusedDate()[1] = date.getMonth() + 1;
                                        }

                                        $get(calendar._titleID).onclick(e);

                                        return false;
                                    });

                                    fastNavigation.OnOK =
                                        function() {
                                            var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);
                                            picker.get_dateInput().set_selectedDate(date);
                                            fastNavigation.Popup.Hide();
                                        }


                                    fastNavigation.OnToday =
                                        function() {
                                            var date = new Date();
                                            picker.get_dateInput().set_selectedDate(date);
                                            fastNavigation.Popup.Hide();
                                        }
                                }   
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridDateTimeColumn>
Pavlina
Telerik team
 answered on 04 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?