Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
268 views

Hi There,
I've upgrade my project to Microsoft Enterprise Library 5.0 (former version was 4.1) but I got a runtime error when the Rad Grid is binding.
My code is something like below:

public static IDataReader GetAllOrders()   
{  
    SqlDatabase db = new SqlDatabase(connString);   
    return db.ExecuteReader("Orders_GetAll");   
}  
 
protected void Page_Load(object sender, EventArgs e)   
{  
    shopGrid.DataSource = DataProvider.GetAllShopOrders();   
    shopGrid.DataBind();  
}  
 

 

 

 

 

End I get this error:
Data source is an invalid type.  It must be either an IListSource, IEnumerable, or IDataSource.

I didn't have this problem with Microsoft Enterprise Library 4.1 or lower.

 

 

 

 

marcelo perez
Top achievements
Rank 1
 answered on 04 Jun 2010
0 answers
65 views
this little piece of code is make in jQuery, for put a default text in filter column, when filter got focus, the text empty.
$(document).ready( function() 
        { 
            var filtros = $("input[class='rgFilterBox']"); 
             
            if(filtros.length > 0) 
            { 
                var textoFiltro = document.getElementById("<%= hdFiltro.ClientID %>").value; // Text show
                for(var i=0; i<filtros.length; i++) 
                { 
                    if(filtros[i].value == "") 
                    { 
                        filtros[i].value = textoFiltro; 
                        filtros[i].style.color = "#d6d6d6"; 
                    } 
                     
                    filtros[i].onfocus = function() { 
                        if(this.value==textoFiltro)  
                        { 
                            this.value = ""; 
                            this.style.color = "black"; 
                        } 
                    } 
                 
                    filtros[i].onblur = function() { 
                        if(this.value == "") 
                        { 
                            this.value = textoFiltro; 
                            this.style.color = "#d6d6d6"; 
                        } 
                    } 
                } 
            } 
         }); 
Sorry, my english is poor,

Happy coding.

GDEx
Francisco Gonzalez
Top achievements
Rank 1
 asked on 04 Jun 2010
6 answers
267 views
Hi.

I have a user control which has a repeater. Each row of the repeater has three columns containing a control each

1st column - ASP label control
2nd column - Rad Combo Box
3rd column - Rad Text Box

This user control has a public property that accepts the data to be bound to the repeater control.

I want to achieve the following.

On the main web page, on a click of button, using a web service i want to get the HTML content of the above user control.

In web service, I create an instance of Page, dynamically load the above user control, add it to the page, get the HTML of page
and send that HTML as a string to the requesting web page.

The above thing works if I don't have Rad Controls in the user control. If I use generic HTML controls or asp controls (that don't require scriptmanager) it works perfectly fine. But there are Rad Controls, when I try to get the HTML of the page by calling RenderControl I get an error saying 'ScriptManager' needs to be present.

Is there an alternate way to circumvent the problem?

Thanks.
Abhay Jain
Top achievements
Rank 1
 answered on 04 Jun 2010
1 answer
344 views

Hi,

