Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
833 views
Hello,

I'm trying to catch this error. If you put a end datetime in that is before the start datetime my application is falling over. Obviously, I am doing this deliberately to break it, but want to catch the error in case a hapless user tries to do the same for some bizarre reason.

I insert my appointments via a custom Insert template using the Scheduler_AppointmentCommand event. I can catch the input here with:

try 
                            { 
                                if (eventEnd >= eventStart) 
                                { 
                                    UserEventHelper.ArrangeAppraisal(doctor, eventStart, location, label, eventEnd, user.ID); 
                                    litStatus.Text = string.Empty; 
                                } 
                                else 
                                { 

So, I am not creating an appointment in my business object if the end datetime occurs before the start datetime, but an error is still thrown from the control. Where do I catch this error? Here is the stack trace if that helps:

[Exception: Appointment is invalid: Start time must be before the End time.]
Telerik.Web.UI.Appointment.Validate() +162
Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointmentThroughProvider(Appointment appointment) +17
Telerik.Web.UI.RadScheduler.InsertAppointmentInline() +106
Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +326
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +111
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +176
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Peter Milchev
Telerik team
 answered on 31 Aug 2018
1 answer
73 views

Hi,

I'd like to know if there is an option to apply mixed font color in the same event in the scheduler.

For example, if the event states: "Meeting with DR. Monroe"

have "Meeting with" colored in blue and "Dr. Monroe" in red.

Thanks!

Peter Milchev
Telerik team
 answered on 31 Aug 2018
3 answers
180 views

Dear Guru's,

New here and I've been trying to implement the radcombobox to replace a lot of my current listboxes. That all seemed to go quite well, but I ran into an issue that I can't seem to solve with either documentation, google or this forum. 

Our webapplication is used in multiple large companies and it should work under any browser the client chooses to use. I found out that the vertical alignment of the text in IE is lower than in, for example Google Chrome. I can't seem to figure out how to resolve this.

Please see that attached image for an example. It's the exact same page, left is IE, right is Chrome. I used the "j" because you can clearly see the difference at the bottom.

Thank you for your time!

Best regards,

-Rem

Rumen
Telerik team
 answered on 31 Aug 2018
4 answers
102 views

Hi,

I want to be able to open the RadGrid headercontextmenu on left click instead of right. Currently when I left click, it just changes the sorting, but the sorting can already be accomplished in the context menu. This is the same issue as this thread: https://www.telerik.com/forums/how-to-show-the-radgrid-context-menu-on-left-click-instead-of-right-click but that was a while ago and currently when I implement, the context menu flashes but then disappears. Is there anyway to achieve the appropriate functionality? Here is my code that implements it: 

 

<script type="text/javascript">
     function OnColumnClick(sender, args){                 
        args.get_gridColumn().showHeaderMenu(args.domEvent);
     }
</script>

 

In the RadGrid …

 

<ClientEvents OnColumnClick="OnColumnClick" />

Ryan
Top achievements
Rank 1
 answered on 30 Aug 2018
1 answer
123 views

I'm currently updating a chart from asp.net chart to telerik htmlchart.

I have a line series chart and for one of the series I would like to add a +/- range at each marker to replicate an ErrorBar series from traditional .net chart control.

If I set the + and - line series as having Fillstyle.BackgroundColor as transparent (hide the line) and set the MarkersAppearance.BackgroundColor to black, I was hoping that the marker appearance would overwrite the series color and display only the marker. however this is not working as the fillstyle appears to be the master. 

 

Is there any way of showing only the marker or will I have to re-write and go with a scatter and scatterline chart? Is there any equivalent to the ErrorBar type?

 

Thanks in advance.

 

 

 

 

Richy
Top achievements
Rank 1
 answered on 30 Aug 2018
3 answers
157 views
I have a rad editor on my page. The user selects a code from the drop down list and then hits edits and it pulls all the values into the page from the database. After so many times of clicking edit and changing the values I receiving an error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500


How can I fix this?
I've tried this so far in the page directive.
ValidateRequest="false" 
Rumen
Telerik team
 answered on 30 Aug 2018
1 answer
188 views

Hi,

I am trying to read the value of the radtext box. It comes out empty.

Anything wrong with this code?

var addr1Text, addr2Text;
var Addr1 = $find("<%= txtAddr1.ClientID %>");
addr1Text = Addr1.get_value();
alert("Addr1Text: " +  addr1Text );
 
 <telerik:RadTextBox ID="txtAddr1" runat="server" OnTextChanged="txtAddr1_TextChanged" AutoPostBack="false">
                </telerik:RadTextBox>

 

Rumen
Telerik team
 answered on 30 Aug 2018
10 answers
1.1K+ views
Hi,

For the last few weeks I have been trying to populate the datasource of a raddropdownlist inside a radgridcolumn -but without success.  I have looked at various examples online and in the help files -but none of them seem to work for me. 

I thought that maybe one of you knew why I can't get my code to populate the dropdownlist.


The problem seems to be that (e.Item is GridEditableItem && e.Item.IsEditMode) is never true in my grid and therefore never evaluates the code inside the if statement that would bind the dropdownlist... Thanks in advance. YMA

Here is an example of the grid and the dropdownlist (CategoryIDDropDown) that I can't populate :

private void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem item = e.Item as GridEditableItem;
        // access/modify the edit item template settings here
        DropDownList list = item.FindControl("CategoryIDDropDown") as DropDownList;
        list.DataSource = mydatasource;
        list.DataBind();

{

{



<telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"

            AllowAutomaticInserts="True" PageSize="10" Skin="Default" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"

            OnItemUpdated="RadGrid1_ItemUpdated" AllowAutomaticUpdates="True" AllowPaging="True"

            AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand" DataSourceID="SqlDataSource1" Height="500px" OnItemCommand="RadGrid1_ItemCommand" Visible="True">

            <ExportSettings>

                <Pdf>

                    <PageHeader>

                        <LeftCell Text="" />

                        <MiddleCell Text="" />

                        <RightCell Text="" />

                    </PageHeader>

                    <PageFooter>

                        <LeftCell Text="" />

                        <MiddleCell Text="" />

                        <RightCell Text="" />

                    </PageFooter>

                </Pdf>

            </ExportSettings>

            <MasterTableView AutoGenerateColumns="False" BatchEditingSettings-EditType="Row" CommandItemDisplay="Bottom" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" EditMode="Batch" HorizontalAlign="NotSet">

                <EditFormSettings>

                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">

                    </EditColumn>

                </EditFormSettings>

                <BatchEditingSettings EditType="Cell" />

                <SortExpressions>

                    <telerik:GridSortExpression FieldName="ProductID" SortOrder="Descending" />

                </SortExpressions>

                <CommandItemSettings ExportToPdfText="Export to PDF" />

                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">

                </RowIndicatorColumn>

                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">

                </ExpandCollapseColumn>

                <Columns>

                    <telerik:GridBoundColumn DataField="ProductName" HeaderStyle-Width="210px" HeaderText="ProductName" SortExpression="ProductName" UniqueName="ProductName">

                        <ColumnValidationSettings EnableRequiredFieldValidation="true">

                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">

                            </RequiredFieldValidator>

                            <ModelErrorMessage Text="" />

                        </ColumnValidationSettings>

                        <HeaderStyle Width="210px" />

                    </telerik:GridBoundColumn>

                    <telerik:GridTemplateColumn DataField="CategoryID" HeaderStyle-Width="180px" HeaderText="Category" UniqueName="CategoryID">

                        <ItemTemplate>

                            <%# Eval("CategoryName") %>

                        </ItemTemplate>

                        <EditItemTemplate>

                            <telerik:RadDropDownList ID="CategoryIDDropDown" runat="server" DataTextField="CategoryName" DataValueField="CategoryID">

                            </telerik:RadDropDownList>

                        </EditItemTemplate>

                        <HeaderStyle Width="180px" />

                    </telerik:GridTemplateColumn>

                    <telerik:GridNumericColumn ColumnEditorID="NumericEditor1" DataField="UnitsInStock" HeaderStyle-Width="80px" HeaderText="Units In Stock" SortExpression="UnitsInStock" UniqueName="UnitsInStock">

                        <ColumnValidationSettings>

                            <ModelErrorMessage Text="" />

                        </ColumnValidationSettings>

                        <HeaderStyle Width="80px" />

                    </telerik:GridNumericColumn>

                    <telerik:GridBoundColumn ColumnEditorID="TextEditor" DataField="QuantityPerUnit" HeaderStyle-Width="135px" HeaderText="Quantity Per Unit" SortExpression="QuantityPerUnit" UniqueName="QuantityPerUnit">

                        <ColumnValidationSettings>

                            <ModelErrorMessage Text="" />

                        </ColumnValidationSettings>

                        <HeaderStyle Width="135px" />

                    </telerik:GridBoundColumn>

                    <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderStyle-Width="80px" HeaderText="Discontinued" SortExpression="Discontinued" UniqueName="Discontinued">

                        <HeaderStyle Width="80px" />

                    </telerik:GridCheckBoxColumn>

                    <telerik:GridTemplateColumn ColumnEditorID="NumericEditor1" DataField="UnitPrice" HeaderStyle-Width="80px" HeaderText="UnitPrice" SortExpression="UnitPrice" UniqueName="TemplateColumn">

                        <ItemTemplate>

                            <asp:Label ID="lblUnitPrice" runat="server" Text='<%# Eval("UnitPrice", "{0:C}") %>'></asp:Label>

                        </ItemTemplate>

                        <EditItemTemplate>

                            <span>

                            <telerik:RadNumericTextBox ID="tbUnitPrice" runat="server" Width="55px">

                            </telerik:RadNumericTextBox>

                            <span style="color: Red">

                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbUnitPrice" ErrorMessage="*Required">

                                    </asp:RequiredFieldValidator>

                            </span></span>

                        </EditItemTemplate>

                        <HeaderStyle Width="80px" />

                    </telerik:GridTemplateColumn>

                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Delete this product?" ConfirmTitle="Delete" HeaderStyle-Width="50px" HeaderText="Delete" Text="Delete" UniqueName="DeleteColumn">

                        <HeaderStyle Width="50px" />

                    </telerik:GridButtonColumn>

                </Columns>

                <PagerStyle PageSizeControlType="RadComboBox" />

            </MasterTableView>

            <HeaderStyle BackColor="Silver" ForeColor="White" />

            <PagerStyle PageSizeControlType="RadComboBox" />

            <FilterMenu EnableImageSprites="False">

            </FilterMenu>

        </telerik:RadGrid>

        <telerik:GridNumericColumnEditor ID="NumericEditor1" runat="server">

            <NumericTextBox ID="NumericTextBox1" runat="server" Width="60px" />

        </telerik:GridNumericColumnEditor>

        <telerik:GridTextBoxColumnEditor runat="server" ID="TextEditor">

            <TextBoxStyle Width="120px" />

        </telerik:GridTextBoxColumnEditor>

    </telerik:RadAjaxPanel>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

        DeleteCommand="DELETE FROM [Products] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO [Products] ([ProductName], [CategoryID], [UnitPrice], [Discontinued], [QuantityPerUnit], [UnitsInStock]) VALUES (@ProductName, @CategoryID, @UnitPrice, @Discontinued, @QuantityPerUnit, @UnitsInStock)"

        SelectCommand="SELECT [ProductID], [ProductName], [Products].[CategoryID], [Categories].[CategoryName] as CategoryName, [UnitPrice], [Discontinued], [QuantityPerUnit], [UnitsInStock] FROM [Products] JOIN Categories ON Products.CategoryID=Categories.CategoryID"

        UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName, [CategoryID] = @CategoryID, [UnitPrice] = @UnitPrice, [Discontinued] = @Discontinued, [QuantityPerUnit] = @QuantityPerUnit, [UnitsInStock] = @UnitsInStock WHERE [ProductID] = @ProductID">

        <DeleteParameters>

            <asp:Parameter Name="ProductID" Type="Int32"></asp:Parameter>

        </DeleteParameters>

        <InsertParameters>

            <asp:Parameter Name="ProductName" Type="String"></asp:Parameter>

            <asp:Parameter Name="CategoryID" Type="Int32"></asp:Parameter>

            <asp:Parameter Name="UnitPrice" Type="Decimal"></asp:Parameter>

            <asp:Parameter Name="Discontinued" Type="Boolean"></asp:Parameter>

            <asp:Parameter Name="QuantityPerUnit" Type="String"></asp:Parameter>

            <asp:Parameter Name="UnitsInStock" Type="Int16"></asp:Parameter>

        </InsertParameters>

        <UpdateParameters>

            <asp:Parameter Name="ProductName" Type="String"></asp:Parameter>

            <asp:Parameter Name="CategoryID" Type="Int32"></asp:Parameter>

            <asp:Parameter Name="UnitPrice" Type="Decimal"></asp:Parameter>

            <asp:Parameter Name="Discontinued" Type="Boolean"></asp:Parameter>

            <asp:Parameter Name="QuantityPerUnit" Type="String"></asp:Parameter>

            <asp:Parameter Name="UnitsInStock" Type="Int16"></asp:Parameter>

            <asp:Parameter Name="ProductID" Type="Int32"></asp:Parameter>

        </UpdateParameters>

    </asp:SqlDataSource>

    

Eyup
Telerik team
 answered on 30 Aug 2018
3 answers
84 views

 

Hi, we're trying to export a page and running into problems with Chrome (68.0.3440.106) 64-bit. It attempts to download the file (PDF) and fails with a network error (see attached). I suspect it can't write to the location it's trying to download to but can't see where. Everything else in Chrome just downloads to C:\Users\user\Downloads. We've tried Incognito mode with same result. We're not experiencing the issue with IE11 or Edge. Also, we're using version 2018.2.710 of the controls.

Thanks

Daniel

Rumen
Telerik team
 answered on 30 Aug 2018
3 answers
633 views

Just wanted to get feedback from developer community in choosing either the Library for User control (ASP.net Ajax) or (MVC & Kendo UI)

Just was trying to see what would be ideal path if I was doing fresh new  development

 

Wanted to get User feedback how these two different libraries behave for Web/Tablet/Mobile platform

if there is any meaningful advantage of one over the other

 

Which one of the two libraries is easier to customize for emerging display tech

 

David
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 29 Aug 2018
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?