Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
247 views
Hi Telerik,

I am just doing some fine-tuning of my controls, and I noticed that there are slight differences in how some of my pop-up RadWindows are rendered under different browsers. I've accounted for all that I can, but I would like to open a RadWindow with a different height, as cleanly as possible, but be able to account for these browser differences.

Currently, I have the following implementation:

<telerik:RadWindowManager ID="RadWindowManager1" Runat="Server" Skin="Web20" Modal="True" KeepInScreenBounds="True" EnableShadow="True" Behaviors="Close, Move" VisibleStatusbar="False" ReloadOnShow="True" ShowContentDuringLoad="False" Behavior="Close, Move" Title="Confirm Action" IconUrl="~/Content/Dashboard/Icons/radwindow_confirmdelete.png" OnClientDragStart="OnWindowDrag" Style="z-index: 90001 !important">
    <Windows>
        <telerik:RadWindow ID="DashboardGlobalSettingsWindow" Runat="Server" NavigateUrl="~/Dashboard/Dialog/Windows/DashboardGlobalSettings.aspx" OnClientShow="OnDashboardGlobalSettingsShow" OnClientClose="OnDashboardGlobalSettingsClose" IconUrl="~/Content/Dashboard/Icons/radwindow_settings.png" OnClientAutoSizeEnd="OnClientAutoSizeEnd" Title="Global Settings" MinHeight="337px" Height="337px" Width="450px" />
    </Windows>
</telerik:RadWindowManager>

//Shows the global settings window -- dock isn't relevant here.
//I cancel the event because I'm making it look like a button on the side when it is really
//a sliding zone that would expand. When I cancel the slide event, though, it's a button!
function ShowDashboardGlobalSettings(sender, eventArgs) {
    eventArgs.set_cancel(true);
    oWindow = radopen(null, "DashboardGlobalSettingsWindow");
}
 
//Pass current tabs to the dialog window.
function OnDashboardGlobalSettingsShow(sender) {
    sender.argument = $find(radTabStrip1ID).get_tabs();
}
 
//Pass tabs back to dashboard.
function OnDashboardGlobalSettingsClose(sender) {
    var globalJSONAttributes = sender.argument;
    if (globalJSONAttributes != null) {
        __doPostBack(radTabStrip1UniqueID, $.toJSON(globalJSONAttributes));
    }
    oWindow = null;
}

Should I parse the browser information where I obtain a handle on the oWindow, and then set the height as necessary? 

Thanks

EDIT: Just for the sake of keeping similar questions in one thread, could you guys also take a look at this?

<telerik:RadWindow ID="CustomLocalSettingsWindow" Runat="Server" NavigateUrl="~/Dashboard/Dialog/Windows/CustomLocalSettings.aspx" OnClientShow="OnLocalSettingsShow" OnClientClose="OnCustomLocalSettingsClose" IconUrl="~/Content/Dashboard/Icons/radwindow_settings.png" OnClientAutoSizeEnd="OnClientAutoSizeEnd" Title="Settings" Width="450px" Height="200px"/>


function ShowLocalSettings(dock) {
    radDock = dock; //Maintain a hold on the dock that is pulling up the window. Useful to save info when window closes.
 
    var reportType = radDock.get_element().getAttribute("ReportType");
    if (reportType == "HistoricalReport") {
        oWindow = window.radopen(null, "HistoricalLocalSettingsWindow");
    }
    else if (reportType == "CustomReport") {
        oWindow = window.radopen(null, "CustomLocalSettingsWindow");
 
        if ($.browser.opera) {
            alert("test");
            oWindow.set_height(oWindow.get_height() - 45);
        }
 
    }
    else {
        window.radalert("Didn't find report type.");
    }
}

http://screencast.com/t/905DDs2rgM

There's a short video clip of what I am seeing. Basically, setting the oWindow's height like so (to fix height issues in Opera), is causing the next click to make the window even smaller. Yet, I only see the alert fire once (not in the video, but tested). Even calling set_height using a hard-coded value not dependent on get_height causes the same effect. Not calling set_height at all does not cause the effect, though. This seems like a bug in set_height. Any idea why this would be happening?

It doesn't happen when I have AutoSize="True" and AutoSizeBehvaiors="Height", however I think that's just hiding the bug.
Marin Bratanov
Telerik team
 answered on 17 Oct 2011
