Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
451 views
I tried following to export to pdf in Landscape page orientation:

 

RadGridResult.ExportSettings.Pdf.PageHeight = Unit.Parse("215mm")

 

RadGridResult.ExportSettings.Pdf.PageWidth = Unit.Parse("260mm");

But it didn't work, and I have no idea on how to export to Word in Landscape orientation.
But I can do it with Excel just fine. Is there anyway to "convert" Excel to PDF or Word format on the fly?

THanks

LamK.

 

 

 

 

Daniel
Telerik team
 answered on 11 Jul 2011
1 answer
240 views
By default, when we export from RadGrid to  MS Word, it automatically has 1 inches page margin, I would like to programmatically change it to 0.5.

Would you please show me how to do that?

Thanks

LamK
Daniel
Telerik team
 answered on 11 Jul 2011
6 answers
554 views
I have a Radgrid on an ASP.NET form and it is bound to a database table. In the view mode one of the columns has a text value in it that shows a mode. I am using an edit form. In the edit form I have a dropdown on that same field that allows the user to select one of three choices. I can find the dropdown in the edit template using
If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
            dp = e.Item.FindControl("dpRoles")

But what I can't figure how to get is the current data value in the current data row. I know it is in the griddataitem but how do I get to this in the itemdatabound event. I want to "jam" the dropdown list to what is currently in the grid before it goes to edit mode on that row.

Thanks in advance for your help.

Terry
Terry Harrison
Top achievements
Rank 1
 answered on 11 Jul 2011
1 answer
42 views
I have and email sent to a customer upon update with a URL of the ID that gets created.  If they click the URL it should take them directly to the radgrid with the open edititemformtemplate with all of it filled out.  Any ideas on how to accomplish this?
Elliott
Top achievements
Rank 2
 answered on 11 Jul 2011
2 answers
115 views
i have a rad Filter like below. i want to switch out the Display Name based on a condition.

<

 

 

telerik:RadFilter ID="WorkOrdersRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

 

 

 

OnApplyExpressions="WorkOrdersRadFilter_Apply" ApplyButtonText="Filter Work Orders"

 

 

 

OnPreRender="RadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating"

 

 

 

 

 

OnFieldEditorCreated

 

 

="RadFilter_FieldEditorCreated"

 

 

>
<FieldEditors>

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="Work Order#"

 

 

 

DataType="System.String" />

 

 

 

 

<

 

 

goldcustom:RadFilterComboBoxEditor FieldName="WOTYPENAME" DisplayName="WO Type"

 

 

 

 

 

 

 

DataTextField="WOTYPENAME" DataSourceID="WorkOrderTypeFilterODS" DataType="System.String"

 

 

 

 

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="TRACKINGNUMBER" DisplayName="Tracking#"

 

 

 

DataType="System.String" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="KEYREFERENCE" DisplayName="Key Ref"

 

 

 

DataType="System.String" />

 

</FieldEditors>

 

 

 

</telerik:RadFilter>
i tried what was suggested in one of the tutorials, but it never seems to fire this event.i also tried OnFieldEditorCreating which simply is used to invoke the class for radComboBoxes and that never fires either unless of course it's a radComboBox.
i assume that i want to do this when i click the "Add Expression" button on the RadFilter. is there some way i can switch out the DisplayName?? i've been thru every tutorial i can find, but nothing really works.
can i get some direct help? i'm a registered developer, do you guys need any info from me?
thanks
rik


Want to run something like this to switch out the Display name depending on a condition:

 

protected void RadFilter_FieldEditorCreated(object sender, RadFilterFieldEditorCreatedEventArgs e)

{

    if (e.Editor.FieldName == "WORKORDERNUMBER")

    {

        e.Editor.DisplayName = "My custom text";

    }

}

rik butcher
Top achievements
Rank 1
 answered on 11 Jul 2011
2 answers
106 views
I created a RadGrid and have a image button as a column; when I click image button, I need to open a new window with some existing page, passing some value.

