Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
142 views
Hi,

The Telerik's grid is incorporated in our user control (derived from UserControl). I had a requirement to allow context menu to show up on grid's row and we use RadContextMenu in conjunction with ContextMenuControlTarget. Actually, I have to use ContextMenuControlTarget. I have a simple test project where everything works fine with RadContextMenu only. But, in our main complex project I have to use ContextMenuControlTarget to show grid's context menu. If I don't use it the context menu doesn't appear. I don't know why.

So, I'm not sure when to use RadContextMenu only and when with ContextMenuControlTarget.

There's another issue. When I use ContextMenuControlTarget the context menu appears not only when I select grid's row but in header as well. We don't need the context menu to appear in header.

Here's the code I use:

public class GridContextMenu : RadContextMenu
{
    ...
}

protected override void OnInit(EventArgs e)
{
  base.OnInit(e);

  var contextMenu =
new Parus.Controls.GridContextMenu();

  var target =
new ContextMenuControlTarget();
  target.ControlID = this.GridControl.ID;

  contextMenu.ID =
this.GridControl.ID + "_RadMenu";

  CreateContextItems(contextMenu.Items,
this.Frame.ViewFrameData.ActionItems);

  contextMenu.LinkedControlClientId = ServerRequest.ClientID;
  contextMenu.OnClientItemClicked = "GridContextMenu_ActionsHandler";

  contextMenu.Targets.Add(target);

  this
.PostbackPanel.ContentTemplateContainer.Controls.Add(contextMenu);

  ...
}

My question is - how can I get rid of ContextMenuControlTarget or if it's not possible how to disallow it to appear in grid's header?
Goran
Top achievements
Rank 1
 answered on 14 Jan 2013
11 answers
215 views
We have a RadTabStrip that uses NavigateUrl on the tabs. With Q2, it worked fine on desktop browsers and on the iPad/iPhone. Now that we have upgraded to Q3, touching the tabs on the iPad/iPhone no longer works. It does not navigate to the URL. We reverted to Q2, and it works again.

Oddly enough, while we were debuggiing with Q3, if we put something in the OnClientTabSelected event, such as

OnClientTabSelected = "alert('blah');"

, then the click event started working on the iPad/iPhone again. Of course, it throws a JavaScript error in IE8, so it's not a viable workaround.
Entegral
Top achievements
Rank 1
 answered on 13 Jan 2013
0 answers
97 views
can any one write a sample code for me, raking tool implement with cookie 
Michael
Top achievements
Rank 1
 asked on 13 Jan 2013
5 answers
171 views
I have a frameset page containing 2 frames. Within each frame is a page containing a RadGrid. Is there a way to drag / drop items from one grid to another ACROSS frames? I can already drag / drop within a page between 2 grids without any issues. But I need to be able to do it across the frames. Any help is appreciated.

Sara
Mark Sandford
Top achievements
Rank 1
 answered on 12 Jan 2013
2 answers
181 views
How to hide select button in radasyncupload? 
Ehsan
Top achievements
Rank 1
 answered on 12 Jan 2013
2 answers
96 views
Hi,

sorry to create another Load On Demand post but it seems I cant find my issue in the previous ones Ive searched in. In my case, when trying to implement Load On Demand on my RadTabStrip, Ive noticed a weird behavior in the code.

When clicking on the tabs in the order they are presented and I skip one, then when I click on that skipped tab, its RadMultiPage's PageViewCreated dont get called. By looking at the tab's OnClientTabSelecting client-side function, it seems the tab already has a pageview assigned and it's id is the same then the tab we click when doing the skipping.

Here's the code to replicate the problem with 4 tabs:
<%@ Page Language="C#" AutoEventWireup="True" Inherits="PL.Test" Codebehind="Test.aspx.cs" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
 
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function onTabSelecting(sender, args) {
 
                if (args.get_tab().get_pageView()) {
                    if (args.get_tab().get_pageView().get_id()) {
                        alert("pageview of ID: " + args.get_tab().get_pageView().get_id() + " already loaded");
                        args.get_tab().set_postBack(false);
                    }
                }
            }
                    
        </script>
    </telerik:RadCodeBlock>
 
    <form id="form1" runat="server">
 
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
 
 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                  <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1">
                                </telerik:AjaxUpdatedControl>
                                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1">
                                </telerik:AjaxUpdatedControl>
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1">
                                </telerik:AjaxUpdatedControl>
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                         <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" LoadingPanelID="RadAjaxLoadingPanel1">
                                </telerik:AjaxUpdatedControl>
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue" />
              
 
                    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" AutoPostBack="false" Skin="WebBlue" EnableDragToReorder="true"  MultiPageID="RadMultiPage1" Orientation="HorizontalTop"
                    SelectedIndex="0" OnTabClick="RadTabStrip1_TabClick" OnClientTabSelecting="onTabSelecting" >
                    </telerik:RadTabStrip>
 
                     
 
                    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated">
                    </telerik:RadMultiPage>
           
 
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace PL
{
    public partial class Test : System.Web.UI.Page
    {
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
            if (!IsPostBack)
            {
                CreateTabs();
            }
 
        }
 
 
        private void CreateTabs()
        {
            AddNewTab(1);
            AddNewTab(2);
            AddNewTab(3);
            AddNewTab(4);
 
            RadTabStrip1.DataBind();
        }
 
        
        private void AddNewTab(int intTabIndex)
        {
            RadTab rootTab = null;
            RadPageView pv = null;
 
            rootTab = new RadTab();
            RadTabStrip1.Tabs.Add(rootTab);
 
 
            rootTab.Text = "Tab" + " " + intTabIndex.ToString();
            rootTab.Value = "Tab_" + intTabIndex.ToString();
 
 
            if (intTabIndex == 1)
            {
                pv = new RadPageView();
                pv.ID = rootTab.Value;
                RadMultiPage1.PageViews.Add(pv);
 
 
                RadTabStrip1.Tabs[RadTabStrip1.Tabs.Count - 1].Selected = true;
                RadMultiPage1.PageViews[RadMultiPage1.PageViews.Count - 1].Selected = true;
 
                 
            }
 
            
 
        }
 
        protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
        {
            Console.WriteLine(e.PageView.ID);
        }
 
        
 
        protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            AddPageView(e.Tab);
            e.Tab.PageView.Selected = true;
        }
 
        private void AddPageView(RadTab tab)
        {
            RadPageView pv = new RadPageView();
            pv.ID = tab.Value;
            RadMultiPage1.PageViews.Add(pv);
            tab.PageViewID = pv.ID;
 
        }
 
 
         
    }
}

