Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
216 views

Hi All,

I have a Windows Server 2008 / SQL 2008 / VS 2008 machine and was trying to load the the Live Demos project, but compiling it gave the following error:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. 

The reason is that you (wisely) said "yes" to creating a backup of the project, and it created a Backup folder.  Unfortunately, this backup folder contains a web.config file, VS2008 is confused because it found multiple web.config files in the root folder AND sub-folders off of the main web site.

The solution is just to move the Backup folder out of the Live Demos folder, somewhere else for safe keeping.  Recompile!  Now your live demos are running in VS2008!  Enjoy.

Ed.
Toronto, Canada.
"Choose your destiny, flawless victory..."

TriZetto
Top achievements
Rank 1
 answered on 09 Apr 2009
1 answer
110 views
I read the article posted at the below link: 
http://www.telerik.com/community/code-library/aspnet-ajax/combobox/radcombobox-advanced-multiple-selection.aspx

I implemented it successfully but the only issue is that when the page posts back due to a user's action, all the radcombo text values are wiped off and it defaults back to the first item in the radcombo. 

When I use a radajax manager to define what gets updated, it maintains the text values but (I have a crystal report viewer on the page) my crystal report viewer does not show. (I know there's an issue with Crystal Reports and Ajax) so I've abounded this route. Is there a way to keep all the values (of the radcombo text) even after a postback.

thanks.
Afo
Top achievements
Rank 1
 answered on 09 Apr 2009
3 answers
102 views
Is the charted shown here: Chart Example possible?

It's kind of an area chart and a line chart.  The upper and lower bounds of the shaded area are actually 2 different series, the area in between them is shaded.  Then there is another series which displayes the middle line.

Thanks for any assistance!!!
Giuseppe
Telerik team
 answered on 09 Apr 2009
1 answer
82 views
I have a row drop event handler on the page. When I add or delete an item to the grid from another pop-up page and close the pop-up window, row drop event handler gets invoked. Why is row drop event handler invoked if I am not doing drag and drop. How can I prevent this? I am also dragging from radgrid and dropping on radtree and want the rowdrop event invoked when doing that.
Thanks,
Rajesh Aggarwal
Top achievements
Rank 1
 answered on 09 Apr 2009
1 answer
98 views
Hey guys,
 I am so close I can taste it... So I have a radcombo that's using load-on-demand. It's a trigger/control parameter for a formview in an ajax panel. It's not bound to a datasource, it gets filled in the ItemsRequested Sub. The combo contains a list of names and the formview allows the user to edit the selected name. So on Formview_ItemUpdated I want to update the radcombo in case they edited the name associated with the record. Here's where my problem lies. I tried just calling radcombo.databind on the ItemUpdated event, but no change - because it's load-on-demand, I don't thing the radcombo has a datasource anymore. As far as I can see I would have to call the itemrequested event to actually update the radcombo, but I don't know how to do that from code behind, as I don't think I have the proper RadComboBoxItemsRequestedEventArgs. I could make my own "load the combo" but I need a few bits of info that all seem to live in the RadComboBoxItemsRequestedEventArgs (I would need most of the arguements to properly rebuild the list)

I *think* this is a simple request, and I've looked all over the forum before posting (this time)... 
Chris
Chris
Top achievements
Rank 1
 answered on 09 Apr 2009
5 answers
155 views
Hi,

I am trying to dynamically add asp.net controls and RadDatePicker control to a placeholder placed on my usercontrol which in turn is placed on an ASP.Net web page. I am then using PlaceHolder.RenderControl method to create HTML which I would inject in my asp.net page using jquery.

 

The code that I am using is -

RadDatePicker
datePickerControl = new RadDatePicker();

 datePickerControl.SelectedDate =

DateTime.Now;

 

 

 

datePickerControl.ImagesPath = Constants.CustomSkin.DatePickerImagePath;

 

 

myPlaceholder

.Controls.Add(datePickerControl);

 

 

System.Text.

StringBuilder sb = new System.Text.StringBuilder();

 

System.IO.

TextWriter tw = new System.IO.StringWriter(sb);

 

System.Web.UI.

HtmlTextWriter htmlText = new System.Web.UI.HtmlTextWriter(tw);

 

myPlaceholder.RenderControl(htmlText);

 

htmlText.InnerWriter.ToString();

 

 

However, I get following exception when RadDatePicker is added to placeholder and then I try to render HTML. (It works fine with other asp.net controls)

base {System.Exception} = {"Object reference not set to an instance of an object."}
at Telerik.Web.UI.DatePickingInput.RenderBeginTag(HtmlTextWriter writer)
   at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
   at Telerik.Web.UI.RadWebControl.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at Telerik.Web.UI.RadDatePicker.AddControlComponents(HtmlTextWriter writer)
   at Telerik.Web.UI.RadDatePicker.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
   at Telerik.Web.UI.RadWebControl.RenderContents(HtmlTextWriter writer)
   at Telerik.Web.UI.RadDatePicker.RenderContents(HtmlTextWriter writer)
   at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
   at Telerik.Web.UI.RadWebControl.Render(HtmlTextWriter writer)
   at Telerik.Web.UI.RadDatePicker.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlTableRow.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlTable.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Control.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

Can you please let me know where I am going wrong?

Thank you.

Regards,
Himali Singh

Rosen
Telerik team
 answered on 09 Apr 2009
5 answers
70 views
Here is a screenshot of my current calendar

Screenshot

no matter what I do I can't get the drop down to show up to choose the selected day. I even tried just a brand new project with just the calendar and no luck.


Rick
Top achievements
Rank 1
 answered on 09 Apr 2009
0 answers
366 views
So I've been going round and round trying to get Linq to work with RadGrid and be able to both filter and sort my columns (which are added at runtime). I was capturing all kinds of events trying to get the right sequence for determining whether I need to rebuild my columns, bind data, and set the datasource. The closest I got was either I could sort the grid and the column headers would not disappear, or I could filter the columns on the first postback. If sort worked, then I would have to filter twice to get the filter to stick.

Long story short, if you are binding, through Linq, to an array of some type (guessing anything but a true datasource control), you have to use the AsQueryable() at the end of it. Then, sorts work, filters work, and it doesn't require any more code than to fetch the data and build the grid columns.

Why oh why didn't I find this sooner :)

<%@ Page Language="C#" AutoEventWireup="true"   
    CodeFile="Default.aspx.cs" Inherits="Webpage.Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI, Version=2008.3.1125.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
    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"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Configurable List</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
          
        <telerik:RadGrid ID="gridResults" runat="server" GridLines="None"   
            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True">  
            <HeaderContextMenu EnableTheming="True">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </HeaderContextMenu> 
            <MasterTableView AutoGenerateColumns="False">  
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            </ClientSettings> 
            <FilterMenu EnableTheming="True">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </FilterMenu> 
        </telerik:RadGrid> 
          
    </div> 
    </form> 
</body> 
</html> 
 

using System;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
using Entities;  
using System.Collections.Generic;  
using System.Linq.Expressions;  
using Telerik.Web.UI;  
using System.Linq.Dynamic;  
 
namespace Webpage {  
    public partial class Default : System.Web.UI.Page {  
        private ShipmentList _results = new ShipmentList();  
 
        private string[] _columns = new string[] {  
            "AuthNumber""Origin""Destination""ShipmentDate""ArrivalDate" 
        };  
 
        protected void Page_Load(object sender, EventArgs e) {  
            RefreshData();  
            RebuildGrid();  
 
            var query = _results.Shipments.AsQueryable();  
            gridResults.DataSource = query;  
 
            gridResults.Rebind();  
        }  
 
        private void RebuildGrid() {  
            gridResults.MasterTableView.Columns.Clear();  
 
            foreach (string colName in _columns) {  
                GridBoundColumn gridCol = new GridBoundColumn();  
                gridCol.DataField = colName;  
                gridCol.HeaderText = colName;  
                gridCol.SortExpression = colName;  
                gridCol.UniqueName = colName;  
                gridResults.MasterTableView.Columns.Add(gridCol);  
            }  
        }  
 
        private void RefreshData() {  
            _results = new ShipmentList();  
            List<Shipment> shipments = new List<Shipment>();  
 
            for (int i = 0; i < 100; i++) {  
                Shipment shipment = new Shipment();  
                shipment.AuthNumber = (i + 972234).ToString();  
                shipment.ArrivalDate = DateTime.Now;  
                shipment.Destination = "Someplace";  
                shipment.Origin = "Diffplace";  
                shipment.ShipmentDate = DateTime.Now;  
                shipments.Add(shipment);  
            }  
 
            _results.Shipments = shipments;  
        }  
    }  
Tyson
Top achievements
Rank 1
 asked on 09 Apr 2009
3 answers
166 views
Alright guys I am trying to use the aggregate sums in the grid footer to do an update everytime a grid value is updated.  When they edit a row or add a record in the grid I need an update to fire that uses the NEW footer values to update a seperate totals table after the record is changed or iserted and after the grid rebind with the new totals in the footer.  Of course to make it more interesting they want all five grids on the same page and i need to maintain those as well on update. 

Protected Sub radgrid_OtherDetail_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles radgrid_OtherDetail.ItemUpdated

getMyTotals()

 

End Sub

 

Protected Sub radgrid_LodgingDetail_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles radgrid_LodgingDetail.ItemUpdated

GetMyTotals()

 

End Sub

 

Protected Sub radgrid_DiningDetail_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles radgrid_DiningDetail.ItemUpdated

GetMyTotals()

 

End Sub

 

Protected Sub radgrid_EventDetail_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles radgrid_EventDetail.ItemUpdated

GetMyTotals()

 

End Sub

 

Protected Sub radgrid_TransDetail_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles radgrid_TransDetail.ItemUpdated

GetMyTotals()

 

End Sub

Protected

 

Sub GetMyTotals()

 

 

'Get the totals from grids for parameters in the totals update

 

Dim footerItemOther As GridFooterItem = CType(radgrid_OtherDetail.MasterTableView.GetItems(GridItemType.Footer)(0), GridFooterItem)

 

Dim footerItemDining As GridFooterItem = CType(radgrid_DiningDetail.MasterTableView.GetItems(GridItemType.Footer)(3), GridFooterItem)

 

Dim footerItemTransDetail As GridFooterItem = CType(radgrid_TransDetail.MasterTableView.GetItems(GridItemType.Footer)(0), GridFooterItem)

 

Dim footerItemLodging As GridFooterItem = CType(radgrid_LodgingDetail.MasterTableView.GetItems(GridItemType.Footer)(0), GridFooterItem)

 

Dim footerItemEvent As GridFooterItem = CType(radgrid_EventDetail.MasterTableView.GetItems(GridItemType.Footer)(0), GridFooterItem)

SqlDS_UpdateOtherTotals.UpdateParameters.Item(

 

"Total_Actual_Other_Expenses").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateOtherTotals.UpdateParameters.Item(

 

"Total_Actual_Travel_Expenses").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateOtherTotals.UpdateParameters.Item(

 

"Modified_Date").DefaultValue = Date.Now()

SqlDS_UpdateLodgingTotals.UpdateParameters.Item(

 

"Total_Actual_Lodging_Expense").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateLodgingTotals.UpdateParameters.Item(

 

"Total_Actual_Travel_Expenses").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateLodgingTotals.UpdateParameters.Item(

 

"Modified_Date").DefaultValue = Date.Now()

SqlDS_UpdateDiningTotals.UpdateParameters.Item(

 

"Total_Actual_Dining_Expense").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateDiningTotals.UpdateParameters.Item(

 

"Total_Actual_Travel_Expenses").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateDiningTotals.UpdateParameters.Item(

 

"Modified_Date").DefaultValue = Date.Now()

SqlDS_UpdateTransTotals.UpdateParameters.Item(

 

"Total_Actual_Transportation_Expense").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateTransTotals.UpdateParameters.Item(

 

"Total_Actual_Travel_Expenses").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateTransTotals.UpdateParameters.Item(

 

"Modified_Date").DefaultValue = Date.Now()

SqlDS_UpdateEventTotals.UpdateParameters.Item(

 

"Total_Actual_Event_Expense").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateEventTotals.UpdateParameters.Item(

 

"Total_Actual_Travel_Expenses").DefaultValue = CDbl(footerItemOther.ToString)

SqlDS_UpdateEventTotals.UpdateParameters.Item(

 

"Modified_Date").DefaultValue = Date.Now()

sqlDS_hugeTotal.Update() 

 

End Sub
Here is my sql:
UPDATE [Travel_Reimbursement] SET [Trip_Identifier] = @Trip_Identifier, [Total_Actual_Travel_Expenses] = @Total_Actual_Travel_Expenses, [Total_Actual_Other_Expenses] = @Total_Actual_Other_Expenses, [Total_Actual_Dining_Expense] = @Total_Actual_Dining_Expense, [Total_Actual_Lodging_Expense] = @Total_Actual_Lodging_Expense, [Total_Actual_Transporation_Expense] = @Total_Actual_Transporation_Expense, [Modified_Date] = @Modified_Date, [Total_Actual_Event_Expense] = @Total_Actual_Event_Expense WHERE [Reimbursement_Identifier] = @Reimbursement_Identifier

I'm guessing my timing is wrong and the values in the footer have not been recalced before the update fires.  Should i be using the itemupdated event or itembound and if i use itembound will it fire 5 times everytime the page loads?   I'm also wide open if anyone has a better way to accomplish this.

Sebastian
Telerik team
 answered on 09 Apr 2009
0 answers
87 views

My RadEditor has an Ajax call to save file on webserver as following. The codes are recommended from the documentation:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

 

   <script type="text/javascript">

 

 

 

       function ajaxRequest(operation)

 

 

        {

 

           var ajaxManager = <%= RadAjaxManager1.ClientID %>;

 

 

 

 

 

           ajaxManager.ajaxRequest(operation);

 

 

        }

 

   </script>

 

 

 

</telerik:RadScriptBlock>

In my code behind file, I have a  temp variable:
string temp;

 

 

 

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)

 

    {

        if (e.Argument != "Save")

            {

 

               return;

 

 

             }

 

        //Saving content

 

 

 

 

       string content = RadEditor1.Content;

 

 

    }

 

protected void Page_Load(object sender, EventArgs e)

 

 

 {
        temp =
"123";
}

The problem I'm having is that whenever user hits the save button, the global variable (temp) is wiped out. This is very frustrating...! Could someone help me please? I don't know what to do... Thanks!

 

 

 

 

 

 

 

Chanh
Top achievements
Rank 1
 asked on 09 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?