Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
391 views
I recently added a hotfix to ASP.NET AJAX controls (2008.1.619) to the bin folder of my app as described in 
http://www.telerik.com/support/kb/article/b454K-kad-b454T-a.aspx

How do i make my visual Studio toolbox use the new dll?

I manually replaced the files in the ProgRamFiles/Telerik/Bin folder and updated them in GAC.

The intellisense in my aspx page shows "'unrecognized tag prefix or device filter 'telerik' "

Please help
Nate
Top achievements
Rank 1
 answered on 23 Sep 2008
2 answers
611 views
My website needs to output some dynamically generated Javascript but it doesn't run when I AJAX up my controls. I assume because the script element is not connected to the AJAX Manager/Panel.

So I added a RadScriptBlock but I can't for the life of me find out how to add the script to it from the c# server side.

Is this possible?

The last thing I tried was this (but Text is obviously not right),

LiteralControl script = (LiteralControl)radScriptBlock.Controls[0];  
script.Text = "UpdateMainWindow('" + Session["IdM_btnUpdate_ClientID"].ToString() + "');"; 
Sebastian
Telerik team
 answered on 23 Sep 2008
1 answer
156 views
we are opening our windows with the following code

' MyProfile RadWindow

MyProfileHyperLink.NavigateUrl =

"MyProfileViewDetails.aspx"
Dim MyProfileHyperLinkWindowName As String = "MyProfile"
Dim clickEventHandlerStringMyProfileHyperLink As String = "javascript:var w = window.radopen('" & _
Convert.ToString(
"MyProfileViewDetails.aspx") & "', '" & _
MyProfileHyperLinkWindowName &
"'); w.set_modal(false); w.moveTo(100, 100); w.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move +Telerik.Web.UI.WindowBehaviors.Close); w.setSize(900, 400); return false;"
MyProfileHyperLink.Attributes.Add("onclick", clickEventHandlerStringMyProfileHyperLink)

Anyway to add Transparency to a window opened this way?

Thanks

Georgi Tunev
Telerik team
 answered on 23 Sep 2008
4 answers
176 views
I have a hierarchical grid similar to the demo as Customer > Orders. The DetailTables "Orders" has a gridboundcolumn (A) for viewing data  and a griddropdowncolumn (B) that only is visible in edit mode and bind to another SqlDataSource. How to hide the gridboundcolumn (A) in edit mode?
(B) works fine.
The test is similar to this demo: http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/DataEditing/ThreeLevel/DefaultCS.aspx

I tried to do this but it still does not work:

protected void radgridAccount_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item.OwnerTableView.Name == "Orders")
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = e.Item as GridEditableItem;
if (item.IsInEditMode)
{
//either these lines
this.radgridAccount.MasterTableView.DetailTables[0].Columns[1].Visible = false;this.radgridAccount.MasterTableView.DetailTables[0].Columns[2].Visible = false;
//or these lines
Item["A"].Controls[0].Visible = false;
item[
"B"].Controls[0].Visible = true;
}}}}

Thanks.
d-cpt


d-cpt
Top achievements
Rank 2
 answered on 23 Sep 2008
15 answers
238 views
I show the example advancedformtemplate, but is maked to xml, if i want to create a advancedformtemplate to db?because i want to keep the default structure and add another control..

The examples existing can't modify a schedulerdefaultform..-> More details: Room DropDown, checkbox user -> ....the are not a user-control to modify a default structure for add new control...there is a solution?

AdvanceformTemplate is good but isn't database...It is a great problem..

Hi
Peter
Telerik team
 answered on 23 Sep 2008
4 answers
973 views
i am dynamically creating RadDocks from an Array for the 1st time and then using the loaded docks i want to save them in the database for per user basis.

i also have a update panel for the "DockPositionChanged" event, however this is giving the following error.

A control with ID 'RadDockf49937fe-b13d-4730-b098-d252bb02fc45' could not be found for the trigger in UpdatePanel 'UpdatePanel1'.

