Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
97 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
105 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
227 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
247 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
85 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
134 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
61 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
1 answer
181 views

Hi all,

Please provide a way to add underline to all Column header in my RadGrid.I have more than 10 columns.

Thanks

Shinu
Top achievements
Rank 2
 answered on 05 Nov 2012
1 answer
119 views

Hi,

My RadGrid has a linkButton in the GridTemplateColumn. I would like to highlight a the row when the LinkButton is Clicked. Please provide a answer soon.

Shinu
Top achievements
Rank 2
 answered on 05 Nov 2012
1 answer
93 views
hii,
how can i bind radgrid based on the selected radtree node ?
thanks
Princy
Top achievements
Rank 2
 answered on 05 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?