3 answers
234 views
Hi,
I'm using RadTabStrip control into a MasterPage.
I need to use the TabClick event only in two tabs, so I've set the tab's PostBack property to true.
Now my event is fired, but in async mode, why? I'm not including my TabStrip into RadAjaxPanel or UpdatePanel.

To work around this problem in the Page_Init event (aspx Page_Init) I've registered the control RadTabStrip as PostbackControl with the method ScriptManager.RegisterPostBackControl(...), this works only SYNC postback, when I do a ASYNC postback, the RadTabStrip control works as ASYNC control.

Can you help me?
Thanks
Best Regards
Dimitar Terziev
Telerik team
 answered on 17 Oct 2011
1 answer
169 views
Hi Telerik team members and users,

In the chart below one of the items is "exploded".

http://imageshack.us/f/511/percentageexplodeditem.png/

However, the issue I have is that the item's text ( the "14%" text   overlaps with / touches the slice )

How can I fix this issue ?



By the way your product is awesome !

Sebastian
Yavor
Telerik team
 answered on 17 Oct 2011
4 answers
277 views
Dear All!

I would like to know how can I get my custom Edit control object durint InitInsert Command [Add new record]?
Means I've created a custom edit form:
<EditFormSettings UserControlName="~/Controls/DutTestGridCommandControl.ascx" EditFormType="WebUserControl" />
and I need it's reference, ID or similar during creation because it has a property which I need to set in runtime. Is it possible?

Thanks,
alsi
Princy
Top achievements
Rank 2
 answered on 17 Oct 2011
1 answer
98 views
Hi, could You tell me how to set auto width on detail table in hierarchical grid? It automatically sets width=100% on table in html, so child grid is stretched.
Princy
Top achievements
Rank 2
 answered on 17 Oct 2011
1 answer
110 views
initially i bind grid using this code

<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:MyDB %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"
            runat="server"></asp:SqlDataSource>


in this paging works properly...

when i bing grid datas like this

RadGrid1.DataSource = DT
RadGrid1.DataBind()
when i click the 2nd page button grid shows like this(Attached below)

give me a solution
Shinu
Top achievements
Rank 2
 answered on 17 Oct 2011
2 answers
147 views
Hello Experts,

I have added  footer part in my rad grid & i want to display it in PDF file.