please advise..

here is the source code
        <telerik:raddocklayout runat="server" id="RadDockLayout1"   
            onsavedocklayout="RadDockLayout1_SaveDockLayout" 
            onloaddocklayout="RadDockLayout1_LoadDockLayout">  
        <table cellspacing="5" cellpadding="5" border="0" width="690">            
            <tr> 
                <td> 
                    <telerik:RadDockZone ID="RadDockZone1" runat="server" Width="330px" MinHeight="243px" MinWidth="330px">  
                    </telerik:RadDockZone>                
                </td> 
                <td> 
                    <telerik:RadDockZone ID="RadDockZone2" runat="server" Width="330px" MinHeight="243px" MinWidth="330px">  
                    </telerik:RadDockZone>                
                </td> 
            </tr> 
            <tr> 
                <td colspan="2">  
                    <div style="display:none">  
                        Hidden UpdatePanel, which is used to receive the new dock controls.   
                        We will move them with script to the desired initial dock zone.  
                        <asp:updatepanel runat="server" id="UpdatePanel1">  
                        </asp:updatepanel> 
                    </div>                
                </td> 
            </tr> 
        </table> 
        </telerik:raddocklayout> 

using System;  
using System.Collections;  
using System.Collections.Generic;  
using System.ComponentModel;  
using System.Data;  
using System.Drawing;  
using System.Web;  
using System.Web.SessionState;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
using System.Data.SqlClient;  
using System.Configuration;  
using System.Text;  
 
public partial class Portal : System.Web.UI.Page  
{  
    private SqlConnection _conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DockConnectionString"].ConnectionString);  
    private int _count = 0;  
    bool LoadDefaults = true;  
    protected void Page_Init(object sender, EventArgs e)  
    {  
        LoadDefaults=true;  
        if (LoadDefaults)  
            LoadDefaultsFromSharePoint();  
        else  
            LoadFromDatabase();  
    }  
 
    private void LoadDefaultsFromSharePoint()  
    {  
        string[] WidgetTitles = { "ECAMPAIGNS","NEWS","MY LISTINGS","MY CALENDAR"};  
        string[] WidgetControls = { "HP_eCampaign.ascx", "HP_News.ascx", "HP_Listings.ascx", "HP_Calendar.ascx"};  
        //Recreate the docks in order to ensure their proper operation  
        bool isZoneOne=true;  
        int i = 0;  
        foreach (string widget in WidgetTitles)  
        {  
            RadDock dock = CreateRadDock(widget, WidgetControls[i]);   
                //We will just add the RadDock control to the RadDockLayout.  
                // You could use any other control for that purpose, just ensure  
                // that it is inside the RadDockLayout control.  
                // The RadDockLayout control will automatically move the RadDock  
                // controls to their corresponding zone in the LoadDockLayout  
                // event (see below).  
                if (isZoneOne)  
                {  
                    isZoneOne=false;  
                    RadDockZone1.Docks.Add(dock);    
                }  
                else  
                {  
                    isZoneOne=true;  
                    RadDockZone2.Docks.Add(dock);  
                }  
                //We want to save the dock state every time a dock is moved.  
                CreateSaveStateTrigger(dock);  
                i++;  
        }  
    }  
 
    private void LoadFromDatabase()  
    {  
        string dockState = "";  
        try  
        {  
            _conn.Open();  
            SqlCommand command = new SqlCommand("select State from States where id=1", _conn);  
            dockState = command.ExecuteScalar().ToString();  
            _conn.Close();  
        }  
        catch  
        {  
        }  
 
        string[] currentDockStates = dockState.Split('|');  
        _count = currentDockStates.Length;  
 
        //Recreate the docks in order to ensure their proper operation  
        for (int i = 0; i < _count; i++)  
        {  
            if (currentDockStates[i].Trim() != string.Empty)  
            {  
                RadDock dock = CreateRadDockFromState(currentDockStates[i]);  
                //We will just add the RadDock control to the RadDockLayout.  
                // You could use any other control for that purpose, just ensure  
                // that it is inside the RadDockLayout control.  
                // The RadDockLayout control will automatically move the RadDock  
                // controls to their corresponding zone in the LoadDockLayout  
                // event (see below).  
                RadDockLayout1.Controls.Add(dock);  
                //We want to save the dock state every time a dock is moved.  
                CreateSaveStateTrigger(dock);  
            }  
        }  
    }  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
 