I am creating windows dynamically based on the settings I retrieve from database. Need to add some custom properties to the RadWindows so that I can use them while rendering to make decissions, like whether to show it in the minimized mode after its visible(because I've many rad windows popping up on the screen). Attributes which will drive the minimum width and height of the windows, which I'll use in the resize event of the RadWindows.

I've a code sample here, kindly help me understand how I can do this.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
 
<!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>  
    <script type="text/javascript">  
        function WindowCreatedAndShowed(sender, args) {  
            if (sender.isMinimized == "True") {  
                sender.hide();  
            }  
        }  
    </script> 
</head> 
<body> 
    <form id="form1" runat="server">      
    <telerik:RadWindowManager ShowOnTopWhenMaximized="false" Width="100%" Height="100%" 
        OnClientActivate="OnClientActivate" OnClientClose="OnClientClose" Behaviors="Close,Maximize,Minimize,Move,Reload,Resize" 
        OnClientCommand="OnClientCommand" ID="DBRadWindowManager" RestrictionZoneID="RestrictionZone" 
        runat="server" Skin="Telerik" OnClientPageLoad="WindowCreatedAndShowed" OnClientResize="OnClientResize">          
    </telerik:RadWindowManager> 
    </form> 
</body> 
</html> 
 

Code Behind:

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;  
 
namespace WebApplication2  
{  
    public partial class _Default : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                try 
                {  
                    //Get the currently logged in user's Tab-Widgets collection  
                    List<Tab> objTabsCollection = GetUserTabsWidgetsCollection(); //Gets the data  
 
                    if (objTabsCollection != null && objTabsCollection.Count > 0)  
                    {  
                        int tabCounter = 1;  
                        //Loop through all the Tabs the user is authorized to view, add the Tabs to the MainTabStrip,  
                        //Add PageView to each of the Main tab, Add TabStrip to each of the PageView (Widget level Tabstrip),  
                        //Add Widgets to the WindowManager collection to add the association with the widget tabstrip  
                        foreach (Tab objEntityMainTab in objTabsCollection)  
                        {  
                            //If it is the first tab, then make widgets visible, set the tab to the selected tab and  
                            //set the PageView of the tab to selected.  
                            if (tabCounter++ == 1)  
                            {  
                                //Add widgets associated with the Main tab  
                                AddWidgetsForEachMainTab(objEntityMainTab, true);  
                            }  
                            else 
                            {  
                                AddWidgetsForEachMainTab(objEntityMainTab, false);  
                            }  
                        }  
                    }  
                    else 
                    {  
                        Server.Transfer(string.Format("{0}Item=You are not authorized to view any pages in this application.", UnauthorizedPagePath));  
                    }  
                }                  
                catch (Exception ex)  
                {  
                    //Exception Handling  
                }  
            }  
        }  
 
        /// <summary>  
        /// Adds the Widgets associated with given Main tab  
        /// </summary>  
        /// <param name="objUIMainTab">Main tab for which the associated widgets need to be added</param>  
        /// <param name="objEntityMainTab">Entity Tab object that consists of the Widgets information for the Main tab</param>  
        /// <param name="isWidgetVisible">Tells if the widgets needs to be visible on initial page load</param>  
        private void AddWidgetsForEachMainTab(Tab objEntityMainTab, bool isWidgetVisible)  
        {  
            short tabIndex = 1;  
            //Create Tab & associated RadWindows for each of the sub tab in the Main tab  
            foreach (Widget objWidget in objEntityMainTab.Widgets)  
            {  
                //Create RadWindow for the Tab  
                RadWindow objTabWindow = new RadWindow();  
 
                objTabWindow.ID = objWidget.Widget_Name.ToUpper() + "_WINDOW";  
                objTabWindow.VisibleOnPageLoad = true;  
                objTabWindow.TabIndex = tabIndex++;  
                objTabWindow.BorderStyle = BorderStyle.None;  
                objTabWindow.Behaviors = WindowBehaviors.Default;  
                objTabWindow.Height = Unit.Pixel(objWidget.Initial_Height);  
                objTabWindow.InitialBehaviors = WindowBehaviors.None;  
                objTabWindow.Left = Unit.Pixel(objWidget.Widget_Left);  
                objTabWindow.ReloadOnShow = true;  
                objTabWindow.Skin = "Telerik";  
                objTabWindow.Title = objWidget.Widget_Name;  
                objTabWindow.Top = Unit.Pixel(objWidget.Widget_Top);  
                objTabWindow.Width = Unit.Pixel(objWidget.Initial_Width);  
                objTabWindow.IconUrl = "~/images/bg-header-widget.gif";  
                objTabWindow.NavigateUrl = objWidget.Widget_NavigateURL;  
                objTabWindow.Behaviors = WindowBehaviors.Minimize | WindowBehaviors.Maximize | WindowBehaviors.Move | WindowBehaviors.Reload | WindowBehaviors.Resize;  
                objTabWindow.KeepInScreenBounds = true;  
                objTabWindow.VisibleOnPageLoad = isWidgetVisible;  
                objTabWindow.Visible = true;  
                objTabWindow.VisibleStatusbar = false;  
                //Attributes for the Minimum Height and Width for each of the widgets   
                //along with the value if the widgets needs to be in minimized state while loading  
                objTabWindow.Attributes.Add("isMinimized", objWidget.IsMinimized ? Boolean.FalseString : Boolean.TrueString);  
                objTabWindow.Attributes.Add("MinimunHeight", Convert.ToString(objWidget.Minimum_Height));  
                objTabWindow.Attributes.Add("MinimunWidth", Convert.ToString(objWidget.Minimum_Width));  
                //Add the newly created RadWindow to the RadWindowManager  
                DBRadWindowManager.Windows.Add(objTabWindow);  
            }  
        }  
    }  
 
    //Tab & Widget classes definition  
    public class Tab  
    {  
        public int Tab_Id { get; set; }  
        public string TabName { get; set; }  
        public string CreateID { get; set; }          
 
        public List<Widget> Widgets { get; set; }  
    }  
 
    public class Widget  
    {  
        public int Widget_Id {get;set;}  
 
        public string Widget_Name {get;set;}  
 
        public string Widget_NavigateURL {get;set;}  
 
        public bool IsMinimized {get;set;}  
 
        public int Widget_Left {get;set;}  
 
        public int Widget_Top {get;set;}  
 
        public int Initial_Height {get;set;}  
 
        public int Initial_Width {get;set;}  
 
        public int Minimum_Width {get;set;}  
 
        public int Minimum_Height {get;set;}  
    }  
}  
 
