Telerik Forums
UI for ASP.NET Core Forum
1 answer
143 views

Howdy!

I have a scenario in which I need to run some code when the item selected in a foreign key column in my grid is changed when it is being edited.

I can access other columns' editors without issue, but for some reason, every time I attempt to grab the editor for the foreign key column, it comes up as null.

For instance, I can use the following to grab the numeric text box for the edited row (in the Grid's on-edit event) with no issues:

var mcEditor = e.container.find("input[name=MoistureContent]").data("kendoNumericTextBox");

But, the only thing I can get to return as an object in the same on-edit event of the grid is the following:

var proctorEditor = e.container.find("input[name=ProctorReportId]");

I've tried using the following with no luck:

var proctorEditor = e.container.find("input[name=ProctorReportId]").data("kendoDropDownList");
var proctorEditor = e.container.find("input[name=ProctorReportId]").data("kendoComboBox");
The two instances above return null objects. But, as I mentioned, everything up until the call to .data() works. I'm at a loss of what the correct value to pass to the data() method should be to return the editor for the foreign key column in the grid.
Travis
Top achievements
Rank 1
Iron
 answered on 11 Sep 2022
1 answer
215 views

We are using a GridColumnSettings for a grid view.

Because the data is text heavy, we are using a popup when editing it.

This puts the Save and Cancel buttons at the bottom of form.  We have a user who doesn't want to scroll down to Save. (We already have had to put Save at the top of another form with links to Top.)

Is there any way to force the buttons to appear at the top or in both places? Any suggestions welcome. 

These are the basic settings we are using:

on the grid page:

 @(Html.Kendo().Grid<TITLE_PATTERN_1>().Name("grid")
        .Sortable()
        .Editable(x => x.Mode(GridEditMode.PopUp).TemplateName("TITLEPATTERNEditor").Window(w => w.Width(700)))
        .Scrollable()
        .Filterable()
        .Resizable(r => r.Columns(true))
        .ToolBar(tools => tools.Excel().IconClass("k-icon k-i-download"))
        .Excel(excel => excel
        .FileName("TitlePatterns.xlsx")
        .Filterable(true)
        .AllPages(true)
        .ProxyURL("TitlePattern?handler=Save")
        )
          .Columns(columns => columns.LoadSettings(Model.columns)
   )
        .DataSource(ds => ds.Ajax().Events(events => events.Error("error_handler"))
        .Events(events => events.Error("error_handler"))
        .Read(r => r.Url(Url.Action() + "?handler=Read").Data("forgeryToken"))
        .Update(u => u.Url(Url.Action() + "?handler=UpdatePopUp").Data("forgeryToken"))
        .Destroy(d => d.Url(Url.Action() + "?handler=Destroy").Data("forgeryToken"))
        .Model(m =>
        {
            m.Id(id => id.Id);
            m.Field(p => p.Id).Editable(false);

        })
        .PageSize(50)
        )
        .Pageable()

          )

In the GridColumnSettings

 new GridCommandColumnSettings
            {
                Commands =
                {
                     new GridEditActionCommand()
                     {  
                         Name = "Update",
                         Text = "Update",
                         UpdateText = "Save",                         
                         CancelText = "Cancel"                         
                     },

                 },
                Width = "100px",
                Filterable = false,
                Locked = true,
                Title = "Update"
               },

And this is the template:

@Html.HiddenFor(model => model.Id)

    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.TITLE_CODE)
    </div>
    <div class="k-textbox" style="padding: 10px;">
        @Html.EditorFor(model => model.TITLE_CODE)
        @Html.ValidationMessageFor(model => model.TITLE_CODE)
    </div>

    <div class="k-edit-label"  style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD1)
    </div>
    <div class="k-textarea"  style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD1).Rows(5)
    </div>

    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD2)
    </div>

    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD2).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD3)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD3).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD4)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD4).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD5)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD5).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD7)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD7).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.FIELD8)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.FIELD8).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE1)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE1).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE2)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE2).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE3)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE3).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE4)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE4).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE5)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE5).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE6)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE6).Rows(5)
    </div> <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE7)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE7).Rows(5)
    </div>
    <div class="k-edit-label" style="padding: 10px;">
        @Html.LabelFor(model => model.NOTE8)
    </div>
    <div class="k-textarea" style="padding: 10px;">
        @Html.Kendo().TextAreaFor(model => model.NOTE8).Rows(5)
    </div>

 

                   
Mihaela
Telerik team
 answered on 09 Sep 2022
1 answer
240 views

Howdy

I am opening a window to display a razor page using the following


function dblClickCalEvent(e) {

		var win = $("#scheduleWindow").data("kendoWindow");

		win.refresh({
			url: "@Url.Page("ScheduleForm", "Details")",
			data: { clickDate: e.dataset.clickdate, scheduleId: e.dataset.scheduleid }
		});
		win.center().open();

	}

This opens the Razor page and calls the OnGetDetails and renders the page using the correct Model.  I have a MultiSelect on the page using the Select Event which once a value is selected POSTs back to the page using the following:




	function attendee_selected(e) {


		$.ajax({
			type: "POST",
			url: "ScheduleForm?handler=AttendAdd",
			data: { __RequestVerificationToken: '@token', attendee: e.dataItem.UserPrincipleName }
		});


	}

Which posts to this:


public async Task<IActionResult> OnPostAttendAdd(string attendee)

