Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
123 views

I need to show the handle / title bar under certain conditions, and have not showing under other conditions.  Looking for a way to set the DockHandle to none using javascript.

Is there a way to do this?   I tried dock.set_handle(null), and that didn't work.

Thanks,

Dave

 

Vessy
Telerik team
 answered on 18 Jun 2021
1 answer
382 views

Hi there, 

 

I have a radtoggleButton in a grid with two states and I´m creating the new rows using a DataTable source of the Grid.

My question is how I can use the datable to set the second state of the toggle button.

This is how the grid looks like: 

And this is the column template for the grid. 

I´ve tried to set the value as newRow("Visibility") = "Hide"  or adding the button directly to this cell of the row. 

Let me know if you have some ideas, please.

Thanks, 

Alvaro.

 

 

Doncho
Telerik team
 answered on 18 Jun 2021
0 answers
518 views

Hello,

For my RadGrid, I need 2 different ways to insert.

So, I declare I want to use User controls,

<EditFormSettings EditFormType="WebUserControl"></EditFormSettings>

and I change programmatically the form to use.

protected void rgrid_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName.Equals("AddF"))
        {
            e.Item.OwnerTableView.EditFormSettings.UserControlName = "../UserControl/UC_PDGInsertionF.ascx";
            e.Item.OwnerTableView.InsertItem();

        }
        else if (e.CommandName.Equals("AddN"))
        {
            e.Item.OwnerTableView.EditFormSettings.UserControlName = "../UserControl/UC_PDGInsertionN.ascx";
            e.Item.OwnerTableView.InsertItem();
        }
    }

My Command buttons that show the forms work perfectly.

However, my Command buttons don't work on my User controls (both of them).


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UC_PDGInsertionN.ascx.cs" Inherits="UC_PDGInsertionN" %>
<table>
<%-- some code --%>
    <%-- Buttons --%>
    <tr> 
        <td align="right" colspan="2">
            <asp:Button ID="btnAdd" Text="Cancel" runat="server" CausesValidation="False"
                        CommandName="Add" Visible="True"></asp:Button>
            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                        CommandName="Cancel" Visible="True"></asp:Button>
        </td>
    </tr>
</table>

Whether I click on one or the other, I get this exception:

La valeur ne peut pas être null.
Nom du paramètre : virtualPath

Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Détails de l'exception: System.ArgumentNullException: La valeur ne peut pas être null.
Nom du paramètre : virtualPath

[ArgumentNullException: La valeur ne peut pas être null.

Nom du paramètre : virtualPath]

   System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +511

   Telerik.Web.UI.GridEditFormItem.InitializeUserControlForm(GridColumn[] columns, ControlCollection controls, GridEditFormSettings formSettings) +92

   Telerik.Web.UI.GridEditFormItem.InitializeEditForm(GridColumn[] columns) +6349

   Telerik.Web.UI.GridEditFormInsertItem.InitializeEditForm(GridColumn[] columns) +37

   Telerik.Web.UI.GridEditFormItem.Initialize(GridColumn[] columns) +369

   Telerik.Web.UI.GridEditFormItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +266

   Telerik.Web.UI.GridTableView.CreateInsertItem(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ControlCollection rows) +656

   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +3191

   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +1308

   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +97

   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +207

   Telerik.Web.UI.GridTableView.PerformSelect() +23

   Telerik.Web.UI.GridTableView.DataBind() +360

   Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +3113

   Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +150

   System.Web.UI.Control.LoadRecursive() +154

   System.Web.UI.Control.LoadRecursive() +251

   System.Web.UI.Control.LoadRecursive() +251

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082

I had to disable AJAX in the RadAjaxManager to be able to see the exception. 

Do you any idea of the source of the problem?

Gregory
Top achievements
Rank 1
 asked on 16 Jun 2021
1 answer
224 views

Hi, I'm trying to create a dynamic rad grid (two columns) for batch edit where one column can have different control based on a condition. Basically, it should look like this once click to edit the cell.

Value 1	Dropdown
Value 2	TextBox
Value 3	DatePicker
Value 4	Checkbox
Value 5	TextBox

Can anyone share a sample code for this? 

Thank You

Doncho
Telerik team
 answered on 16 Jun 2021
1 answer
130 views
How do I zoom by percentages with the Diagram control so that I could have a dropdown with a list of percentages e.g 25%,50%,75%,100%
Vessy
Telerik team
 answered on 15 Jun 2021
0 answers
144 views

Hi there, 

I´m using a RadNumericTextBox as a counter and I would like to show the number on the right but no between the arrows.

Right now I´m using the option:  <EnabledStyle HorizontalAlign="Right" />

Thanks,

Alvaro.

dds
Top achievements
Rank 1
Iron
Iron
 asked on 15 Jun 2021
1 answer
202 views

Hi there, 