If TypeOf e.Item Is GridFooterItem Then
Dim footer As GridFooterItem = CType(e.Item, GridFooterItem)
footer("Duration_Hours").Controls.Add(New LiteralControl("<span dir ='rtl' style='color: Black; font-weight: bold;'>Total Hours : " & lblTotalhours.Text & "</span> ")
End If

Is it possible to display Rad grid footer part in PDF file???

Thank You,
Ronak.


 
Ronak
Top achievements
Rank 1
 answered on 17 Oct 2011
13 answers
292 views
hi dear telerik team :
it seems File Explorer has some problems when want to load a folder  / it goes to thinking mode / stay on loding.gif ajax mode!
this problem appeared aftre publish / my server speed is ok -> 5-6 mbps
but i do n't know how can i fix this issue?
Dobromir
Telerik team
 answered on 17 Oct 2011
1 answer
117 views
Hi

View Image attached

In the ItemDataBount I do stuff to customize the GridGroupHeaderItem wich works fine.

When I click on the grid and come back to it, the formatting is lost (right side of the Image attached)

I use the RadAjaxManager and the grid is updated on the event but is not rebinded.

Is there a way not to loose this without rebinding.

here the code if it help

        protected void rdgMeals_ItemDataBound(object source, GridItemEventArgs e)
        {
            if (e.Item != null)
            {
                if (e.Item.ItemType == GridItemType.GroupHeader)
                {
                    GridGroupHeaderItem xGridGroupHeaderItem = (GridGroupHeaderItem)e.Item;
                    HtmlAnchor xHtmlAnchor = new HtmlAnchor();
                    String xDate = ((DateTime)DataBinder.Eval(xGridGroupHeaderItem.DataItem, "Date")).ToString("yyyy-MM-dd");

                    xHtmlAnchor.InnerHtml = "<img alt='Statistics' src='/Images/Statistics.png' height='12' width='12' style='border: none;' /> " + xDate;
                    xHtmlAnchor.HRef = "javascript:void(0);";
                    xHtmlAnchor.Attributes.Add("onclick", "OpenFoodStatisticsMeals('0', '" + this.CurrentUserId + "', '" + xDate + "', '" + xDate + "');");
                    xHtmlAnchor.Style.Add("color", "#000000");
                    xHtmlAnchor.Style.Add("border", "none");
                    xHtmlAnchor.Style.Add("text-decoration", "none");

                    xGridGroupHeaderItem.DataCell.Controls.Add(xHtmlAnchor);
                }
     }
 }



Thanks
Iana Tsolova
Telerik team
 answered on 17 Oct 2011
1 answer
135 views
Hi.
I´m facing scenario that i do not understand, and can not solve.

In RadToolBar1 I´ve added:
<telerik:RadToolBarButton Text="Delete" CommandName="DeletePost" PostBack="false" ImageUrl="Themes/Default/Icons/Telerik/Delete.png"></telerik:RadToolBarButton>

In RadGrid1 I´ve added:
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" CommandName="SelectPost" HeaderStyle-Width="40px" />

When client press button in RadToolBar1 with CommandName="DeletePost" , I want to run my server-side code that will delete selected row(s) from db. Ajaxified.

Markup:
<%@ Page Title="" Language="C#" MasterPageFile="App_master/MasterPage.master" AutoEventWireup="true"
    CodeFile="Posts.aspx.cs" Inherits="ccc_Posts" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    <telerik:AjaxUpdatedControl ControlID="RadToolBar1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadToolBar1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadTreeView runat="Server" ID="RadTreeView1" EnableViewState="False" Style="margin-top: 4px;
        margin-left: 4px;">
    </telerik:RadTreeView>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            var toolbar;
            var grid;
 
            function pageLoad() {
                grid = $find("<%=RadGrid1.ClientID %>");
                toolbar = $find("<%= RadToolBar1.ClientID %>");
 
                if (grid.get_masterTableView().get_selectedItems().length == 0)
                    toolbar.findButtonByCommandName("DeletePost").disable();
 
            }
 
            function onGridRowSelected(sender, args) {
                toolbar.findButtonByCommandName("DeletePost").enable();
            }
 
            // Open window
            function OpenWindow(url) {
                radopen(url, "NewPost");
            }
 
            function OnClientButtonClickingHandler(sender, eventArgs) {
                if (eventArgs.get_item().get_value() == "NewPost") {
                    OpenWindow('NewPost.aspx');
                }
            }   
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="true" Width="1024px"
        OnClientClose="closeRadWindow" Behaviors="Close, Reload, Resize, Move, Maximize"
        Height="710px" ViewStateMode="Disabled" ShowContentDuringLoad="false" VisibleStatusbar="false">
    </telerik:RadWindowManager>
    <telerik:RadSplitter runat="server" ID="RadSplitter1" Width="100%" BorderSize="0"
        BorderStyle="None" PanesBorderSize="0" Height="100%" Orientation="Horizontal">
        <telerik:RadPane runat="server" ID="RadPane1" Height="30px" EnableViewState="false"
            Scrollable="false">
            <telerik:RadToolBar runat="server" ID="RadToolBar1" EnableViewState="false" CssClass="inbox-search-toolbar"
                OnClientButtonClicking="OnClientButtonClickingHandler" OnButtonClick="RadToolBar1_ButtonClick">
                <Items>
                    <telerik:RadToolBarButton Text="New Post" Value="NewPost" PostBack="false" ImageUrl="Themes/Default/Icons/Telerik/Add.png">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton IsSeparator="true" />
                    <telerik:RadToolBarButton Text="Delete" CommandName="DeletePost" PostBack="false" ImageUrl="Themes/Default/Icons/Telerik/Delete.png">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton IsSeparator="true" />
                    <telerik:RadToolBarButton Value="searchTextBoxButton">
                        <ItemTemplate>
                            <telerik:RadTextBox runat="server" ID="blogToolBarSearchTb" EmptyMessage="Search Posts"
                                CssClass="inbox-search-textbox" Width="300px" />
                        </ItemTemplate>
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton ImageUrl="Themes/Default/Icons/16x16/search.png" Value="search" />
                </Items>
            </telerik:RadToolBar>
        </telerik:RadPane>
        <telerik:RadPane runat="server" ID="RadPane2">
            <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="false" GridLines="None"
                AllowMultiRowSelection="true" Height="100%" BorderWidth="0px" AllowSorting="True"
                Style="outline: none" ShowGroupPanel="True">
                <ClientSettings Scrolling-AllowScroll="True" Scrolling-UseStaticHeaders="true" Selecting-AllowRowSelect="true"
                    EnablePostBackOnRowClick="false" AllowDragToGroup="true" EnableRowHoverStyle="true"
                    ClientEvents-OnRowSelected="onGridRowSelected">
                </ClientSettings>
                <MasterTableView TableLayout="Fixed" GroupLoadMode="Client" Width="100%">
                    <Columns>
                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" CommandName="SelectPost"
                            HeaderStyle-Width="40px" />
                        <telerik:GridTemplateColumn HeaderText="Title" UniqueName="BlogTitle" Groupable="false"
                            HeaderStyle-Width="100%">
                            <ItemTemplate>
                                <a href="#"><b>
                                    <%# Eval("Title")%></b></a>
                                <div style="margin: 4px 0px;">
                                    <asp:ImageButton ID="statusBtn" runat="server" ImageUrl="~/Themes/Default/Icons/16x16/finished-work2.png"
                                        Style="vertical-align: middle;" />
                                    <span style="vertical-align: middle; margin-left: 2px;">Status:</span>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Action" UniqueName="BlogAction" HeaderStyle-Width="110px"
                            Groupable="false">
                            <ItemTemplate>
                                <div style="margin: 4px 0px;">
                                    <asp:ImageButton ID="actionBtn" runat="server" ImageUrl="~/Themes/Default/Icons/16x16/edit.png"
                                        Style="vertical-align: middle;" />
                                    <span style="vertical-align: middle; margin-left: 2px;"><a href="javascript:OpenWindow('NewPost.aspx?id=<%# Eval("BlogPostId")%>')">
                                        Edit</a></span>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Comments" UniqueName="BlogComments" HeaderStyle-Width="85px"
                            Groupable="false">
                            <ItemTemplate>
                                <div style="margin: 4px 0px;">
                                    <span style="vertical-align: middle; margin-left: 2px;">(num)</span>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="User" UniqueName="BlogUserName" HeaderStyle-Width="170px"
                            GroupByExpression="Username Group by Username">
                            <ItemTemplate>
                                <div style="margin: 4px 0px;">
                                    <span style="vertical-align: middle; margin-left: 2px;">
                                        <%# Eval("Username")%></span>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Blog Date" UniqueName="BlogDate" HeaderStyle-Width="150px"
                            GroupByExpression="BlogDate Group by BlogDate">
                            <ItemTemplate>
                                <div style="margin: 4px 0px;">
                                    <span style="vertical-align: middle; margin-left: 2px;">
                                        <%# Eval("BlogDate")%></span>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadPane>
    </telerik:RadSplitter>
    <script type="text/javascript">
        function closeRadWindow() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
        } 
    </script>
</asp:Content>

Code:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CSSUtilityLib;
using CSSUtilityLib.Configuration;
using CSSUtilityLib.Cookie;
using CSSUtilityLib.DataAccess;
using CSSUtilityLib.Email;
using CSSUtilityLib.Process;
using CSSUtilityLib.Security;
using CSSUtilityLib.Transfer;
using CSSUtilityLib.Validation;
using System.Data;
using System.Data.SqlClient;
using Telerik.Web.UI;
 
public partial class ccc_Posts : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // code layer for testing purpose
        string connStr = ConfigManager.GetConnStr("CSSBlogDB");
        DataSet ds0 = SqlServerDataAccessHelper.ExecuteDataSet(connStr, CommandType.StoredProcedure, "SelectAllBlogPost");
 
        RadGrid1.DataSource = ds0;
        RadGrid1.DataBind();
    }
    protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
    {
        string sCommand = e.Item.Text;
 
        switch (sCommand)
        {
            case "Delete":
                // Code here..
                break;
        }
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        RadGrid1.Rebind();
    }
}
Iana Tsolova
Telerik team
 answered on 17 Oct 2011
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?