And returns Page();

I can see that the model gets populated while debugging the Razor page, however the page never renders the new results on page.  I have tried to call a refresh on the window but this has no effect.  Here is and example of where the ViewDates change once the Page is returned from the Post method and the changes are not reflected in the page in the window:


<table style="width: 100%;">
				<tr>
					@foreach (var d in Model.ScheduleAssistaint.ViewDates)
					{

						<td class="border1" style="text-align:center;">
							@d.ToLongDateString()
						</td>

					}
				</tr>
			</table>

Is this something to do with the fact the page is inside a window?  If so is there a way to fix this?

 

Thanks

Alexander
Telerik team
 answered on 09 Sep 2022
3 answers
297 views

I'm using the Drawer TagHelper and when the page opens, I'd like the Drawer to start open if the user cookie is set to open and closed if the cookie is set to closed. I am doing this currently using javascript but it causes it to open every time you go to a new page. Is there a setting on the taghelper that will cause it to start out open or closed rather than having to set it using javascript?

Thanks!

Laurie

Here's my code:

                <kendo-drawer name="drawer" mode="push" on-hide="onHide" min position="left" swipe-to-open="false" template-id="template" class="no-border">
                    <mini enabled="true" />
                </kendo-drawer>
<script>
            $(document).ready(function () {
               var drawerInstance = $("#drawer").data().kendoDrawer;
                var hideMenu = getCookie("HideCustomerMenu");                  
                if (hideMenu == 'true') {
                    var arrowButton = $("#expand");
                    arrowButton.toggleClass('flip');
                    drawerInstance.hide();
                }
                else {                  
                    drawerInstance.show();
                }
 
            });
</script
        <script id="template" type="text/x-kendo-template">
            <ul class="menuBar list-unstyled">
                       <li id="customerinfo"><a href="/customer" ><i class="fa fa-user-circle fa-2x fa-fw mr-2" aria-hidden="true" title="Customer Information"></i>Customer Info</a></li>
                       <li id="test"><a href="/test" ><i class="fa fa-user-circle fa-2x fa-fw mr-2" aria-hidden="true" title="Test"></i>Test</a></li>
            </ul>
        </script>
Stoyan
Telerik team
 updated answer on 08 Sep 2022
0 answers
115 views
I'm upgrading from 5.1.3 of bootstrap to the latest on nuget, which is 5.2.0.  When I do this, must I also upgrade my SASS telerik theme?  How do I know what version of bootstrap the telerik theme is using?
Joel
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 08 Sep 2022
1 answer
366 views

Howdy!

I have a scenario in which I have messages stored in a database. My client would like to enable a website portal for his employees to read/respond to said messages. (We already have this implemented and working in a WPF application using the RadChat control from the WPF library)

The documentation for the chat control in ASP.NET Core is really sparse. Like 3 pages of information and that's it. No examples on data binding like most other controls you have... So, my question is this: is it possible to bind the Messages that show up in the chat control similar to the way in which I can say, bind the data that shows up in the ASP.NET Core Grid using a data source transport mechanism?

I know in the case of the WPF implementation, I had to implement a converter for the messages in order to bind them to the control...

Mihaela
Telerik team
 answered on 07 Sep 2022
1 answer
243 views

Hi,

I have a .net core submission form with an upload that works at the moment,  the form submits successfully, and the files are transferred to S3. Is it possible to convert this form to ajax submission and display the loader whilst the form and uploads are processing before I return my success message?

Mihaela
Telerik team
 answered on 06 Sep 2022
1 answer
132 views

I have a similar problem to this old thread: Dealing with data which includes a field having an array of objects in Kendo UI for jQuery | Telerik Forums.

I linked a field that is an array of a specific class to a Kendo ListView of a custom editor when you create or edit a scheduler item.

When I add or remove items, there are no problems. Apparently, the scheduler recognizes that there are more or fewer items in the list, but when I modify a list item (one of its properties), the scheduler does not trigger the update event.

Is there a way to trigger the update event when the ListView items are modified or force it to fire?

Alexander
Telerik team
 answered on 01 Sep 2022
3 answers
691 views

Hello,

Our company uses Telerik developing web application. I am working on CI/CD, and I found Telerik NuGet source is good - except it requires clear text password.

It's nice to have the NuGet source support API key authentication, and key management in the account generated the key.

In this way we can avoid the risk to publish clear text password. 

Please consider support it :)

Thanks.

Минчо1
Top achievements
Rank 1
Iron
 answered on 31 Aug 2022
1 answer
143 views

This demo with 2 list boxes and the transfer buttons is the exact use case that I have. I'm trying to make it less work for the users since there will be several employees to select. I would like to avoid having to click the transfer button after clicking each employee or having to remember to control click to select more than one.

I tried to use a template to make the items checkboxes, but the checkboxes were rendered as text fields.

I also tried defining the change event to click on the transferTo link whenever an item is selected.

$('a[data-command="transferTo"]').click();

When an item is clicked, ALL of the list items are transferred instead of the one that was clicked.

Is there any way to do either of the following?

1. Make the list items checkboxes. Clicking the transfer button will transfer all of the checked items.

2. Transfer an item to the other listbox when it is clicked.

If not I think I will use plain HTML select elements.

Thanks

 

Stoyan
Telerik team
 answered on 30 Aug 2022
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?