Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
157 views
Hi,

I'm trying to get round the problem of FireFox not rendering vertical text when using the skin VericalLeft.

I've been attempting to dynamically draw an image (containing the text I want) using the .Net graphics library, and rotating the image to give me the desired affect.

I'm setting the ImageURL property of the tab to an aspx page (which takes the text on the querystring) , as follows:-

myTab.ImageURL = Page.ResolveURL(string.format("~/mypage.aspx?MyText={0}","Tab A"))

The page (mypage.aspx) then attempts to draw the image in the page load event as follows:-

 

 

Protected

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

Dim strText As String = Server.UrlDecode(Request.QueryString("ImageText"))

 

 

Dim sf As StringFormat = New StringFormat()

 

sf.FormatFlags = StringFormatFlags.DirectionVertical

 

Dim f As System.Drawing.Font = New System.Drawing.Font("Tahoma", 8)

 

 

Dim gText As Graphics = Graphics.FromImage(New Bitmap(1000, 1000))

 

 

Dim imageSize As SizeF = gText.MeasureString(strText, f, 25, sf)

 

 

Dim i As Image = DirectCast(New Bitmap(CType(imageSize.Width, Integer), CType(imageSize.Height, Integer)), Image)

 

 

Dim g As Graphics = Graphics.FromImage(i)

 

g.FillRectangle(Brushes.White, 0, 0, i.Width, i.Height)

 


'//flip the image 90 degrees

 

 

 

g.TranslateTransform(i.Width, i.Height)

 

 

g.RotateTransform(90.0F)

g.DrawString(strText, f, Brushes.Black, 0, 0, sf)

 

 

Response.ContentType =

"image/JPEG" 'Tell browser, what we are sending

 

 

 

i.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg)

 

 

 


End
Sub

 

 

 



I've done something similar in a page setting the src of an image control to a page that renders an image. My first attempts have not rendered corrrectly i'm just getting the missing image placeholder. Is it going to be possible to attempt this with the RadTabStrip or am I wasting my time? Perhaps I need to do something with the CSS for image sizing or something?

Cheers,
Rob.

 

Robert
Top achievements
Rank 1
 asked on 27 Feb 2009
2 answers
295 views
Hi,

I want to add the radgrid to the treeview dynamically, kindly advise how to add radgrid dynamically to tree view using NodeTemplate.


Regards,

Santhosh
Chrysa
Top achievements
Rank 1
 answered on 27 Feb 2009
1 answer
49 views
I am having a problem with the radgrid. I am hosting the grid in a webpart on MOSS 2007. When the grid is collapsed and I sort a column all is good. Lets say I sort the NAME column, the sort image shows up next to the column header text as it should. If I expand one of the rows in the grid, now the sort image is gone and an ugly blank button is where that image should be. If I sort one of the columns on the child (expanded) table, the sort image shows up as it should on the child table but the sorted column on parent table still has the ugly blank button thing going on.

Telerik.Web.UI.dll
Assembly version: 2008.2.826.20
File version : 2008.02.0826.20

Skin : Office2007

Help!


Pat....
Georgi Krustev
Telerik team
 answered on 27 Feb 2009
1 answer
248 views
I am using Rad.Window within Rad.Grid to serve as a popup edit form.
It works well when I use them in single aspx page. However, when I inherits a master page to this page, I got the error Two components with same id "ctl00_ContentMain_radwLocalChurchItemEditForm" can't be added to the application.
I search the source code, I can only find one div control with id="ctl00_ContentMain_radwLocalChurchItemEditForm":
<div id="ctl00_ContentMain_radwLocalChurchItemEditForm" style="display:none;">

The code from master page:
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="LocalChurchHeader.master.vb" Inherits="LocalChurchSeromon.LocalChurchHeader" %>
<%@ Register Assembly="Telerik.Web.UI" 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 id="LocalChurchHeaderTitle">Local Church</title>
    <link type="text/css" rel="Stylesheet" href="css/cmwPage.css" />
    <link type="text/css" rel="Stylesheet" href="css/cmwItemDisplay.css" />
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="cmwTitleBar">
        <div class="centered">
            <div class="oiOutbox logo">
                <img src="images/tjc_logo.png" alt="" style="height: 54px; width: 90px" />
            </div>
            <div id="spanTitle" class="cmwTitle" runat="server">
            Vancouver Church Sermon List
            </div>
            <div class="float-divider"></div>
        </div>
    </div>
    <div class="centered">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Office2007" >
            <Tabs>
                <telerik:RadTab runat="server" Text="Home" Selected="True">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Browse"
                    NavigateUrl="LocalChurchBrowse.aspx?langid=1&lcid=29">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Widget"
                    NavigateUrl="LocalChurchWidgetUI.aspx">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Listen"
                    NavigateUrl="LocalChurchSermonPlayer.aspx">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Management"
                    NavigateUrl="LocalChurchManagement.aspx">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <asp:ContentPlaceHolder ID="ContentMain" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

