Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
363 views

I'm looking for an example of how to insert a row, with data, into a radgrid. I've seen examples of how to trigger the insert command from Javascript.  But I want more than just a new, empty row that the user can type into.  I want to add a new, completed row, with data, to what is already bound to the grid, from Javascript.

Let's assume I have some JSON data (returned by an ajax call, for example) that I want to add as a new row into an existing radgrid on the page, all client side, Javascript based.  I'm assuming that when the page is eventually posted back, I can then also iterate over all the rows (those orginally bound when the page was first rendered and any subsequent rows that were added by Javascript).

Any sample code or suggested links would be appreciated.

 

 

Rumen
Telerik team
 answered on 08 Nov 2024
6 answers
193 views

Good afternoon,

I am using ASP.NET AJAX version 2023.3.1010.45,

I have a page with a ComboBox and Grid.  By choosing an Item in the ComboBox and clicking a Button, it will locate the Item in the Grid.  If an Item is inserted into or deleted from the Grid, the ComboBox needs to update.  Both controls have the same ObjectDataSource as their data source.  This is why they share an Ajax Panel.

I am using a RadAjaxManager and RadAjaxLoadingPanel as follows (setting UpdatePanelsRenderMode to Inline):

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridItems"/>
                    <telerik:AjaxUpdatedControl ControlID="RadComboItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGridItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridItems" />
                    <telerik:AjaxUpdatedControl ControlID="RadComboItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" BackgroundTransparency="30" RenderMode="Lightweight">
    </telerik:RadAjaxLoadingPanel>

The ComboBox and Grid appear in the same RadAjaxPanel (also with RenderMode Inline):

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" RenderMode="Inline">
    <label for="RadComboItems">Input/Select Item:</label>
    <telerik:RadComboBox ID="RadComboItems" runat="server" Height="200px" Width="200px" DataSourceID="odsItems" EnableVirtualScrolling="true" DataTextField="ItemId" DataValueField="RowNum" EmptyMessage="--Select a value--" RenderMode="Lightweight" EnableAjaxSkinRendering="true">
    </telerik:RadComboBox>
    <telerik:RadButton RenderMode="Lightweight" runat="server" Text="Select" ID="btnFindItems" OnClick="btnFindItems_Click" EnableAjaxSkinRendering="true" />

    <telerik:RadGrid ID="RadGridItems" RenderMode="Lightweight" runat="server" AllowPaging="True" DataSourceID="odsItems" AllowSorting="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" OnUpdateCommand="RadGridItems_UpdateCommand"                                    OnItemDataBound="RadGridItems_ItemDataBound" OnItemCommand="RadGridItems_ItemCommand" OnItemDeleted="RadGridItems_ItemDeleted" OnItemInserted="RadGridItems_ItemInserted" OnItemUpdated="RadGridItems_ItemUpdated" OnPreRender="RadGridItems_PreRender" CellSpacing="-1" GridLines="Horizontal" OnDetailTableDataBind="RadGridItems_DetailTableDataBind" AllowFilteringByColumn="true" OnInfrastructureExporting="RadGridItems_InfrastructureExporting">
....
....
    </telerik:RadGrid>
</telerik:RadAjaxPanel>

When the page first renders, the ComboBox and Button render as expected:

<div class="RadAjaxPanel" id="ctl00_maincontent_ctl00_maincontent_RadComboItemsPanel" style="display: inline;">

Once the Button is pressed though, the rendering changes to Block:

<div class="RadAjaxPanel" id="ctl00_maincontent_ctl00_maincontent_RadComboItemsPanel">

Is there anyway to prevent this from happening, without having to specify this on the page:

    <style type="text/css">
        .RadAjaxPanel
        {
            display: inline !important;
        }
    </style>

Kind regards,

Richard

Rumen
Telerik team
 answered on 06 Nov 2024
2 answers
102 views

I want to restrict the editing of a RadEditor, but I don't want to set its server-side Enabled property to false. 

Using client-side JavaScript, I'm using editor.enableEditing(false), but this still allows the user to delete or backspace to remove content.  It does not allow adding new content, nor respond to any other key.

I've tried to add an event listener for the onkeydown and keydown event to prohibit the delete and backspace keys, but that doesn't stop the user from deleting content, either. 

While debugging, I noticed that the content gets deleted prior to hitting the e.preventDefault() that is intended to stop it. 

How can I accomplish this task?


editor.enableEditing(false);
     editor.get_contentArea().onkeydown = e => {                         
         if (e.keyCode === 8 || e.keyCode === 46) { // Prevent Backspace (8) and Delete (46)
             e.preventDefault();
             e.stopPropagation();
             e.stopImmediatePropagation();
             return false;
         }
     };
                

Rumen
Telerik team
 answered on 02 Nov 2024
1 answer
103 views

Good morning! I would like to know if it is possible to save the state of the radtreelist with the nodes that were opened or closed and this way when the user reloads the screen it will be displayed the way it was before?

Radtreelist asp.net c#

Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
102 views

Two issues on the RadScheduler Weekview column header:

  1. How to disable the clickable link in the column header?
  2. We want to only show dayname as header eg. "Sunday Monday Tuesday". What format string to use herefore?

Thanks,

Marc

 

Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
175 views

How can I get the index of the series item on a Line Chart when clicking on it?

I am using OnSeriesClick

        function OnSeriesClick(args) {
            alert(args.value);
        }

I don't care about the value of the item, what I need is the index of it in the series.

Thanks,

 


Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
96 views
In the gantt chart web client, when I shift one of the tasks that has a chain of dependent tasks below it, the dependencies don't shift the same number of days; I have to manually edit each one.

Am I missing something, or is this not a feature?

Thanks!
Rumen
Telerik team
 answered on 31 Oct 2024
0 answers
131 views

Hi Telerik Team,

One of our requirements is to keep the timeline column header fixed during vertical scrolling when there are numerous records displayed that extend beyond the default view. This feature is essential for improving user navigation and readability.

The following picture depicts the implementation. 

 

The output. 

Could you please advise if there is a method or configuration available to achieve this behavior within the Telerik RadScheduler component?

 Regards,

Sathyendranath

Sathyendranath
Top achievements
Rank 1
Iron
Iron
 asked on 28 Oct 2024
1 answer
83 views

I would like to disable ability to click on chart legend items.

Any ideas?

 

Thank you

Vasko
Telerik team
 answered on 28 Oct 2024
1 answer
140 views

I am using a RadCaptcha control in my web page. If I don't input anything in the textbox of RadCaptcha or enter an invalid code, then after the ajax postback returns the client-side Validity object for the RadCaptcha textbox as shown below is always showing that RadCaptcha is valid when it's not. I thought the Validity object should reflect the invalid state of RadCaptcha.  There is only one RadCaptcha in my web page.

Why is the client-side Validity object on RadCaptcha's textbox not showing the correct state? Can I check on the client-side if RadCaptcha is valid since the Validity object is not reliable. I am using Telerik ASP.NET AJAX Q2 2020 version.

Rumen
Telerik team
 answered on 25 Oct 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?