Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views

I recently found the following example on your site demonstrating the handling of the grid RowContextMenu event and showing the menu. http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandmenu/defaultcs.aspx?product=grid

This example included the RowContextMenu handler:

function GridRowContextMenuHandler(sender, eventArgs) {
             
            var menu = $find("<%= menuId.ClientId %>");
             
            var evt = eventArgs.get_domEvent();
 
            if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                return;
            }
 
            var rowIndex = eventArgs.get_itemIndexHierarchical();
            menu.show(evt);
 
            evt.cancelBubble = true;
                evt.returnValue = false;
 
                if (evt.stopPropagation) {
                    evt.stopPropagation();
                    evt.preventDefault();
                }
 
             
        }


I have some code which I have been using since way back in the Prometheus days and I'm trying to figure out if it is equivalent to what you show in your example. It seems this code is more concise. Is there any benefit or drawback to using what I have here?

function GridRowContextMenuHandler(sender, eventArgs) {
var menu = $find("<%= menuId.ClientId %>");
if ((!eventArgs.relatedTarget) || (!Telerik.Web.DomUtility.isDescendantOrSelf(menu.get_element(), eventArgs.relatedTarget))) {
menu.show(eventArgs)
}
$telerik.cancelRawEvent(eventArgs);
}


Antonio Stoilkov
Telerik team
 answered on 05 Oct 2012
1 answer
99 views
Hi,
I have a complicated page with about 12 raddocks that are dynamically generated.They load user controls which have radgrids inside. One of the docks has a rad grid with paging. When you click to go to another page it posts back but nothing happens. Some of the rad grids have a command to InitInsert which doesn't fire either. I've tested the radgrids separately and paging and adding works on a test page outside of the rad dock layout.

It is very difficult to create a sample project to demo this because they are generated from the database.

Anyone have any idea what could be causing this?



Karl
Top achievements
Rank 1
 answered on 05 Oct 2012
3 answers
63 views
Hello!

I have a proyect where I have several pages using RadControls, some have more controls than others and different controls from one page to another, but there is something in common each time I reach PostBack 20 the page throws an error, telling me that the arguments array passed to Function.prototype.apply is too large. Why is this happening and is there any way to overcome it?

I´ll Appreciate any kind of help on this.
Vasil
Telerik team
 answered on 05 Oct 2012
1 answer
53 views
I was looking at one of the demos - Web mail grid in the below url http://demos.telerik.com/aspnet-ajax/grid/examples/programming/webmailgrid/defaultcs.aspx

I wanted to implement the Search similar to the one provided in this demo using filter expression. In this demo, the enter key press functionality of txtSearch doesn't seem to work. The image btnSearch click works as expected. Appreciate if you can provide your inputs on this.
Jayesh Goyani
Top achievements
Rank 2
 answered on 05 Oct 2012
3 answers
210 views
I updated from Version:

 2012.1.411
to
 2012.2 912

I used the msi file: Telerik.Web.UI_2012_2_912_Dev.msi


The error is:
==============================================================================
Microsoft Visual Studio
x
Error executing custom action Telerik.Web.UI.VSX.Actions.MultiprojectUpdateReferencesAction: Error deleting file 'Telerik.Web.UI.dll'. Unable to delete 'Bin/Telerik.Web.UI.dll'. Access is denied.
==============================================================================
Regards,
Petar
Telerik team
 answered on 05 Oct 2012
3 answers
483 views
Hi,

I am trying to set the color of each cell in the grid based on the value of the label contained inside of the item template.

Here is my grid markup:
  <telerik:RadGrid ID="rgSchedule" runat="server" AutoGenerateColumns="False"
        CellSpacing="0" DataSourceID="sqlWebinarSchedule" GridLines="None" OnItemDataBound ="rgSchedule_ItemDataBound" >