    private RadDock CreateRadDockFromState(string stringState)  
    {  
        System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();  
        DockState state = serializer.Deserialize<DockState>(stringState);  
        RadDock dock = new RadDock();  
        dock.ID = string.Format("RadDock{0}", state.UniqueName);  
        dock.ApplyState(state);  
        return dock;  
    }  
 
    private RadDock CreateRadDock(string WidgetTitle, string WidgetControlName)  
    {  
        RadDock dock = new RadDock();  
        dock.UniqueName = Guid.NewGuid().ToString();  
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);  
        dock.Title = WidgetTitle;  
        dock.Width = Unit.Pixel(330);  
        dock.Height = Unit.Pixel(243);  
        try  
        {  
            Control widget = LoadControl(WidgetControlName);  
        }  
        catch (Exception ex)  
        {  
            dock.Text = string.Format("Error in Widget: {0}", ex.Message);  
        }  
    
        //dock.DefaultCommands=          
        return dock;  
    }  
 
    private void CreateSaveStateTrigger(RadDock dock)  
    {  
        //Ensure that the RadDock control will initiate postback  
        // when its position changes on the client or any of the commands is clicked.  
        //Using the trigger we will "ajaxify" that postback.  
        dock.AutoPostBack = true;  
        dock.CommandsAutoPostBack = true;  
 
        AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();  
        saveStateTrigger.ControlID = dock.ID;  
        saveStateTrigger.EventName = "DockPositionChanged";  
        UpdatePanel1.Triggers.Add(saveStateTrigger);  
    }  
 
 
 
    protected void RadDockLayout1_SaveDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e)  
    {  
        string dockState;  
        System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();  
        List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();  
        StringBuilder serializedList = new StringBuilder();  
        int i = 0;  
        while (i < stateList.Count)  
        {  
            serializedList.Append(serializer.Serialize(stateList[i]));  
            serializedList.Append("|");  
            i++;  
        }  
        dockState = serializedList.ToString();  
        if (dockState.Trim() != String.Empty)  
        {  
            try  
            {  
                _conn.Open();  
                SqlCommand command = new SqlCommand(String.Format("update States set State='{0}' where id=1", dockState), _conn);  
                command.ExecuteNonQuery();  
                _conn.Close();  
            }  
            catch  
            {  
            }  
        }  
 
        //Save the dockState string into DB        
    }  
 
    protected void RadDockLayout1_LoadDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e)  
    {  
        if (!LoadDefaults) // Perform this task only when not loading defaults,I.E when reading from database  
        {  
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();  
            //Get saved state string from the database - set it to dockState variable for example   
            string dockState = "";  
            try  
            {  
 
                _conn.Open();  
                SqlCommand command = new SqlCommand("select State from States where id=1", _conn);  
                dockState = command.ExecuteScalar().ToString();  
                _conn.Close();  
            }  
            catch  
            {  
            }  
 
            string[] currentDockStates = dockState.Split('|');  
            foreach (string stringState in currentDockStates)  
            {  
                if (stringState.Trim() != string.Empty)  
                {  
                    DockState state = serializer.Deserialize<DockState>(stringState);  
                    e.Positions[state.UniqueName] = state.DockZoneID;  
                    e.Indices[state.UniqueName] = state.Index;  
                }  
            }  
        }  
    }  
}  
 


Sophy
Telerik team
 answered on 23 Sep 2008
1 answer
127 views
Hi there,

I have an aspx which inherits from a master page. In the aspx page's directive, it also inherits some theming code which is universal to all pages, so I can't change the inherited code behind.