I'm updating the number of the frozen columns of a grid in another modal form, and after I would like to see the changes in the grid after closing the modal form. Which action should I call? 

 

Thanks,

Alvaro.

dds
Top achievements
Rank 1
Iron
Iron
 answered on 15 Jun 2021
1 answer
112 views

Hi there,

since it is not possible to paste images, if stripping all formatting is configured, i have created a small workaround, which i want to share. Target was, to get pretty clean HTML - without annoying markup - but to allow images to be inserted via clipboard.

First of all, use the options of the editor, to "pre-clean" the HTML:

StripFormattingOptions="Css,Font,Span,MSWordRemoveAll"

Then attach to the OnClientPasteHtml event and perform special cleaning, if HTML is pasted:

function Editor_PasteHtml(sender, args) {
	var sInitialValue = args.get_value();
	if ((args.get_commandName() == 'Paste') && (sInitialValue != null)) {
		// Only allow basic tags
		var sStrippedValue = sInitialValue.replace(new RegExp("<(?!\/?(strong|b|em|img|(i(?!nput))|u|ol|ul|li|p|br)(?=>|\s?.*>))\/?.*?>", "ig"), "");
		args.set_value(sStrippedValue);
	}
}

The solution is not perfect and the RegEx could be extended, but for our case, it works good enought. The RegEx itself was taken from a sample by Rumen and modified, to allow less tags.

 

Kind regards, Carsten

Rumen
Telerik team
 answered on 15 Jun 2021
1 answer
273 views

Hi

I have RadScheduler with timeline as selected view. It works other well but when appointments are first ending and second starting at same time, it make two rows. Is there any possibility to get those to same row (and create second row only when appointments are over each others)? Times are not over to each other so I think those should be in one row and when appointment end and start is exactly same time with slot time period those might be in same row. See picture what my situation is now.

Here is Scheduler aspx snipped (code behind has tooltip generation in OnAppointmentDataBound) which is quite directly from your demo, only datasources and fields from there are changed (and done own styles to try change colors and font).

        <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" SelectedView="TimelineView" 
            SelectedDate="2021-05-01" DayStartTime="00:00:00" DayEndTime="23:59:59" Height="100%" Width="100%" RowHeight="60" 
            DataSourceID="SqlSSAK" DataKeyField="ID" DataSubjectField="NIMIKE" DataStartField="ALKUAIKA" DataEndField="LOPPUAIKA"
            Localization-HeaderMultiDay="Work Week" GroupingDirection="Vertical" GroupBy="SakKoneNimi" 
            OverflowBehavior="Scroll" ShowFullTime="True" StartInsertingInAdvancedForm="True"
            OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" >
            <AdvancedForm Modal="true"></AdvancedForm>    
            <ResourceTypes>
                <telerik:ResourceType KeyField="SakKoneID" Name="SakKoneNimi" TextField="SakKoneNimi" ForeignKeyField="SakKoneID" DataSourceID="sqlSakitysKoneet"></telerik:ResourceType>
            </ResourceTypes>
            <ResourceStyles>
                <telerik:ResourceStyleMapping Type="SakKoneNimi" Text="SSAK1" ApplyCssClass="SSAK1Style"></telerik:ResourceStyleMapping>
                <telerik:ResourceStyleMapping Type="SakKoneNimi" Text="SSAK2" ApplyCssClass="SSAK2Style"></telerik:ResourceStyleMapping>
            </ResourceStyles>
            <TimelineView UserSelectable="false" NumberOfSlots="288" SlotDuration="0.00:15:00" TimeLabelSpan="24" ColumnHeaderDateFormat="dd.MM HH" 
                SortingMode="Global" ShowInsertArea="False" ReadOnly="False"></TimelineView>
            <MultiDayView UserSelectable="false"></MultiDayView>
            <DayView UserSelectable="false"></DayView>
            <WeekView UserSelectable="false"></WeekView>
            <MonthView UserSelectable="false"></MonthView>
            <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
            <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
        </telerik:RadScheduler>

Regards

Harri

Peter Milchev
Telerik team
 updated answer on 14 Jun 2021
0 answers
151 views

I am using Radlistview control drag and drop functionality. Radlistview items are drag and dropping into Repeater control. this functionality working in chrome older version but not working in latest chrome version. I have verified my code..args.get_destinationElement().id;  method returning repeater id   in older version  but in newer version this method returning Radlistview control id. so destination element id returning wrong in newer version. how to overcome on this issue. please help me on this. please find the below my code. 

function trackDropping(sender, args) {
    debugger;
   var dest = args.get_destinationElement();    
   if (!dest || !dest.id || dest.id.indexOf("TeamLink") < 0) {
       args.set_cancel(true); 
    }

Telerik Web UI ListView Items Drag-and-drop Demo | Telerik UI for ASP.NET AJAX

Narender
Top achievements
Rank 1
Iron
 updated question on 11 Jun 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?