<MasterTableView DataSourceID="sqlWebinarSchedule">
<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="WeekRange"
            FilterControlAltText="Filter WeekRange column" ReadOnly="True"
            SortExpression="WeekRange" UniqueName="WeekRange">
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn DataField="MondayDay" DataType="System.Int32"
            FilterControlAltText="Filter MondayDay column" HeaderText="Monday"
            SortExpression="MondayDay" UniqueName="Monday">
             <ItemTemplate>
                <asp:Label ID="MondayDayLabel" runat="server" Text='<%# Eval("MondayDay") %>'></asp:Label>
                <asp:Label ID="MondayColor" runat="server" Text='<%# Eval("Monday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="TuesdayDay" DataType="System.Int32"
            FilterControlAltText="Filter TuesdayDay column" HeaderText="Tuesday"
            SortExpression="TuesdayDay" UniqueName="Tuesday">
            <ItemTemplate>
                <asp:Label ID="TuesdayDayLabel" runat="server" Text='<%# Eval("TuesdayDay") %>'></asp:Label>
                 <asp:Label ID="TuesdayColor" runat="server" Text='<%# Eval("Tuesday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="WednesdayDay" DataType="System.Int32"
            FilterControlAltText="Filter WednesdayDay column" HeaderText="Wednesday"
            SortExpression="WednesdayDay" UniqueName="Wednesday">
             <ItemTemplate>
                <asp:Label ID="WednesdayDayLabel" runat="server" Text='<%# Eval("WednesdayDay") %>'></asp:Label>
                <asp:Label ID="WednesdayColor" runat="server" Text='<%# Eval("Wednesday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="ThursdayDay" DataType="System.Int32"
            FilterControlAltText="Filter ThursdayDay column" HeaderText="Thursday"
            SortExpression="ThursdayDay" UniqueName="Thursday">
           <ItemTemplate>
                <asp:Label ID="ThursdayDayLabel" runat="server"  Text='<%# Eval("ThursdayDay") %>'></asp:Label>
                 <asp:Label ID="ThursdayColor" runat="server"  Text='<%# Eval("Thursday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="FridayDay" DataType="System.Int32"
            FilterControlAltText="Filter FridayDay column" HeaderText="Friday"
            SortExpression="FridayDay" UniqueName="Friday">
            <ItemTemplate>
                <asp:Label ID="FridayDayLabel" runat="server" Text='<%# Eval("FridayDay") %>'></asp:Label>
                <asp:Label ID="FridayColor" runat="server" Text='<%# Eval("Friday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="SaturdayDay" DataType="System.Int32"
            FilterControlAltText="Filter SaturdayDay column" HeaderText="Saturday"
            SortExpression="SaturdayDay" UniqueName="Saturday">
            <ItemTemplate>
                <asp:Label ID="SaturdayDayLabel" runat="server" Text='<%# Eval("SaturdayDay") %>'></asp:Label>
                <asp:Label ID="SaturdayColor" runat="server" Text='<%# Eval("Saturday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="SundayDay" DataType="System.Int32"
            FilterControlAltText="Filter SundayDay column" HeaderText="Sunday"
            SortExpression="SundayDay" UniqueName="Sunday">
            <ItemTemplate>
                <asp:Label ID="SundayDayLabel" runat="server" Text='<%# Eval("SundayDay") %>'></asp:Label>
                <asp:Label ID="SundayColor" runat="server" Text='<%# Eval("Sunday") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
    </Columns>
    <GroupByExpressions>
        <telerik:GridGroupByExpression>
            <SelectFields>
                <telerik:GridGroupByField FieldAlias="MonthYear" FieldName="MonthYear"
                    FormatString="" HeaderText="Month" />
            </SelectFields>
            <GroupByFields>
                <telerik:GridGroupByField FieldAlias="MonthStart" FieldName="MonthStart"
                    FormatString="" HeaderText="" />
            </GroupByFields>
        </telerik:GridGroupByExpression>
    </GroupByExpressions>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>

In the code behind I am trying to do the following, though not much luck finding the right control:

protected void rgSchedule_ItemDataBound(object sender, GridItemEventArgs e)
       {
 
           if (e.Item is GridDataItem)
           {
               GridDataItem item = e.Item as GridDataItem;
               foreach (Control ctrl in item.Controls)
               {
                   if (ctrl is Label)
                   {
                       Label lbl = (Label)ctrl;
                       switch (lbl.Text)
                       {
                           case "Red":
                               item.BackColor = System.Drawing.Color.Red;
                               break;
                           case "White":
                               item.BackColor = System.Drawing.Color.White;
                               break;
                           case "Green":
                               item.BackColor = System.Drawing.Color.Green;
                               break;
                      }
                       rgSchedule.Rebind();
                   }
               }
           }
       }
Shinu
Top achievements
Rank 2
 answered on 05 Oct 2012
2 answers
74 views
Hi,

I would like to ask you if there is possible to create column in Grid where I would have several own controls.

In that column there will be 4 small icons, which will have changed visibility according to certain data in given row. Is there any example, how I can make it ?

And I also have one question regarding to checkbox... I need to have checkbox in the column but it won't be bounded to some data. It will be only checkbox which also will be displayed according to data in the row. Because for some rows I will need to hide it. Which column I should use for this one ?

In the attachement there is a screenshot of gridview I would like to achieve with RadGrid.

Sorry for bothering, but I  tried to search the pages for the answer before posting it here... I am really lost...

Thanks for any help
Peter
Top achievements
Rank 1
 answered on 05 Oct 2012
4 answers
133 views
I have an issue where asyncupload simply resets or stops during large uploads.

I have a test harness here.

