Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
136 views
Hi,

About multiline radtextbox : Have you experienced some scenario where RadTextBox1.text server side is more than 100 character long even if MaxLenght = 100 ?

I can't reproduced myself the problem but I had a couple of 'string or binary data would be truncated' while inserting in a nvarchar(100) sql server field.

I'm not using multiline very often and forgot to check server side the lenght of the text before inserting.

Anyway, I'm thinking about an old browser usage (IE6 ?) ?

What do you think ?

EDIT : using last telerik dll

Thanks
Arnaud


arnaud
Top achievements
Rank 1
 answered on 26 Jul 2012
1 answer
129 views
Hello,

I am implementing RadWindow in a user control that will pop up context sensitive help whenever the user clicks an icon.  The intention is that I will drop the user control anywhere on a page that requires it (i.e. multiple instances on the one page).

I have set up a hidden field on the user control so that each time it is dropped onto the page I can set the value of the field which is then used by the control to determine which help data to load.

The problem is that it seems the window the control uses is shared across all instances and it is unable to store the value independent of one another (therefore the same help text appears each time regardless of which help control is clicked).

Here is my Help Control code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Help.ascx.cs" Inherits="Controls_Generic_Help" %>
<script type="text/javascript">
    function openHelpWindow(sender, args) {          
        var radWindow = $find("<%=radWindow1.ClientID%>");
        var docId = $get("<%= documentIdField.ClientID%>").value;
        radWindow.setUrl("help.aspx?Id=" + docId);
        radWindow.show();
    }
</script>
<telerik:RadButton id="helpButton" runat="server" autopostback="false" Width="16" Height="16" onclientclicked="openHelpWindow">
    <Image EnableImageButton="true" ImageUrl="~/images/icon-help.png" IsBackgroundImage="false" />
</telerik:RadButton>
<telerik:radwindow id="radWindow1" runat="server" Width="600px" Height="600px" VisibleTitlebar="false"></telerik:radwindow>
<asp:HiddenField runat="server" ID="documentIdField" />


Then all I do on the page where the control is dropped is set the hidden field value:
Help1.HelpDocName = "HelpQuickLinksNavigator";
 
Help2.HelpDocName = "HelpActivityFeed";

However all that happens is that the first value only is used each time the window is opened.

Thoughts?

Andrew
Andrew Galea
Top achievements
Rank 1
 answered on 26 Jul 2012
1 answer
160 views
shfds
Kate
Telerik team
 answered on 26 Jul 2012
3 answers
117 views
As i click on a checkbox (template column) in a row of the main grid an event is raised and
a client-side function is called. 

Inside this function I need to do something on its detail table, I don't have, and I need it, the ID of that Detail Table
I did like this:

var grid = $find(gridClientID);
var childGridID = grid.get_detailTables()[ROW].get_dataItems()[0].get_id()

ROW is the index of the main grid row to which the checkbox belongs.

But... 
grid.get_detailTables()[index].get_dataItems()[0].get_id() 
index actually refer to the index of the expanded ones, so if click on the first row (ROW=0) and first row is not expanded and the second row is expanded the action takes place on the second row (ROW=1) because is the first expanded

How do I know
1) detail Table ID having the parent grid?
2) if it's not expanded can I work on it?

Thank you


Marin
Telerik team
 answered on 26 Jul 2012
1 answer
114 views
I have found several old posts where people are asking how to do this, and also mention that it may be addressed in an upcoming release. Just wondering if there is a method of rebinding the detail table of a RadGrid from the client side ?

Thanks
Marin
Telerik team
 answered on 26 Jul 2012
2 answers
281 views
Hi guys,

Loving the PDF export functionality so far. Although I'm struggling with an issue with image size when exported to PDF.

My radgrid displays some jpg and gif images which are quite large, so I'm resizing them dynamically with OnItemDataBound.
This all works fine on the page, but when I export the radgrid to PDF, the images seem to lose their dimensions i.e. they display at their original size in the PDF.

Is there a way to resize them for PDF export? I've been using the ItemCreated event to modify cell sizes etc, but can't work out how to do the same with images.

Thanks,
Andrew
Andrew
Top achievements
Rank 1
 answered on 26 Jul 2012
1 answer
79 views
Hi, I have a RadGrid with scrolling capability. The user can use a search box to enter a reference for a row, and if it's found I need to automatically scroll to that row and select it.

