Telerik Forums
UI for ASP.NET AJAX Forum
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
207 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
480 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
73 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
131 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
94 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
163 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
4 answers
162 views
Hello,
I have created a RadGrid that uses KeyboardNavigation for making changes.  Two of my columns are dates and use RadDatePickers for inline editing.  My third column is just a Notes column (text box).
When I hit [Enter]  to put a row into Edit Mode, move to the Notes text box and hit [Enter] I can save the row, or if I hit [Escape] I can cancel the edit.

If, however, my focus is on one of the two RadDatePickers and I hit [Enter] or [Escape] I get the following error:

Text property cannot be set. String was not recognized as a valid DateTime. 
[InvalidCastException: Text property cannot be set. String was not recognized as a valid DateTime.]
   Telerik.Web.UI.RadDateInput.RangeTextProperty(String value) +265
   Telerik.Web.UI.RadDateInput.set_Text(String value) +47
   Telerik.Web.UI.DatePickingInput.LoadPostData(String postDataKey, NameValueCollection postCollection) +750
   Telerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +42
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +327
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +878


<telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="true" AutoGenerateColumns="False"
            PageSize="15" AllowSorting="True" AllowMultiRowSelection="true" AllowPaging="True"
            AutoGenerateEditColumn="true" GridLines="None" Width="50%" Skin="Hay">
            <PagerStyle Mode="NumericPages" />
            <MasterTableView DataKeyNames="RecordID" AllowMultiColumnSorting="True" Width="100%"
                CommandItemDisplay="Top" Name="Customers" EditMode="InPlace">
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="Name" FieldName="Name" />
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="Name" SortOrder="Ascending" />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name" ReadOnly="true"
                        Visible="false" />
                    <telerik:GridDateTimeColumn UniqueName="StartDate" DataField="StartDate" HeaderText="Start Date"
                        ColumnEditorID="editorStartDate" DataFormatString="{0:M/d/yyyy}" />
                    <telerik:GridDateTimeColumn UniqueName="EndDate" DataField="EndDate" HeaderText="End Date"
                        ColumnEditorID="editorEndDate" DataFormatString="{0:M/d/yyyy}" />
                    <telerik:GridBoundColumn UniqueName="Notes" DataField="Notes" HeaderText="Notes"
                        ColumnEditorID="editorNotes" />
                </Columns>
            </MasterTableView>
            <ClientSettings AllowKeyboardNavigation="true">
                <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated"
                    OnCommand="GridCommand" />
                <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowSubmitOnEnter="true"
                    AllowActiveRowCycle="true" CollapseDetailTableKey="LeftArrow" ExpandDetailTableKey="RightArrow" />
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:GridDateTimeColumnEditor ID="editorStartDate" runat="server" />
        <telerik:GridDateTimeColumnEditor ID="editorEndDate" runat="server" />
        <telerik:GridTextBoxColumnEditor ID="editorNotes" runat="server" />

Has anyone else seen this one?

Thanks,
-Aaron
Vasil
Telerik team
 answered on 05 Oct 2012
1 answer
103 views
HOw can I increment the fontsize of the filter textbox?

I tried to use the filteritem font-size option but it doesnt work. I need to have a bigger font.

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 05 Oct 2012
1 answer
102 views
Hi,
how to use date picker to only pick for year and show only the year.

By
Anzar.M
Princy
Top achievements
Rank 2
 answered on 05 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?