Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
35 views
I created two functions to expand and collapse a row in a RadGrid control.
It works well in IE9, Firefox and Chrome, but it fails in IE8.
The $telerik object returns as undefined.
v 2012.1.411.35

function rgOption_Expanded(sender, args) {
    
    var item = args.get_item();
    var label = $telerik.findElement(item.get_element(), "options");
    label.style.display = "block";


}
function rgOption_Collapsed(sender, args) {


    var item = args.get_item();
    var label = $telerik.findElement(item.get_element(), "options");
    label.style.display = "none";


}
Eyup
Telerik team
 answered on 05 Nov 2012
1 answer
113 views
Good Morning, I am having an issue with a grid that has fixed headers and has grouping enabled. Everything aligns correctly until the grouping is collapsed to where there is no vertical scrollbar. When this happens the header and the cells become misaligned (see screenshot). Is there anyway to fix this issue? 

<telerik:RadGrid ID="grdLabs" runat="server" Skin="grid" EnableEmbeddedSkins="False" SelectedItemStyle-CssClass="SelectedStyle"
                AllowMultiRowSelection="True" AllowSorting="False" CellSpacing="0" GridLines="None" AllowPaging="false"
                AutoGenerateColumns="False" GroupingEnabled="True" Height="100%" Width="100%"  EnableAJAX="false">
                <MasterTableView ShowHeadersWhenNoRecords="True" GroupLoadMode="Client" TableLayout="Auto">
                    <GroupHeaderTemplate>
                    <span style="font-weight: bold;">
                        <%# Eval("CategoryType")%></span>
                </GroupHeaderTemplate>
                                    <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldName="CategoryType" HeaderText="" />
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="CategorySeq" HeaderText="" />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                                         
                </GroupByExpressions>
                    <NoRecordsTemplate>
                        No results
                    </NoRecordsTemplate>
                </MasterTableView>
                <ClientSettings Resizing-AllowColumnResize="False" Resizing-ResizeGridOnColumnResize="False" AllowGroupExpandCollapse="True" AllowExpandCollapse="False">
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting>
                    <Scrolling AllowScroll="True" UseStaticHeaders="False" SaveScrollPosition="True" FrozenColumnsCount="0"/>
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="true" />
                <PagerStyle Mode="NumericPages" Position="Top" PagerTextFormat="{4} Page {0} of {1}, results {2} to {3} of {5}." />
            </telerik:RadGrid>
Eyup
Telerik team
 answered on 05 Nov 2012
1 answer
87 views
I am trying the following example (tooltipmanager) but my code differs a bit as I am trying to add RadEditor control inside the ascx page.
http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=grid

On tooltip, it opens my ascx page and displays the radeditor control but it does not allow me to type anything in the "design" view (somehow it seems to be disabled).
When i type in "html" view and come back to "design" view, it still does not show any text in the design view.

Is there something different or special that needs to be done when implementing a radeditor in the above mentioned scenario.

Thanks
Ajay
Marin Bratanov
Telerik team
 answered on 05 Nov 2012
0 answers
93 views
hi , kindly help me . i want show tooltip beside textbox in radgrid in edit mode and show or hide it from client functions \
what i made i added tooltip and set the target control (textbox) and it works fine but when the tootip show and make scroll in radgrid the 
tootip still at the first position  not move with textbox although the tooltip relative to element 
Ashraf
Top achievements
Rank 2
 asked on 05 Nov 2012
1 answer
100 views
Hi,

I'm attempting to dynamically create a RadContextMenu inside an asp.net server control. Whilst the Context Menu appears to be created/rendered correctly, I am unable to get any menu items to actually create. Checking the rendered markup - it appears that these items never actually make it onto the page.

Below is a sample of my code, can anyone indicate what I am doing wrong?

Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
 
<ParseChildren(True, "MenuItems")>
Public Class SplitButton
    Inherits WebControl
 
    Private _MenuItems As New List(Of MenuItem)
    Private _Button As RadButton
    Private _ContextMenu As RadContextMenu
 
    Public Property MenuItems() As List(Of MenuItem)
        Get
            Return _MenuItems
        End Get
        Set(ByVal value As List(Of MenuItem))
            _MenuItems = value
        End Set
    End Property
 
    Public Property Text As String
    Public Property IconUrl As String
 
    Private Sub BuildContextMenu()
        _ContextMenu = New RadContextMenu() With {.ID = String.Format("{0}_Menu", Me.ID)}
        Me.Controls.Add(_ContextMenu)
 
        Dim x As New List(Of RadMenuItem)
 
        For Each item As MenuItem In MenuItems
            Dim menuItem As New RadMenuItem() With {.Text = item.Text, .Value = item.Value, .Visible = item.Visible, .ImageUrl = item.IconUrl, .PostBack = item.PostBack}
 
            x.Add(menuItem)
        Next
 
        _ContextMenu.Items.AddRange(x)
 
 
    End Sub
 
    Private Sub BuildButton()
        _Button = New RadButton() With {.ID = String.Format("{0}_Button", Me.ID)}
 
        _Button.OnClientClicked = "SplitButton_OnClientClicked"
        _Button.Attributes.Add("data-contextmenu", _ContextMenu.ClientID)
        _Button.Text = Text
        _Button.Icon.PrimaryIconUrl = IconUrl
        _Button.EnableSplitButton = True
 
        Me.Controls.Add(_Button)
    End Sub
 
    Private Sub SplitButton_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init
        BuildContextMenu()
    End Sub
 
    Private Sub SplitButton_PreRender(ByVal Sender As Object, ByVal e As EventArgs) Handles Me.PreRender
 
        BuildButton()
    End Sub
 