The code from aspx page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="LocalChurchManagement.aspx.vb" Inherits="LocalChurchSeromon.LocalChurchManagement"  MasterPageFile="LocalChurchHeader.Master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="ContentMain" ContentPlaceHolderID="ContentMain" runat="server">
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript" language="javascript">
            // Rad Windows: Dialog of validate report
            function ItemEditForm_showDialog(url) {
                //Force reload in order to guarantee that the onload event handler of the dialog which configures it executes on every show.
                var oRadWindow = "<%= radwLocalChurchItemEditForm.ClientID %>";
                var oWnd = window.radopen(url, oRadWindow);
                oWnd.setUrl(oWnd.get_navigateUrl());
            }
            function ItemEditForm_clientShow(sender, eventArgs) {
                var args = new Object();
                // args.filenameAsTitle = srvArgs.filenameAsTitle;
                sender.Argument = args;
            }
            function ItemEditForm_clientCallback(sender, args) {
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="radwLocalChurchItemEditForm" runat="server"
                Modal="True"
                OnClientShow="ItemEditForm_clientShow"
                ClientCallBackFunction="ItemEditForm_clientCallback"
                Width="640px" Height="640px" Behaviors="Close, Move" VisibleStatusbar="False">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
            AllowPaging="True" AllowSorting="True" GridLines="None" Skin="Office2007"
            PageSize="25" AutoGenerateColumns="False">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridTemplateColumn HeaderText="" UniqueName="tcEdit" AllowFiltering="false">
            <ItemTemplate>
                <a id="aFileEdit" href="javascript:void(0);" runat="server">Edit</a>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="ItemID" HeaderText="Item ID" DataType="System.Int32"
            SortExpression="ItemID" UniqueName="ItemID" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ItemTitle" HeaderText="Title"
            SortExpression="ItemTitle" UniqueName="ItemTitle">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Author" HeaderText="Speaker"
            SortExpression="Author" UniqueName="Author">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Translator" HeaderText="Intepretor"
            SortExpression="Translator" UniqueName="Translator">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Publisher" HeaderText="Publisher"
            SortExpression="Publisher" UniqueName="Publisher" Visible="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PubDate" DataType="System.DateTime"
            HeaderText="Sermon Date" SortExpression="PubDate" UniqueName="PubDate"
            DataFormatString="{0:MMM dd, yyyy}">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CreatedDate" DataType="System.DateTime"
            HeaderText="Upload Date" SortExpression="CreatedDate"
            UniqueName="CreatedDate" DataFormatString="{0:MMM dd, yyyy}">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="SpeakerSLangText"  
            HeaderText="Speaker Language" SortExpression="SpeakerSLangText"
            UniqueName="SpeakerSLangText" >
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TranslatorSLangText"
            HeaderText="Intepretor Language" SortExpression="TranslatorSLangText"
            UniqueName="TranslatorSLangText" >
        </telerik:GridBoundColumn>
        
    </Columns>
</MasterTableView>

<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
        </telerik:RadGrid>
</asp:Content>


and code behind:
    Private Sub INIT_RadGrid_Header()
        ' must assign header text during page load!!
        ' the problem to put this in RadGrid1.ItemDataBound is, it will effect the sort function for Rad.Grid!

        RadGrid1.MasterTableView.GetColumn("ItemID").HeaderText = "Item ID"
        RadGrid1.MasterTableView.GetColumn("ItemTitle").HeaderText = "Title"
        RadGrid1.MasterTableView.GetColumn("Author").HeaderText = "Speaker"
        RadGrid1.MasterTableView.GetColumn("Translator").HeaderText = "Intepretor"
        RadGrid1.MasterTableView.GetColumn("Publisher").HeaderText = "Location"
        RadGrid1.MasterTableView.GetColumn("PubDate").HeaderText = "Sermon Date"
        RadGrid1.MasterTableView.GetColumn("CreatedDate").HeaderText = "Upload Date"
        RadGrid1.MasterTableView.GetColumn("SpeakerSLangText").HeaderText = "Speak In"
        RadGrid1.MasterTableView.GetColumn("TranslatorSLangText").HeaderText = "Translate To"
    End Sub

    Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        Dim sCnn As String = System.Configuration.ConfigurationManager.ConnectionStrings("eLibDBConnectionString").ToString
        Dim db As New dcLocalChurchDataContext(sCnn)

        RadGrid1.DataSource = db.GetSermonList(oQS.LCID, oQS.LangID)
    End Sub

    Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        Select Case True
            Case (TypeOf (e.Item) Is GridDataItem)
                Dim oItem As GridDataItem = CType(e.Item, GridDataItem)
                Dim s As String = ""
                Dim aObj As System.Web.UI.HtmlControls.HtmlAnchor

                s = oItem("ItemID").Text
                aObj = CType(oItem("tcEdit").FindControl("aFileEdit"), System.Web.UI.HtmlControls.HtmlAnchor)
                aObj.Attributes.Add("onclick", _
                    String.Format("ItemEditForm_showDialog('LocalChurchItemEditForm.aspx?langid={0:g}&itemid={1}')", CInt(oQS.LangID), s))
        End Select
    End Sub





Please help, thanks!
Darren





Fiko
Telerik team
 answered on 27 Feb 2009
5 answers
200 views
my radeditor is not displaying properly. the icons are separated and disoriented. the clickable area is incorrect.. i.e. clicking on the icon sometimes does't trigger. I think this is a css problem, but I didn't even mess with the css properties yet..

the icons work properly in firefox but not ie 6 or 7...
Rumen
Telerik team
 answered on 27 Feb 2009
4 answers
129 views

This is very common in the old Radcontrols for ASP.NET...

1. In the master page

<form id="form1" runat="server" style="height:100%">  
        <telerik:RadScriptManager ID="MasterRadScriptManager" runat="server" EnableScriptCombine="true"></telerik:RadScriptManager>    
<telerik:RadAjaxManager ID="MasterRadAjaxManager" runat="server" OnAjaxRequest ="MasterRadAjaxManager_AjaxRequest" EnablePageHeadUpdate="False">  
            <AjaxSettings/> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
</form> 

2. From the Code Behind Expose the RadAjaxManager 
        public RadAjaxManager RadAjaxManager  
        {  
            get  
            {  
                return this.MasterRadAjaxManager;  
            }  
        }  
 
3. From the content Page aspx
<asp:Content ID="CLP" ContentPlaceHolderID="MCPH" runat="server">  
          <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_OnClick" /> 
<asp:Label ID="lblClientScript" runat="server" Text=""></asp:Label> 
</asp:Content> 
4. From content Page code behind wireup btnsave and lblclientscript on pageload
protected void Page_Load(object sender, EventArgs e)  
{  
     this.Master.RadAjaxManager.AjaxSettings.AddAjaxSetting(btnSave, lblClientScript);  
     this.Master.RadAjaxManager.AjaxSettings.AddAjaxSetting(this.Master.RadAjaxManager, lblClientScript);  
}  
 
protected void btnSave_OnClick(object sender, EventArgs e)  
{  
    lblClientScript.Text = "alert('test "+ DateTime.Now.ToLongTimeString() +"');";  

The alert only works on the First Click but subsequent click does not fire the alert.
But if I just set the Label to some text I can see that it is refreshing the Label...again this use to work in the Old RadAjax
protected void btnSave_OnClick(object sender, EventArgs e)     
{     
    lblClientScript.Text = "updating "+ DateTime.Now.ToLongTimeString();     

I also know...that i can just use ...this.Master.RadAjaxManager.ResponseScripts.Add("alert('test')"),
which works but for some instance I have to use Labels...

 

Yuriy Rogach
Top achievements
Rank 1
Iron
 answered on 27 Feb 2009
1 answer
92 views
Is there a client side event that is raised after any and all of the other events (onClientItemClicking, onClientLoad, onClientItem........) fire?   I am using javascript to add and remove css class names to the items class attribute.  Alas, my code works except there seems to be client side code firing after my code that removes the work my code did.  I need to set the background image url based on business logic as opposed to UI state.

Thanks for your help,

Ben
Paul
Telerik team
 answered on 27 Feb 2009
1 answer
202 views
Hello

I can't seem to find any documentation for the following scenario :

We need to Link from Page1 to Page2 and have Page2 automatically display the correct tab and resulting multipage.

I am assuming I can use something along the lines of <a href="Page2.aspx#Tab3">Go to Page2 and display Tab3</a>

Is this possible, and if so how?

thanks in advance.
Paul
Telerik team
 answered on 27 Feb 2009
1 answer
209 views

Hi,
 
I have referred to the below thread to develop file download with Ajax.

http://www.telerik.com/community/forums/aspnet/ajax/ajax-and-file-download.aspx

The steps are as below:

  1. Click Download button on default.aspx page which is in an Ajax Panel (RadAjaxPanel1) 
  2. Download Button Even fires 

      ajm.ResponseScripts.Add("SetContentPage('Download.aspx')");
3.  Logic in Download.aspx.cs page processes and user is prompted to Open, Save, Cancel file download.

            FileInfo fileInfo = new FileInfo(filepath);

            HttpContext.Current.Response.Clear();

            HttpContext.Current.Response.AddHeader("Content-    Disposition", "attachment; filename=" + fileInfo.Name);

            HttpContext.Current.Response.AddHeader("Content-Length", fileInfo.Length.ToString());

            HttpContext.Current.Response.ContentType = "application/octet-stream";

            HttpContext.Current.Response.Flush();

         HttpContext.Current.Response.WriteFile(fileInfo.FullName);
4.    Done.

 

The download function is working fine. However, Page is just reloaded instead of download for the first time due to IE download security block.

This can be solved by follow setting as below:

IE Tools -> Internet Options -> Security -> Internet -> Custom Level ->Downloads (Automatic prompting for file downloads) ->Enable.

 

Unfortunately, the above setting is not a good option. May I know is there any solution to solve the above issue by coding?


Thanks.

Regards,
Teik Ee 

 

Ewoud
Top achievements
Rank 1
 answered on 27 Feb 2009
1 answer
81 views
We are trying to use Prometheus and the version before prometheus, together in the same project. Just wanted to ask, does anyone envisage any known problem with this scenario?
Daniel
Telerik team
 answered on 27 Feb 2009
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?