Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
210 views
Does RadDataForm support validation? I want to add RequiredFieldValidator and do a server side validation.
I am using DataForm with SelectMethod/UpdateMethod (Model Binding) and ValidationSummary.
I start the form in Edit Mode.

When I click Update and the field is empty, update method does not get called. There are no errors displayed on the page though. I can see that NameCustomValidator_ServerValidate method is called and it sets IsValid to false.

If the field is not empty then update method is called and works as expected.

I am using version 2017.2.711.45

I was able to successfully use validation with RadGrid.

My code...

<asp:ValidationSummary ID="ValidationErrors" runat="server" />
 
<telerik:RadDataForm ID="DataForm" runat="server" SelectMethod="GetDetails" UpdateMethod="UpdateDetails"
            ItemType="MyData" DataKeyNames="ID"
            OnPreRender="DataForm_PreRender" ItemPlaceholderID="itemPlaceholder1">
    <LayoutTemplate>
        <div id="itemPlaceholder1" runat="server"></div>
    </LayoutTemplate>
    <ItemTemplate>Empty Read Only Page</ItemTemplate>
    <EditItemTemplate>
        <div>
            <telerik:RadButton ID="InsertButton1" runat="server" ButtonType="StandardButton" CommandName="Update" Text="Update" />
            <telerik:RadButton ID="CancelButton1" runat="server" ButtonType="StandardButton" CausesValidation="False" CommandName="Cancel" Text="Cancel Changes" />
        </div>
        <table>
            <tr>
                <td><telerik:RadLabel ID="NameLabel" runat="server" AssociatedControlID="NameTBox">Name:</telerik:RadLabel></td>
                <td>
                    <telerik:TextBox ID="NameTBox" runat="server" Text="<%# BindItem.Name %>"></telerik:TextBox>
                    <asp:RequiredFieldValidator ID="NameValidator" runat="server" ControlToValidate="NameTBox" ErrorMessage="Name is required" Text="!" Display="Static" />
                    <asp:CustomValidator ID="NameCustomValidator" runat="server" ControlToValidate="NameTBox" OnServerValidate="NameCustomValidator_ServerValidate" ErrorMessage="Name is required" Text="!" Display="Static" />
                </td>
            </tr>
        </table>
     </EditItemTemplate>
</telerik:RadDataForm>

 

Start DataForm in edit mode

protected void DataForm_PreRender(object sender, EventArgs e)
{
    // Display Edit mode when first loaded
    // Stay in Edit mode after update
    RadDataForm editForm = (RadDataForm) sender;
    if (editForm.Items.Count() > 0)
    {
        RadDataFormItem item = editForm.Items[0];
        item.FireCommandEvent("Edit", "");
    }
}

This does get called.

protected void NameCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
{
    args.IsValid = !string.IsNullOrEmpty(args.Value);
}

 

Thanks

Marius
Top achievements
Rank 1
 asked on 27 Sep 2017
0 answers
90 views

hello everyone , im new in this forum , i just started with a company, this company use a telerik user controls,

we must do a wizard for a client , and im working for a maket thats is look like to a skin METROTOUCH wizard ,

but im wondered that i cant add a button in the navigation button bar (next , previous , cancel , finish) that process my logic , and wondered that an old wizard it contain a commandarea wich can created and handled on the code behind , it regroup all button and you can add a button on the code too.

can any one suggest to me how to add a button on navigation Bar

Fahd
Top achievements
Rank 1
 asked on 27 Sep 2017
1 answer
99 views

Hi, 

I'm trying to implement a RadEditor with an Undo tool through EditorContextMenu (the right-click menu), the menu actually comes up with an "Undo" text and the icon but when I click it nothing happens. I can get the Undo function to work with telerik:EditorToolGroup (the toolbar icon), but not with the EditorContextMenu. As I recall I was able to do this in the past? 

Can anyone please confirm if it's still possible and if so, how would I go about implementing it?

 

Thanks,

Patrick. 

Pat
Top achievements
Rank 1
 answered on 27 Sep 2017
1 answer
202 views
There are a number of controls missing from the new editor that was not in the old telerik editor. including Add spell check, cut, copy and paste {several options}, undo, redo, new paragraph, horizontal rules, insert time, insert symbol. Anyway to bring those functionalities into  ASP.net core?

Asp.net core libraries
http://demos.telerik.com/aspnet-mvc/editor/all-tools

Old ajax libraries
http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx
Rumen
Telerik team
 answered on 27 Sep 2017
1 answer
72 views

 Hello Support,

We have Telerik grid in our application 
We  are facing the problem of sorting for date field column It sort only for date and month field not for year field
we have set the autogenerated column is true and all columns are dynamically generated that are bound to grid
Please help us to resolve the problem

Thank you 
Sandip Katore

Eyup
Telerik team
 answered on 27 Sep 2017
0 answers
117 views

Using a Kendo grid with AJAX.

 

The default filter of the initial grid load is defined as:

 

    var ds = $("#history-grid").data("kendoGrid").dataSource;
        if ($("#history-search").val().trim().length == 0) {
            if (!user) { user = $("#username").text().trim(); }
            ds.filter({
                field: "RequestOwner"
                , operator: "equals"
                , value: user
            })
           }

 

The above worked great, grid would be filtered according to RequestOwner, and the checkbox for the specific user in the RequestOwner column's filter dropdown would be marked as checked when the grid was first loaded.

 

Then I added filterMenuInit to the grid initialization, which did sort the filter items appropriately, but removed the check from the checkbox for the specific user  in the RequestOwner column's filter dropdown (On initial grid load).  The filter itself is correctly applied to the grid, I just cannot get the checkbox for that value to show as checked (On initial grid load).

 