End Class
 
Public Class MenuItem
 
    Public Property IconUrl As String
    Public Property Text As String
    Public Property Value As String
    Public Property PostBack As Boolean
    Public Property Visible As Boolean
 
End Class

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Grid_SplitButtonDemo.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<%@ Register Assembly="GridSplitButtonDemo" Namespace="Grid_SplitButtonDemo" TagPrefix="a" %>
 
<head runat="server">
    <title>SplitButton Demo</title>
    <script type="text/javascript">
        function SplitButton_OnClientClicked(sender, args)
        {
            //Check if we clicked the splitbutton portion, or the button portion
            if (args.IsSplitButtonClick())
            {
                //Show the context menu below the selected button.
                var currentLocation = $telerik.getLocation(sender.get_element());
                var contextMenu = $find(sender.get_element().getAttribute('data-contextmenu'));
                //alert(contextMenu.get_items().get_count());
                contextMenu.showAt(currentLocation.x, currentLocation.y + 22);
 
                //Prevent postback.
                sender.set_autoPostBack(false);
            }
            else
            {
                //Button portion clicked, Perform the default action.
                alert("Perform Default Action");
                sender.set_autoPostBack(true);
            }
        }
    </script>
</head>
<body>   
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <h2>
        SplitButton Demo
    </h2>
    <div>
        <a:SplitButton runat="server" ID="btnActions" Text="Edit" IconUrl="Images/pencil.png">
            <a:MenuItem IconUrl="Images/Remove.png" Text="Delete" Value="Delete" PostBack="false" />
            <a:MenuItem IconUrl="Images/wand.png" Text="Add Another" Value="NewAnother" />
        </a:SplitButton>
    </div>
    </form>
</body>
</html>

Thanks
Fergal
Kate
Telerik team
 answered on 05 Nov 2012
6 answers
218 views
Hello -- I have a page with three tabs.  Each tab has an instance of RadEditor in it.  I have added custom buttons to the toolbar.  These buttons are added in code behind with the code -- 

void LoadCustomButton(stirng name, string text, string backgroundImageUrl) {
         EditorToolGroup dynamicToolBar  new EditorToolGroup();
         This.RadEditor1.Tools.Add(dynamicToolBar);

          EditorTool custom1 = new EditorTool();
          custom1.Name = name;
          custom1.Text = text;

//----------------------------------------------------------------------------
          // Want to be able to do something like the following ----
         //custom1.Style.BackgroundImageUrl = backgroundImageUrl;
//----------------------------------------------------------------------------

          dynamicToolBar.Tools.Add(custom1)
}

I need to set an image icon for this button.  I know how to do it in the page (using ,reTool .btnAdd { background-image:url(...);).
However, I need to do this dynamically and I don't know the name of the button until it is created.  Is there a way to set the icon in code-behind?

Thanks
Raka


Raka
Top achievements
Rank 1
 answered on 05 Nov 2012
4 answers
228 views
This new control looks great, but I have a question about a combo chart.  I have a chart now that has a column for the data and an line chart for average all on the same chart.  Would this be possible with this control?
Marin Bratanov
Telerik team
 answered on 05 Nov 2012
1 answer
81 views
Hi everyone i hope this is the right forum for my question.

i have a radalert, when is closed i want to do some math in server side, so i did this

on server side

RadWindowManager1.RadAlert(Resources.Mensajes.exitoReseteando, 300, 150, Resources.Mensajes.tituloMensajeExito, "alertCallBackFn", "../Styles/Images/ok.png");



function on asp page

<script language="javascript" type="text/javascript">
 
                                function alertCallBackFn(arg) {
                                    __doPostBack("<%= btnEnviarLogin.UniqueID %>", "");
                                }
                            </script>


when the rad alert is closed with the mouse or with the enter key, it does great the job, the function is executed, but when is closed with the esc key, it doesn't do anything

can you help me ponting me which one is the event i have to catch

thanks in advance
Marin Bratanov
Telerik team
 answered on 05 Nov 2012
3 answers
126 views
I tried to submit this as a support ticket but it timed out so am posting here
----------------------------------------------------------------------------------------------------------

I can add validators to built in columns with no problem using the following code:

    protected void rgData_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;

            if (e.Item.OwnerTableView.DataMember == "Download")
            {
                GridTemplateColumnEditor edFile = (GridTemplateColumnEditor)item.EditManager.GetColumnEditor("DocumentFile");
                GridTextBoxColumnEditor edDescription = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("Description");

                edDescription.TextBoxControl.ID = "txtDescription";
                edDescription.TextBoxControl.Width = Unit.Pixel(350);

However this does not seem to work with template columns. One of my template columns contains a FileUpload control. Above you can see where I try and reference it (edFile). But when I try to access the control using

((FileUpload)edFile.FindControl("fuFile")).Width = Unit.Pixel(350);
or
((FileUpload)edFile.Controls[0]).Width = Unit.Pixel(350);

I get a null reference. I was hoping I could keep all this code in the same place (ItemCreated). But do template columns need to be handled differently? Thanks.
Maria Ilieva
Telerik team
 answered on 05 Nov 2012
1 answer
57 views

Hi Telerik,

is there a way to keep the insert form opened even after performing insertion.

Thanks

Shinu
Top achievements
Rank 2
 answered on 05 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?