Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
60 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
105 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
421 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
47 views
How can i change the font color of weighted item in radtagclouditem?
Princy
Top achievements
Rank 2
 answered on 26 Jul 2012
4 answers
87 views
Hi all,

I have a Rad Combo and the combo having 2 text fields and 1 value field .. i wish to use filter option to this Rad combo.. filter option should work with that 2 text fields .. how can i achieve this.. either server side or client side.. 


Regards,

Prassin
Prassin
Top achievements
Rank 1
 answered on 26 Jul 2012
1 answer
79 views

Hi all,

I want to combine a chart image with two tabs above it (simple div tags) but there is always some space between my tab divs and the chart image. I have set the following properties for the chart:

radChart1.Appearance.Border.Visible = false;
radChart1.PlotArea.Appearance.Border.Visible = false;
radChart1.PlotArea.Appearance.Dimensions.Margins = new ChartMargins(0, 0, 0, 0);
radChart1.Chart.Appearance.Border.Visible = false; //I guess this is the same as radChart1.Appearance etc.

When I save the chart image and view it in Photoshop there is clearly a  transparent area around the image containing a slight shadow. This causes the space between my tabs and the chart. How can I remove that? The skin I use for the chart is 'DeepBlue'.

Oh, and I have seen the project 197844_webapplication9.zip but that also creates a small transparent area around the chart.

regards,

Peter

Petar Marchev
Telerik team
 answered on 26 Jul 2012
7 answers
91 views

Hi,

 

I am trying to change the colors of RadRating used inside a Catalook module on my DNN site.

 

I'm new to this & have uncovered the Visual Style Builder which helps a little but I also need to change the stars that aren't selected.

 

When I look at the page with firebug the background image URL is "/webresource.axd?d= then a massive series of numbers & letters

 

I can see that the control is using the sitefinity skin but I can't find this skin anywhere

 

I did do a search for sprite.png & found 1 instance but it had no images of stars on it

 

I also searched for skin.css files but couldn't find any related.

 

I've reviewed how to create a custom file from copying an existing one but can't find an existing 1 to copy.

 

My folder structure does have a series of radcontrols but not one for rating.

 

Can I manually create a skin & point to this in the ascx file where the code currently says

 

<telerik:RadRating ID="rrlistAverageRating" runat="server" ItemCount="5"
  
ReadOnly="true" Skin="Sitefinity">

 

If so can I see an example, please.

 

Can I just modify the sprite.png file?

An example of my site is currently http://frame.utiliseit.com.au/Products/BagsandLuggage.aspx

 

Thanks in advance

Bozhidar
Telerik team
 answered on 26 Jul 2012
1 answer
55 views
I have an ASP.NET TreeView that I want to be able to drag and drop nodes. It is working just fine, except for one thing. If you look at my screen shot image, you will see a double headed arrow next to each node. I want to be able to drag and drop nodes ONLY by dragging and dropping the double headed arrow image. Right now, you can drag anywhere on the cell and drop. Can you please explain how this is done?

Princy
Top achievements
Rank 2
 answered on 26 Jul 2012
2 answers
120 views
hi i have a radgrid which is populated with ListA (generated from database) within OnNeedDataSource,

The radgrid has command a command button. the command button trigers a radajaxloading panel. In RadGrid1_ItemCommand I take out some record from database, and call RadGrid1.Rebind() to reflect the change.

During debug i can step through all these code and even in the OnNeedDataSource method called by RadGrid1.Rebind() method after item command i can see ListA has changed (with some records removed). 

However when I proceed to the end the RadGrid still got the original ListA with the records that should be removed.

any idea what I am doing wrong?

thanks in advance
Bruno
Top achievements
Rank 2
 answered on 26 Jul 2012
3 answers
353 views
I have been looking around but have not found anyone with my same situation. I am using a control in an edit template inside a radgrid. I have a RadComboBox that on selection populates a panel with custom controls based on the combobox selection. After this or any other post back button is used the grid no longer posts back or functions. This also includes the other text boxes inside that same control. I was thinking this might have something to do with the viewstate but changing that around has no fixed the problem. This may just be something quick that I am missing. Any help would be much appreciated.