How I am defining filterMenuInit :

 

, filterable: true

, , filterMenuInit: function (e) {
            if (e.field === "RequestOwner") {
                var filterMultiCheck = this.thead.find("[data-field=" + e.field + "]").data("kendoFilterMultiCheck")
                filterMultiCheck.container.empty();
                filterMultiCheck.checkSource.sort({ field: e.field, dir: "asc" });
                filterMultiCheck.checkSource.data(filterMultiCheck.checkSource.view().toJSON());
                filterMultiCheck.createCheckBoxes();
            }
        }

 

Please advise.

James
Top achievements
Rank 1
 asked on 26 Sep 2017
3 answers
142 views
Hi,

Is it possible to identify a new name for a pdf or an excel file which is generated by the grid when I click the icon ?
Thank you
jonathan
Top achievements
Rank 1
 answered on 26 Sep 2017
2 answers
416 views
I'm currently using a RadGrid with EditMode=Batch.  I need a client-side notification of changes to the grid to do some screen updates.  For Update and Insert changes I'm listening to the OnBatchEditCellValueChanged event, and that's working fine.

How can I get a client-side notification of a row being deleted by the user?  The grid currently has a Delete Button column (GridButtonColumn with a CommandName of Delete) which the user is clicking, but I'm open to other solutions.  When the user clicks the button, the row is actually deleted from the screen and the delete is sent to the server as part of a Save Changes.  The only part that's missing is a client-side notification.

I've tried the obvious choices of OnRowDeleting, OnRowDeleted, OnRowDestroying, and OnRowDropped, but none of those seem to work with BatchEdit.  I think that I need something like OnBatchEditRowDeleted, but that doesn't exist.

Any ideas on how to make BatchEdit and RowDelete play nice with each other and generate a client-side event?

Thanks,
DaveL
Mira
Top achievements
Rank 1
 answered on 26 Sep 2017
0 answers
95 views

I spent way too much time trying to figure out why the RadAjaxLoadingPanel was not showing. The culprit was having the RadScriptManager declared after the RadAjaxManager. Placing the script manager first makes sense, but I was pouring over the AJAX manager and loading panel code for quite some time before looking farther afield.

Hopes this helps someone!

Tom
Top achievements
Rank 1
 asked on 26 Sep 2017
1 answer
306 views

Hi everybody! First and foremost, I am very new to software development, so I have a lot to learn. I've inherited a few projects that need some changes/updates, and the original developer is no longer here nor is there any documentation.

My first small fix is to update a checkbox to a dropdown with 3 values. The RadDropDownList updates one other dropdown on the page (as did the checkbox it's replacing), and the initial RDDL selection is handled on ItemDataBound (I have that part working!). I can't get the RDDL to update the other dropdown, and I'm fairly certain it's because I'm not using it entirely correctly. I've been through the documentation, but there's still so much that I don't know that it's proving difficult. The SelectWOStatus sub below was copypasta'd directly from the ItemCommand/CommandName case that handled the checkbox. Can anyone at least point me in the right direction?

TL;DR:

  • I'm a baby dev; be gentle
  • Replace checkbox with RadDropDownList
  • How do I get the value from the selection and update another dropdown accordingly?
  • Copypasta'd method from ItemCommand/CommandName of previous checkbox
<telerik:GridTemplateColumn HeaderText="Completed (DD)" ItemStyle-HorizontalAlign="Center">
    <ItemTemplate>
        <telerik:RadDropDownList runat="server" ID="ddlStatusWO" OnItemSelected="SelectWOStatus" AutoPostBack="true">
            <Items>
                <telerik:DropDownListItem runat="server" Text="Open" Value="O" />
                <telerik:DropDownListItem runat="server" Text="Completed" Value="F" />
                <telerik:DropDownListItem runat="server" Text="Return Pending" Value="H" />
            </Items>
        </telerik:RadDropDownList>
    </ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Completed (DD)" ItemStyle-HorizontalAlign="Center">
    <ItemTemplate>
        <telerik:RadDropDownList runat="server" ID="ddlStatusWO" OnItemSelected="SelectWOStatus" AutoPostBack="true">
            <Items>
                <telerik:DropDownListItem runat="server" Text="Open" Value="O" />
                <telerik:DropDownListItem runat="server" Text="Completed" Value="F" />
                <telerik:DropDownListItem runat="server" Text="Return Pending" Value="H" />
            </Items>
        </telerik:RadDropDownList>
    </ItemTemplate>
</telerik:GridTemplateColumn>
Protected Sub SelectWOStatus(sender As Object, e As DropDownListEventArgs)
    Dim myJob As BidJob = CType(Session("Job" & hfPageGUID.Value), BidJob)
    Dim intWONum As Integer = myJob.NumberOfWorkOrders()
    Dim intCompletedCount As Integer = 0
    For Each item As GridDataItem In rgWoList.Items
        Dim ddlStatusWOSelectedValue As String = CType(item.FindControl("ddlStatusWO"), RadDropDownList).SelectedValue
        'Dim ddlStatusWOSelectedValue As String = e.Value
        If ddlStatusWOSelectedValue = "F" Or ddlStatusWOSelectedValue = "H" Then
            If intWONum = 1 Then
                ddlBidStatus.SelectedValue = "COMPLETED"
            Else
                ddlBidStatus.SelectedValue = "PARTIALLY COMPLETE"
            End If
        End If
    Next
    If intCompletedCount = 0 Then
        ddlBidStatus.SelectedValue = "AWARDED"
    End If
    If intCompletedCount = intWONum Then
        ddlBidStatus.SelectedValue = "COMPLETED"
    End If
End Sub

asdf

Mike
Top achievements
Rank 1
 answered on 26 Sep 2017
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?