But the font size drop down (which contains fonts 1-7), instead of having varied height for each size in the dropdown when moused over, all sizes are equal, so the different sizes are overlapping with each other.

The second issue is that in the content area, the text is cut off if using font 7, so only upper part of the letters are shown, it seems there is a height limit and the letters also overlap between lines. For this issue, I temporarily fixed it by indicating the CSS file,
<CssFiles>
                  <telerik:EditorCssFile Value="~/EditorContentAreaGlobal.css" />
            </CssFiles>

in the content body. I wonder if there is a better way to achieve this.

Any help is appreciated.

Henry
Rumen
Telerik team
 answered on 23 Sep 2008
8 answers
275 views
I'm using ServerSideCallBack to load my huge product category tree, but after a PostBack (when a user clicks a category to see), the entire tree is reset.

Is there any way that I can expand/recall those nodes which the user loaded/clicked before he made the PostBack? They of course think it's annoying that the tree doesn't "remember" which sub-category they are in.

As I said it's a huge tree, so I don't see any other way than the Load-On-Demand method.
EET Group
Top achievements
Rank 2
 answered on 23 Sep 2008
2 answers
162 views
I'm trying to design a page where the radeditor uses up MOST of the page. I still need a small strip of buttons across the bottom. I was playing around with a simple table layout and percentage heights, and initially the page when loading does look right, but then the radeditor resizes itself down. AutoResizeHeight is off.

It seems all I can do is either have the radeditor go full screen or it just has a mind of it's own unless I give it a fixed pixel height which I just don't know in advance.

How can I get it to take up all of the page except for a small row of buttons I want to place at the bottom?
Happy
Top achievements
Rank 1
 answered on 23 Sep 2008
1 answer
101 views

In trying to get the menu control to add a border and highlight the item under the mouse, I've run into an issue with text being dropped to a new line and the item size increasing vertically.  It seems to be an issue with the padding of rmItem.  If I add even one pixel of padding to the item--as is done in the embedded Outlook skin--I see the issue.  I'm including stylesheet excerpts with changed portions for a version that does not have the problem (border and padding commented out) and one that does.

Version with border (and problem):
--
Image sample showing the issue
.rmRootGroup .rmItem
{
/* with inset border */
padding:1px;
width:100%;
}

.RadMenu_Activate .rmVertical .rmExpanded,
.RadMenu_Activate .rmVertical .rmExpanded:hover
{
background:#93B5E7 left top repeat-x;
/* with inset border */
border:1px solid #002D96;
}
/* with inset border */
.RadMenu_Activate .rmGroup .rmLink
{
padding:1px;
}

.RadMenu_Activate .rmGroup .rmLink:hover,
.RadMenu_Activate .rmGroup .rmFocused,
.RadMenu_Activate .rmGroup .rmExpanded
{
background-color:#FFEEC2;
background-image:none;
border-left: 0px;
/* with inset border */
padding: 0px;
border:1px solid #002D96;
}

Version without border (and without the problem)
--
Image sample showing how the text should be displayed
.rmRootGroup .rmItem
{
/* with inset border
padding:1px; */
width:100%;
}

.RadMenu_Activate .rmVertical .rmExpanded,
.RadMenu_Activate .rmVertical .rmExpanded:hover
{
background:#93B5E7 left top repeat-x;
/* with inset border
border:1px solid #002D96;*/
}

/* with inset border
.RadMenu_Activate .rmGroup .rmLink
{
padding:1px;
}
*/

.RadMenu_Activate .rmGroup .rmLink:hover,
.RadMenu_Activate .rmGroup .rmFocused,
.RadMenu_Activate .rmGroup .rmExpanded
{
background-color:#FFEEC2;
background-image:none;
border-left: 0px;
/* with inset border
padding: 0px;
border:1px solid #002D96;*/
}

 And as I mentioned earlier, even the embedded Outlook skin creates the same unwanted new line:

Yana
Telerik team
 answered on 23 Sep 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?