Here's what I did. Please help:
1. created a RadGrid with OnItemCommand="RadGrid1_ItemCommand; and created a image button.

                <telerik:GridTemplateColumn AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="imgbtnEdit" ToolTip="Edit Solution" CommandName="modify" 
                            CommandArgument='<%# Bind("solution_id") %>' runat="server" ImageUrl="~/Images/edit.gif" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="2%"></ItemStyle>
                    <ItemStyle BorderStyle="Solid" HorizontalAlign="Left" VerticalAlign="Top" Width="1%" />

2.created .js file with following code
      function EditSolution(SolutionID)
      {
          var newWindow;
          var WindowName;
          WindowName = strSessionID + "EditSolution" + SolutionID;
          newWindow = window.open(
         strPublicMap + "/" + strDispLangCode + "/solutions/processsolution.asp?command=edit&solutionID=" + SolutionID,
         WindowName,
         "toolbar=yes,channelmode=no,menubar=yes,location=yes,directories=no,scrollbars=yes,resizable=yes,status=yes,height=470,width=750,left=1,top=1");
      }

 3. reference in .aspx file
<head id="Head1" runat="server">
    <title></title>
    <script language ="javascript"  type="text/javascript" src ="../Script/Home.js"></script> 
</head>

4. in code behind file

    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand

        Dim strCommandName As String = e.CommandName.ToLower()
        Dim sTitle As String = ""
        Dim intIndex As Integer

        If (strCommandName = "browse" Or strCommandName = "modify" Or strCommandName = "attachment") Then
            intIndex = Convert.ToInt32(e.CommandArgument)
            Select Case strCommandName
                Case "modify"
                    EditSolution(intIndex)
                Case "attachment"
            End Select
        End If

Protected Sub EditSolution(ByVal iSolutionID As Integer)
        Dim strScript As String = String.Empty

        strScript = "javascript:EditSolution(" & iSolutionID & ");"
        ScriptManager.RegisterStartupScript(Me.RadGrid1, Me.GetType, "OpenAttachments", strScript, True)
End Sub

The js file should be fine since it is used by production. I just start to use telerik grid. I believe last line code is wrong, but not sure how to fix it.         ScriptManager.RegisterStartupScript(Me.RadGrid1, Me.GetType, "OpenAttachments", strScript, True)
Thanks in advance!
 

Pavlina
Telerik team
 answered on 11 Jul 2011
2 answers
697 views
I am calling the RadAlert function in my code behind when a user clicks on the "Login" button. This is a very simple page with very simple functionality and I am following the examples to a tee, but still nothing. I am thinking it is because I am calling the function within a catch block when the login is unsuccessful, meaning that I am trying to display the window when the execution isn't finished. Can someone help me with this as I am stumped as to how best to proceed? My HTML and C# code is below:

<form runat="server" id="frmLogin">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadWindowManager ID="LoginWindowManager" runat="server" EnableShadow="true" Skin="Telerik" />
    <div class="loginDiv">
        <asp:Image ID="ivxLogo" AlternateText="iVidix Logo" ImageUrl="./img/ividix_logo.jpg" Height="150px"
                    Width="110px" runat="server" />
        <p>Welcome to the Instructional Video Exchange. Please login to access your videos.</p>
        <div align="center">
            <table border="0" cellpadding="0" cellspacing="10">
                <tr>
                    <td>UserName:</td>
                    <td>
                        <telerik:RadTextBox ID="txtUserName" runat="server" Width="150px" TabIndex="0" Skin="Vista" />
                    </td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td>
                        <telerik:RadTextBox ID="txtPassword" runat="server" Width="150px" TabIndex="1"
                            TextMode="Password" Skin="Vista">
                        </telerik:RadTextBox></td>
                </tr>
                <tr>
                    <td>Institution:</td>
                    <td>
                        <telerik:RadComboBox ID="ddlInstitutions" runat="server" DataSourceID="srcInstitutions"
                            DataTextField="Name" DataValueField="InstID" TabIndex="2" Skin="Vista" AllowCustomText="True">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right"><asp:Button ID="btnSubmit" runat="server"
                            Text="Login" onclick="btnSubmit_Click" TabIndex="3"/></td>
                </tr>
            </table>
        </div>
    </div>