I have the selection working, but it doesn't scroll down automatically to it - is there a way I can do this?
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Jul 2012
1 answer
141 views
Hi,

For some reason when I press the + button on the RadGrid it doesnt trigger onbeforeload. However when I click the "Add new record" LinkButton is does, which is not desired. Below i have attached sample code to reproduce this behavior. Is there valid Telerik solution to this problem, other then the one I have provided at the end of this post?

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="OnBeforeUnloadRadGridIssue._Default" %>
  
<%@ 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">
<head runat="server">
    <title>OnBeforeUnload RadGrid Issue</title>
    <script type="text/javascript">
  
        var newSourceFilesAdded;
  
        window.onbeforeunload = function (event) {
  
            if (newSourceFilesAdded) {
                return 'Are you sure?';
            }
  
        }
  
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"
                        UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
        </telerik:RadAjaxLoadingPanel>
    </div>
    <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None">
        <MasterTableView ClientDataKeyNames="DocumentId, FileName" Width="100%" CommandItemDisplay="Top">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="FileName" HeaderText="Filename" SortExpression="FileName"
                    UniqueName="FileName" ReadOnly="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="WordCount" HeaderText="Word Count" SortExpression="WordCount"
                    UniqueName="WordCount" ItemStyle-Width="50px">
                    <ItemStyle Width="50px"></ItemStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PageCount" HeaderText="Page Count" SortExpression="PageCount"
                    UniqueName="PageCount" ItemStyle-Width="50px">
                    <ItemStyle Width="50px"></ItemStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CharacterCount" DataType="System.Int32" FilterControlAltText="Filter CharacterCount column"
                    HeaderText="Character Count" UniqueName="CharacterCount">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="Delete">
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
    </form>
</body>
</html>

Imports Telerik.Web.UI
  
Public Class _Default
    Inherits System.Web.UI.Page
  
  
    Public Property SourceFiles As List(Of SourceFile)
        Get
            Return Session("SourceFiles")
        End Get
        Set(value As List(Of SourceFile))
            Session("SourceFiles") = value
        End Set
    End Property
  
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
        If Not IsPostBack Then
  
  
            Dim count As Byte = 0
            Dim rnd As New Random
            Dim sfs As New List(Of SourceFile)
  
            While count < 10
  
                Dim id As String = Guid.NewGuid.ToString
                sfs.Add(New SourceFile With {.DocumentId = id,
                                             .FileName = id,
                                             .CharacterCount = rnd.Next(0, Integer.MaxValue),
                                             .PageCount = rnd.Next(0, Integer.MaxValue),
                                             .WordCount = rnd.Next(0, Integer.MaxValue),
                                             .IsNew = True})
  
                count = count + 1
  
            End While
  
            SourceFiles = sfs
  
            RadGrid1.DataSource = SourceFiles
            RadGrid1.DataBind()
  
        Else
  
            Dim context As System.Web.HttpContext = System.Web.HttpContext.Current
            If context IsNot Nothing Then
                Dim page As System.Web.UI.Page = CType(context.Handler, System.Web.UI.Page)
                Telerik.Web.UI.RadAjaxManager.GetCurrent(page).ResponseScripts.Add(" newSourceFilesAdded = " & If(SourceFiles.Any, "true; ", "false; "))
            End If
  
        End If
  
    End Sub
  
    Private Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
  
        RadGrid1.DataSource = SourceFiles
  
    End Sub
  
End Class
  
Public Class SourceFile
  
    Public Property DocumentId As String
    Public Property FileName As String
    Public Property WordCount As Integer
    Public Property PageCount As Integer
    Public Property CharacterCount As Integer
    Public Property IsNew As Boolean
  
End Class

As i mentioned before, I have found a workaround by doing the following:

<ClientEvents OnCommand="RaiseCommand" />

where the function itself has no code:

function RaiseCommand(sender, eventArgs) {
    //By adding this, it prevents onbeforeunload from firing as a redirect,
    //When Add New Record is clicked insead of + button.
}

Thanks,
Aash.
Antonio Stoilkov
Telerik team
 answered on 26 Jul 2012
1 answer
475 views
Hi there,
     I have a radgrid edit form with web user control . The usercontrol have a radtextbox in it. How can I make it readonly when editing the grid?
Savyo
Shinu
Top achievements
Rank 2
 answered on 26 Jul 2012
1 answer
66 views
How can i change the font color of weighted item in radtagclouditem?
Princy
Top achievements
Rank 2
 answered on 26 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?