Page will start and create Tab 1. If you click on Tab 3 then Tab 2, you'll notice that Tab 2 pageview ID is already known and that "RadMultiPage1_PageViewCreated" doesnt get called. Same if you refresh and click Tab 2, then Tab 4 and then Tab 3. If you go 2, 3 and 4, all is fine. Is something wrong in my code?

TIA

Martin

Martin Roussel
Top achievements
Rank 1
 answered on 11 Jan 2013
1 answer
85 views
Hi,

We have requirement to display the RadChart control with plotarea only in one of the column of a Radgrid control. when implemented this requirement,  we found that displays the empty space of chartarea, plot area. so the radchart control is not adapted to the column of a grid.
When tried to remove this empty space, (as mentioned in one of the forum, AutoLayout property set to false) it removes only the empty space of plot area. but it does not remove the empty space of chartarea (like title, xaxis, yaxis, legend) even if those visibility is set to false.

please assist to achieve this.

Regards,
Meenakshi


MightyQuinn
Top achievements
Rank 1
 answered on 11 Jan 2013
4 answers
341 views
Hello,

I have the following code:
 function OnClientSelectedIndexChanging(sender, eventArgs) 
     { 
      
       var vItem = eventArgs.get_item(); 
        
       if (vItem.get_value() == "..."
       { 
            alert('bad value'); 
            return false//cancel post back. 
       } 
        
     } 

I get the alert box, but what do i need to do to cancel the post back?

TIA
Aarsh
Top achievements
Rank 1
 answered on 11 Jan 2013
0 answers
85 views
how to create the forum reply box using asp.net c#
Michael
Top achievements
Rank 1
 asked on 11 Jan 2013
3 answers
156 views
I have been trying to use a date range filter for a RadGrid with manual filter in code behind.  I understand that it is a string expression, however no matter what I try it keeps getting an error that it is not a valid boolean expression.  Here is the aspx and code behind.  What am I missing? Thanks in advance.
<telerik:RadGrid ID="TimeGrid" AllowPaging="true" DataSourceID="DetailSource" runat="server" GridLines="None" AllowSorting="false" EnableLinqExpressions="false">
               <MasterTableView>
                    <Columns>
                        <telerik:GridBoundColumn DataField="WorkDate" HeaderText="Date" UniqueName="WDate" DataFormatString="{0:MM/dd/yy}" ItemStyle-Width="75px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Shift" HeaderText="Shift" ItemStyle-Width="25px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Reg" HeaderText="Reg" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ShftHrs" HeaderText="ShftHrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OT" HeaderText="OT" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Vac40" HeaderText="Vac 40 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Vac48" HeaderText="Vac 48 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Vac36" HeaderText="Vac 36 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sick40" HeaderText="Sick 40 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sick48" HeaderText="Sick 48 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sick36" HeaderText="Sick 36 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Exc_Absence" HeaderText="Exc Abs Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Holiday_Worked" HeaderText="Holiday Worked" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Holiday_Not_Worked" HeaderText="Holiday Not Worked" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Comments" HeaderText="Comment" ItemStyle-Width="135px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Additional_Comment" HeaderText="Additional Comment" ItemStyle-Width="135px"></telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="Five" HeaderText="5%"></telerik:GridCheckBoxColumn>
                        <telerik:GridCheckBoxColumn DataField="Ten" HeaderText="10%"></telerik:GridCheckBoxColumn>
                    </Columns>
               </MasterTableView>
            </telerik:RadGrid>
**Server side
Partial Class Administration_TimesheetUserControl2
    Inherits System.Web.UI.UserControl
 
    Protected Sub PayDatesDDL_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles PayDatesDDL.SelectedIndexChanged
        Dim strFilterExpression As String
        strFilterExpression = "(([WORKDATE] >= '" + e.Value + "') AND ([WORKDATE] <= '" + Calc_PP_EndDate(e.Value) + "'))"
        TimeGrid.MasterTableView.FilterExpression = strFilterExpression
        TimeGrid.MasterTableView.Rebind()
    End Sub
    Public Shared Function Calc_PP_EndDate(ByVal strBeginDate As String) As String
        Dim dtmEndDate As Date
        Dim dtBeginDate As Date = Date.Parse(strBeginDate)
        Dim strEndDate As String
 
        If Day(dtBeginDate) = 1 Then
            dtmEndDate = DateSerial(Year(dtBeginDate), Month(dtBeginDate), 15)
        Else
            dtmEndDate = DateSerial(Year(dtBeginDate), Month(dtBeginDate) + 1, 1 - 1)
        End If
 
        strEndDate = CType(dtmEndDate, String)
        Return (strEndDate)
    End Function
End Class

Elliott
Top achievements
Rank 2
 answered on 11 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?