I have successfully uploaded a 18MB file but nothing over this.  The execution timeout is 3600 and the maxRequestLength is large.

http://regrowth2010.c6.ixwebhosting.com/

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
     <style type="text/css">
    div.RadUpload .ruFakeInput
    {
        visibility: hidden;
        width: 0;
        padding: 0;
    }
    div.RadUpload .ruFileInput
    {
        width: 1;
    }
     </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        var Nbre = 0;
        function getRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        function CloseWindow() {
            var wnd = getRadWindow();
            var openerPage = wnd.BrowserWindow;
            openerPage.Importer_Callback();
            wnd.close();
        }
        function validateRadUpload1(source, arguments) {
            arguments.IsValid = $find('RadUpload1').validateExtensions();
        }
  
        function validateFailed(source, arguments) {
  
        }
  
        function fileSelected(source, arguments){
  
        }
  
        function fileUploaded(sender, args) {
            document.forms[0].btnSubmit.style.display= 'inline';
        
  
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
   
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Vista">
    </telerik:RadSkinManager>
          
    <telerik:RadProgressManager runat="server" ID="RadProgressManager1" /> 
        <div>
          <table>
            <tr>
                <td>Firstname:</td>
                <td>
                    <asp:TextBox ID="tbFirstName" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>Surname:</td>
                <td>
                    <asp:TextBox ID="tbSurname" runat="server"></asp:TextBox></td>
            </tr>  
            <tr>
                <td>Act/DJ Name:</td>
                <td>
                    <asp:TextBox ID="tbActName" runat="server"></asp:TextBox></td>
            </tr>          
          </table>
            
          <telerik:RadAsyncUpload runat="server" Localization-Select="Upload" ID="AsyncUpload1" MaxFileSize="300000000" OnClientFileUploaded="fileUploaded" ReadOnlyFileInputs="true" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" OnClientFileSelected="fileSelected" OnClientValidationFailed="validateFailed" /> 
            
        </div>
        <div><telerik:RadProgressArea runat="server" ID="RadProgressArea1" ProgressIndicators="TotalProgressBar,TotalProgressPercent,RequestSize,TimeElapsed,TimeEstimated,CurrentFileName,TotalProgress"  /></div
              
        <asp:Button ID="btnSubmit" runat="server" Text="Submit Demo" style="display:none" OnClick="buttonSubmit_Click"/>
    </form>
</body>
</html>
Kate
Telerik team
 answered on 05 Oct 2012
4 answers
95 views
In looking at the RadWindow examples (the Restriction Zone example best fits my scenario) If you follow the steps below:

1. Maximize a window
2. Minimize the same window
3. Restore the window

In the operating system if you do this the window is restored to a maximized state.  however, the radwindow restores to a non-maximized state.  Is there a way to allow the radwindow to behave closer to the OS? (restoring the window to its last know state)

Thanks....
Francois MARTIN
Top achievements
Rank 2
 answered on 05 Oct 2012
1 answer
167 views
I have a problem with webservice binding of RadScheduler on an ASP.NET forms application.  I need to be able to access Session state from my webservice code, and sometimes it works and sometimes it doesn't.

Specifically the client event OnClientResourcesPopulating does not maintain session state - I presume because it's not passing the current session state cookie to the webservice call.

I have set up a sample project showing the problem, which I set up using the example here: http://www.telerik.com/help/aspnet-ajax/scheduler-webservicebinding.html

The key parts are that in my Default.aspx I set a session variable like this:

namespace RSWSTest

{

    public partial class Default : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

            if (!Page.IsPostBack)

            {

                Session["TestSessionValue"] = "MyTestValue";

            }

        }

    }

}


The page has a RadScheduler on it, configured to call a webservice.  Here's a snippet from the webservice code:

        [WebMethod(EnableSession=true)]

        public IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo)

        {

            object v = Session["TestSessionValue"]; //-- THIS RETURNS NULL

            Session["WS_GetResourcesCalled"] = true; //-- THIS WORKS BUT NOT VISIBLE IN SUBSEQUENT CALLS

            return Controller.GetResources(schedulerInfo);

        }

        

        [WebMethod(EnableSession=true)]

        public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)

        {

            object v = Session["TestSessionValue"]; //-- THIS RETURNS "MyTestValue"

            Session["WS_GetAppointmentsCalled"] = true;

            return Controller.GetAppointments(schedulerInfo);

        }


As you can see from my comments - it appears that the GetResources function starts a new session every time it is called, whilst the GetAppointments function seems to work as expected.

I need to find a solution to this as I have session-based user security and I want to return different things based on which user is stored in the current session.

I can't attach my test solution because it'll only let me post image files - but I can email it to someone if it would help - it's only 19k zipped!


Plamen
Telerik team
 answered on 05 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?