<asp:Content ID="conMain" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
        <script type="text/javascript">
            function openUserAdmin() {
                var oManager = window.radopen("User.aspx", null)
                oManager = $telerik.toWindow(oManager); // intellisense
                oManager.setSize(520, 600); //Width, Height
                oManager.center(); //Centers on Screen
                oManager.set_visibleStatusbar(false); //Bottom Status Hidden
                oManager.set_modal(true); //Makes window Modal
                oManager.set_reloadOnShow(true); //Reloads the page everytime its shown
                oManager.set_destroyOnClose(true); // destroys the window on close
                oManager.SetActive(); // Sets window as active element
                return false;
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock2">
        <script type="text/javascript">
            function openBusinessSegment() {
                var oManager = window.radopen("BusinessSegment.aspx", null)
                oManager = $telerik.toWindow(oManager); // intellisense
                oManager.add_close(gridInstallationRebind); // Rebinds the grid on close
                oManager.setSize(520, 600); //Width, Height
                oManager.center(); //Centers on Screen
                oManager.set_visibleStatusbar(false); //Bottom Status Hidden
                oManager.set_modal(true);
                oManager.set_reloadOnShow(true);
                oManager.set_destroyOnClose(true);
                oManager.SetActive();
                return false;
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadScriptBlock runat="server" ID="rsbGridRebind">
        <script type="text/javascript">
            function gridInstallationRebind() {
                var grd = $find("<%=RadGrid1.ClientID %>"); // Finds the grid
                grd = $telerik.toGrid(grd); // intellisense
                mtv = grd.get_masterTableView(); // finds the master table
                mtv.rebind(); // rebinds the data
            }
        </script>
    </telerik:RadScriptBlock>
    <%--Removable: For javscript telerik intellisense. Comment before running--%>
    <%--<telerik:radscriptmanager runat="server" id="rsm1" />--%>
    <%--End Comment Area--%>
    <telerik:RadWindowManager runat="server" ID="rwmPopUps" Animation="Fade" IconUrl="/Images/admin.png" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" Width="100%" ShowStatusBar="True" GridLines="None"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand"
            OnItemDataBound="RadGrid1_ItemDataBound" PageSize="15" EnableViewState="true" ViewStateMode="Inherit">
            <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
            <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ID" CommandItemSettings-AddNewRecordText="Add A New Installation"
                AllowSorting="True" ExpandCollapseColumn-ButtonType="SpriteButton" EditFormSettings-EditFormType="Template"
                CommandItemStyle-VerticalAlign="Middle" EnableViewState="true" ViewStateMode="Inherit">
                <CommandItemSettings AddNewRecordText="Add A New Installation"></CommandItemSettings>
                <CommandItemTemplate>
                    <div style="padding: 6px 2px 0px 2px;">
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnNewInstallation" Text="Add New Installation"
                                CommandName="InitInsert" />
                        </div>
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnBusinessSegment" Text="Business Segment Admin"
                                OnClientClicked="openBusinessSegment" AutoPostBack="false" />
                        </div>
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnUserAdmin" Text="User Admin" OnClientClicked="openUserAdmin" AutoPostBack="false" />
                        </div>
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnRefresh" Text="Refresh" CommandName="RebindGrid" AutoPostBack="false" />
                        </div>
                    </div>
                </CommandItemTemplate>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="Edit">
                        <HeaderStyle Width="3%" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn HeaderText="Customer Name" UniqueName="Customer" SortExpression="Customer"
                        DataField="Customer">
                        <HeaderStyle Width="35%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Customer Location" UniqueName="Location" SortExpression="Location"
                        DataField="Location">
                        <HeaderStyle Width="25%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Installation Description" UniqueName="Description"
                        SortExpression="InstallationDescription" DataField="InstallationDescription">
                        <HeaderStyle Width="35%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton"
                        ConfirmText="Delete Installation?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete">
                        <HeaderStyle Width="2%" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings EditFormType="Template" >
                    <EditColumn ButtonType="ImageButton" />
                    <FormTemplate>
                        <div>
                            <bw:LocationDetail ID="bwLocationDetail" runat="server" />
                        </div>
                    </FormTemplate>
                </EditFormSettings>
                <PagerStyle AlwaysVisible="True" />
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
    </div>
</asp:Content>
James
Top achievements
Rank 1
 answered on 25 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?