</form>


try
{
   String encryptPwd = CryptoHelper.Encrypt(password);
    //log.Debug("Encrypted version of the password: " + password + " is " + encryptPwd);
    userSession = SessionManager.CreateSession(userName, encryptPwd, instID);
}
catch (IvidixException ex)
{
    String ErrorMessage = "UserName and/or Password in combination with the Institution were not valid. Please try again.\n";
    ErrorMessage = ErrorMessage + "Specifically, " + (String) ex.LocalMessages[0] + "\n";
    ErrorMessage = ErrorMessage + "Please contact Ividix Support if you feel that this error is incorrect.";
 
    log.Error("UserDetail Session was not created properly and therefore not stored within the HttpSession.");
    log.Debug("End btnSubmit_Click");
 
    LoginWindowManager.RadAlert(ErrorMessage, 350, 200, "Error", "");
 
    return;
}

Brian
Top achievements
Rank 1
 answered on 11 Jul 2011
2 answers
228 views
Hi ,

I'm using resource control in the Advance form.
I want to set default value for that control. How to access resource control in FormCreated event.

I was able to access text box and checkbox like this

CheckBox

 

 

ch = (CheckBox)e.Container.Controls[1].FindControl("IsPrivateCheckbox");

 

ch.Checked = System.

 

Convert.ToBoolean("True");

 

 

 

RadTextBox SubjectTextbox = (RadTextBox)e.Container.Controls[1].FindControl("SubjectText");

 

SubjectTextbox.Text = Session[

 

"PersonName"].ToString() + " On Call";


Please help.

 

Sam
Top achievements
Rank 1
 answered on 11 Jul 2011
1 answer
77 views
When using the Zoom feature of IE8 (I haven't tested any other browsers or versions) the graphics in the skin of the RadTabstrip do not display properly.

I'm attaching two images to illustrate the problem (IE8/Win7) with Zoom set to 400%.

1. The first is a screenshot of a tabstrip using the Default skin (directly from the Telerik demos area).
2. The second is a screenshot of a tabstrip using the Sitefinity skin (from a site I'm developing).

In both, notice the vertical degradation/corruption appearing in the graphic display of the Telerik tabstrip.

Is there anything I can do to fix this?

I'm a subscribing customer using RadControls for ASP.NET AJAX Q1 2011 (2011.1.519.35).

Thanks.
Dimitar Terziev
Telerik team
 answered on 11 Jul 2011
1 answer
135 views
Hi ,
I m using RadCalendar which is a MultiViewRows , and I am navigating Some Custom Date Selection when we click the Fast navigation. I using Client Side event but it throws Date2 must be array: [y, m, d]. Here below i show my code , please suggest me where is error.

<telerik:RadCalendar runat="server" Skin="Windows7" ID="RadCalendar1" AutoPostBack="true"
                                       TitleFormat="MMM-yy" EnableMultiSelect="false" MultiViewRows="3" MultiViewColumns="1"
                                       PresentationType="Interactive" HideNavigationControls="true" DayNameFormat="FirstTwoLetters"
                                       ShowOtherMonthsDays="false" FastNavigationStep="1" EnableNavigation="true" EnableMonthYearFastNavigation="False">
                                       <ClientEvents OnCalendarViewChanged="CheckSelections" />
                                   </telerik:RadCalendar>
function CheckSelections(sender, eventArgs) {
            var selDates = sender.get_selectedDates();
            var calendar = $find("<%=RadCalendar1.ClientID%>");
            var dates = calendar.get_selectedDates()
            var date = dates[0]
            var year = date[0];
            var month = date[1];
            var day = date[2]
            var mydate = month + "/" + day + "/" + year
            mydate = DateAdd(mydate, "M", 1); 
            var datearray = mydate.format("yyyy, M, d");
            var arr = [datearray];
            calendar.selectDate(arr,true);  
        }
Genti
Telerik team
 answered on 11 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?