Petio Petkov
Telerik team
 answered on 04 Jun 2010
1 answer
50 views
It only supports document linking.

Kindly include image link where in the dialog, you can select the image file to link.

Other editors have this functionality, but RadEditor lacks.

Thank you.
Rumen
Telerik team
 answered on 04 Jun 2010
1 answer
75 views
Hi,

I have a rad window, in which I have a grid view whose data is bound on the itemdatabound event and a button .

On Click of the button, I have certain validations done and open another rad window on top of my first radwindow.

The second rad window has a label and a button on click of which it closes.

When the second rad window closes, I can see that the data in the grid view disappears and the message that I have in the <EmptyDataTemplate> of the gridview will be dispalyed in the first radwindow. Basically data binding is not happening.

This happens even when I have a repeaer control in my first radwindow.

How do I overcome this issue?

Thanks & Regards,
Shruthi N
Petio Petkov
Telerik team
 answered on 04 Jun 2010
1 answer
94 views
While using PhysicalFilePath, the Preview is not displaying the image
Dobromir
Telerik team
 answered on 04 Jun 2010
1 answer
127 views
I have used rad chart in my asp.net application. it is working just fine on my development machine, but after deployment on client machine...No chart is displayed. i have used the suggestion(relating to session and separate folder to save chart image) in other posts regarding this issue.
My problem is still not solved. m using 3.5 framework...Can you help me out regarding this issue.
Thanks
Vladimir Milev
Telerik team
 answered on 04 Jun 2010
2 answers
121 views
Doing clientside binding, and I just want my pager to be

Next | Previous

...if I set the template in the markup it posts back.

Whats the way to get this done?
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 04 Jun 2010
2 answers
131 views
Hello Telerik team,

I have a problem with multiple RadGrids in separate PageViews of a RadTabStrip/RadMultiPage control set

Here is the setup and the problem follows:

1. I have a RadTabStrip and a RadMultiPage connected by the MultiPageID property.
2. This Tab is part of a table that is part of a Panel that is initially not displayed (style:display: none")
3. All of this is contained is an MS Update Panel
4. There are 10 tabs.
5. On 4 of the tabs, I have a RadGrid created on the PageView for each of the 4 tabs

*** HOWEVER** Since I am doing client-side data binding, these grids do *NOT* bind when the page first loads (IsPostback = false)

6. I have implemented the OnCommand client side event for each of the Grids (However, they do not seem to fire when the page renders)

The problem:

- The user selects a function and the client displays the hidden panel.
- The user selects one of the Tabs that has a grid
- The client code fires an ADO.Net data service that returns the data to the browsre
- The DataService callback cannot locate the MasterTables because they have not been rendered

Can you help me figure out why the master tables do not render on the initial page load?

HINT: If I load the page and then immediately do a full browser page refresh, the tables *WILL* render !?!?!?!?!?

Thanks
Bob

Bob
Top achievements
Rank 1
 answered on 04 Jun 2010
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?