Quantcast
Channel: Telerik Forums RSS
Viewing all 81499 articles
Browse latest View live

Add DropDown to RadGrid

$
0
0

Hi Lenard,

In general there are three ways to bind data to RadGrid or its controls. One of those is binding using Declarative DataSource, binding on the code behind programmatically or binding on client using JavaScript objects or WebServices, see Telerik RadGrid Data Binding Basics

Here are few examples to have DropDown in RadGrid and bind data to it

1. Using GridDropDownColumn with Declarative DataSource 

<telerik:GridDropDownColumnDataSourceID="SqlDataSource1"UniqueName="DropDownColumn1"HeaderText="Country"DataField="ShipCountry"ListDataMember="ShipCountry"ListValueField="ShipCountry"ListTextField="ShipCountry"></telerik:GridDropDownColumn>

The DataSource control

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:ConnectionString %>"SelectCommand="SELECT DISTINCT [ShipCountry] FROM [Orders]"></asp:SqlDataSource>

 

2. Using GridDropDownColumn with prgrammatic Data Binding:

<telerik:GridDropDownColumnUniqueName="DropDownColumn2"HeaderText="Country"DataField="CountryID"ListDataMember="CountryID"ListValueField="CountryID"ListTextField="ShipCountry"></telerik:GridDropDownColumn>

 

In the ItemDataBound event of RadGrid access the Combo and assign it a DataSource:

protectedvoidRadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{if (e.Item.IsInEditMode)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        RadComboBox combo = editedItem["DropDownColumn2"].Controls[0] as RadComboBox;
        combo.DataSource = ComboDataSource();
        combo.DataTextField = "ItemText";
        combo.DataValueField = "ItemId";
        combo.DataBind();var CountryID = editedItem.GetDataKeyValue("CountryID");var selectedItem = combo.FindItemByValue(CountryID.ToString());if (selectedItem != null)
        {
            selectedItem.Selected = true;
        }
    }
}

 

3. Using GridTemplateColumn with Declarative DataSource Control

<telerik:GridTemplateColumnUniqueName="TemplateColumn1"><ItemTemplate><%#Eval("ShipCountry") %></ItemTemplate><EditItemTemplate><telerik:RadDropDownListID="RadDropDownList1"runat="server"DataSourceID="SqlDataSource1"DataTextField="ShipCountry"DataValueField="ShipCountry"SelectedValue='<%# Bind("ShipCountry") %>'></telerik:RadDropDownList></EditItemTemplate></telerik:GridTemplateColumn>

 

DataSource Control

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:ConnectionString %>"SelectCommand="SELECT DISTINCT [ShipCountry] FROM [Orders]"></asp:SqlDataSource>

 

4. Using GridTemplateColumn with Programmatic Data Binding

<telerik:GridTemplateColumnUniqueName="TemplateColumn2"><ItemTemplate><%#Eval("ShipCountry") %></ItemTemplate><EditItemTemplate><telerik:RadDropDownListID="RadDropDownList1"runat="server"OnDataBinding="RadDropDownList1_DataBinding"SelectedValue='<%# Bind("ShipCountry") %>'></telerik:RadDropDownList></EditItemTemplate></telerik:GridTemplateColumn>

DataBinding event of the DropDownList

protectedvoidRadDropDownList1_DataBinding(object sender, EventArgs e)
{var ddl = (RadDropDownList)sender;

    ddl.DataSource = ComboDataSource();
    ddl.DataTextField = "ItemText";
    ddl.DataValueField = "ItemId";
}

 

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers.Learn More.

RadGrid latest version item.enable=False does not work

$
0
0

Hi Acadia,

It would be very helpful if you could provide us a little more information about current configuration, such as the Grid markup and code behind code related to it.

For instance, I would need to understand what is in the markup the VB code is trying to access. Based on the code I am assuming there is a Template Column which you would like to access, similar to this example:

<telerik:GridTemplateColumn><ItemTemplate><asp:LabelID="lblEmpMsg"runat="server"></asp:Label></ItemTemplate></telerik:GridTemplateColumn>

 

Please note that the Grid has multiple types of items. HeaderItem, FooterItem, FilterItem, DataItem, etc... and the ItemDataBound applies for all, see Accessing rows.

You will need to apply a condition to the VB code that will check and only run the code for Dataitems, or otherwise, it may cause unexpected behavior.

PublicSub rgbt_ItemDataBound(ByVal sender AsObject, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgbt.ItemDataBound'first you will need to check whether the item is a type of GridDataItem' it could also be an Edit Form when the Grid edits the row..IfTypeOf e.Item Is GridDataItem Then'cast the itemDim item As GridDataItem = CType(e.Item, GridDataItem)Dim lblEmpMsg As Label = CType(e.Item.FindControl("lblEmpMsg"), Label)Dim empMsgVal AsString = lblEmpMsg.TextIf (empMsgVal = ""Or IsDBNull(empMsgVal)) Then
            item.Enabled = TrueElse
            item.Enabled = FalseEndIfEndIfEndSub

 

In addition to the markup I would also need to know which version of the Telerik controls have you upgraded from? That would help me search for changes in between.

 

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers.Learn More.

On expand node throws exception in Lazy Loading Mode

$
0
0

色情洪流

其他所有方法可能是在加载此类报告时隐藏或禁用功能区或功能区选项卡。 

我希望这将是有用的。如有其他问题,请告诉我。

Resources on scheduler

$
0
0

Yes, a timeline view is actually what i want.

I see it's already on the feature requests

thnx

Match remote odata from two sources in one chart

$
0
0

Hi, dev teams!

I have two odata source with data like:

ds1 = [id, title] - unique entities here

ds2 = [id,year,value] - multiples entities

 

I need *title*(ds1) for axeY and *year*(ds2),*value*(ds2) for axeX

So, how i can match this data to one chart by *id*?

 

ScheduleView Problem

$
0
0

Hello guo,

Thank you for the provided additional information.

RadScheduleView control does not support such layout of its items by default. A possible workaround is to add dummy appointments with a white background as you have done in your application, but still, you will need to add a lot of empty appointments, which could lead to performance issues. 

The visualization which you are trying to achieve looks similar to our RadGanttView control. You can get familiar with this control through its documentation. I hope this control will work for you.

Regards,
Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

Loading Chart crashes on iOS - InvalidCastException

$
0
0

Hi Ian,

I checked the issue discussed in this thread and actually it occurred with an upgrade of Visual Studio 2019 - customers started to experience the exception after upgrading to VS 2019 16.3.1. It seems something has changed in msbuild with that version and our dev team managed to adapt our code to the changes with 2019.2.1004 minor release, so that it handles the scenario correctly.

I am sorry for the caused inconvenience.

Regards,
Yana
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

compare value of two radnumeric with comparevalidator

$
0
0

Dear All,

 

i am trying to create form as amount inputter, using RadNumericText and CompareValidator (to compare min max value between RadNumeric) through code behind. CompareValidator work perfectly where value of RadNumeric doesn't contain digit behind commas (attached images : data no 1), but, when i'm inputted value with commas, it's doesn't working as expected, as shown in the attached images.

No         City               Min                     Max

1            Aceh             $ 100.001,00      $ 100.000,00

                                                               *Amount min cannot be greater than amount max

2.           Yogya           $ 100.000,00      $ 100.000,00

 

3.           Banten         $ 100.000,88      $ 100.000,99

                                                             *Amount min cannot be greater than amount max

 

From data above, no 1, CompareValidator working perfectly, but not for data no 3, where value has any digit behind commas. Any advice how to compare min max value with commas at data no 3 ?

 

Regard,

 

Ragil

 

protectedRadNumericTextBox mytextbox;
 
publicvoidInstantiateIn(System.Web.UI.Control container)
{
    mytextbox = newRadNumericTextBox();
    mytextbox.AutoPostBack = false;
    mytextbox.ID = rankName + typeName + "MyTextBox";
    mytextbox.NumberFormat.DecimalDigits = 2;
    mytextbox.NumberFormat.GroupSeparator = ".";
    mytextbox.NumberFormat.DecimalSeparator = ",";
    mytextbox.Type = NumericType.Currency;
    //mytextbox.DataType = "System.Decimal";
 
    reqValid = newRequiredFieldValidator();
    reqValid.ForeColor = System.Drawing.Color.Red;
    reqValid.ErrorMessage = "* Required field";
    reqValid.CssClass = "has-error";
    reqValid.ControlToValidate = rankName + typeName + "MyTextBox";
    reqValid.Display = ValidatorDisplay.Dynamic;
 
    if(typeName == "Max")
    {
        compValid = newCompareValidator();
        compValid.ForeColor = System.Drawing.Color.Red;
        compValid.ErrorMessage = "* Amount Min can not be greater than Amount Max";
        compValid.CssClass = "has-error";
        compValid.Display = ValidatorDisplay.Dynamic;
 
        compValid.ControlToValidate = rankName + "Max"+ "MyTextBox";
        compValid.ControlToCompare = rankName + "Min"+ "MyTextBox";
        compValid.Operator = ValidationCompareOperator.GreaterThanEqual;
        compValid.Type = ValidationDataType.Currency;
        compValid.ValidationGroup = "ValidateAmount";
 
    }
 
    container.Controls.Add(mytextbox);
    container.Controls.Add(reqValid);
 
    if(typeName == "Max")
    {
        container.Controls.Add(compValid);
    }
}

Format property in GridColumnProps is ignored by saveExcel

$
0
0

Hello Natasha,

The Excel export Column options would accept the cell formatting in one of the appropriate for the XLSX formats. Moreover, the format should be passed as a member of the cellOptions field. Having that said, the formatting applied to Grid columns would not be properly understood by the Excel export logic. Here is how the format should be defined instead:

{ field: 'UnitPrice', title: 'Unit Price', cellOptions: { format: "$#,##0.00" } 
}

Here you could find a small StackBlitz sample on the above.

Regards,
Veselin Tsvetanov
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Format property in GridColumnProps is ignored by saveExcel

$
0
0

Thanks a lot Veselin! It works like a charm and the number in the excel remains a number, which is great!

 

Kind regards,

Natasha L

SortOrder is not a Parameter

$
0
0

Hi guys,

after updating the Blazor nuget package to version 2.6.1 the SortOrder property of IGridBoundColumn is missing the [Parameter] attribute.

If i set the SortOrder: 

<GridColumnSortOrder="@Sort.None"Filterable="false"Field="@col.PropertyPath"Title="@col.HeaderText">
    <Template>
        @* Content goes here *@
    </Template>
</GridColumn>

I get the following exception:

2020-01-21 09:47:29.5899|100|WARN|Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer|Unhandled exception rendering component: Object of type 'Telerik.Blazor.Components.GridColumn' has a property matching the name 'SortOrder', but it does not have [ParameterAttribute] or [CascadingParameterAttribute] applied. System.InvalidOperationException: Object of type 'Telerik.Blazor.Components.GridColumn' has a property matching the name 'SortOrder', but it does not have [ParameterAttribute] or [CascadingParameterAttribute] applied.
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.ThrowForUnknownIncomingParameterName(Type targetType, String parameterName)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
   at Microsoft.AspNetCore.Components.ParameterView.SetParameterProperties(Object target)
   at Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(ParameterView parameters)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

 

Is there a new / other way to control sorting of the columns i missed?

Best Regards,

Matt

RadRichTextBox ImageMiniToolBar tooltips not showing correctly

$
0
0

Hi, I have a radRichTextBox, and when I click on an image the ImageMiniToolBar appears but it has nondescript tooltips like System.Windows.Controls.TextBlock. Is there a way to specify each button tooltip?   

export Excel 2016 format

$
0
0

Hello,

You can find  DocumentFormat.OpenXml.dll in C:\Program Files (x86)\Telerik\Reporting R3 2016\Examples\bin.

Note that Telerik.Reporting.OpenXmlRendering.2.7.2.dll and DocumentFormat.OpenXml.dll  version 2.7.2.0 can be found in the installation folder of later versions of Telerik Reporting. In Telerik Reporting R3 2016, probably using these two assemblies will not work because of the issue described in Telerik Reporting R1 2019 fails to load assembly DocumentFormat.OpenXml 2.7.2+ KB article.

Regards,
Neli
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Show all items in list

$
0
0

Hello John,

I am glad to hear that the provided solution helped. 

Regarding to the Clear button, it clears the input field. 

When testing with Device.BeginInvokeOnMainThread the suggestion list is not displayed. So I assume this is a timing issue. I have replaced it with StartTimer. I have tested on my side and when the clear button is clicked the text changed event is fired and the autocompleteview suggestion list is visualized. 

So replace the logic as follow:

elseif (this.currentText.Length == 0)
{   // call showsuggestions when there is no text in the input field
    autoCompleteView.ItemsSource = this.viewModel.Source; Device.StartTimer(TimeSpan.FromMilliseconds(100), () =>
    {
        autoCompleteView.ShowSuggestions();returnfalse;
    });
}

Regards,
Didi
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

savefield for image upload

$
0
0

Hello Laurent,

The Editor's ImageBrowser only exposes the imageBrowser.transport.uploadUrl configuration option to specify the URL which will handle the upload of the new images. If this configuration option is not specified the Upload button will not be displayed. There is no default option available to configure the saveField, like for the Upload widget.

Having said that, a possible workaround could be to configure the Upload widget by attaching an event handler function to the execute event of the Editor. Then when the "insertimage" command is being executed get a reference to the Upload widget and customize the async configuration options of the widget via the setOptions method.

$("#editor").kendoEditor({
...
execute: function(e) {
              setTimeout(function(){if(e.name == "insertimage"){var upload = $('[data-role=upload]').getKendoUpload();
                  upload.setOptions({async:{//set the async configuration as required
                    }
                  })
                }
              },1000)
            }
})

I hope the above helps you achieve the desired result. Let me know if you have further questions.

Regards,
Aleksandar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

TelerikMenu not functioning in the Blazor Project Template

$
0
0

Hello Hassan,

It is good to hear you have a project working.

If you find issue in our template or in our components, don't hesitate to reach out. Adding a runnable sample of the problematic behavior helps a lot in the investigation as it lets me debug instead of guess, which results in more accurate answers.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor

Throw exception on UWP when open popup

$
0
0

Hi,

I have tested our Popup SDK examples and I cannot reproduce the following exception. 

We have recieved similar crash with the RadButrton and RadBorder controls on UWP but not for the RadPopup control. If you have placed inside the popup - RadBorder or RadButton  I suggest you set BorderTickness to 0 and check whetehr the issue will be solved.

If this suggestion does not solve the issue, as a next step, please open a support ticket and attach a repro project there. Also add the following information:

- versions of Xamarin and Telerik used in the project.

- versions of the Windows and Visual Studio.

Regards,
Didi
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Error when using the SyntaxEditor with implicit styles

$
0
0

Hi Vera, thanks for having a look.

I definitely have the Telerik.Windows.SyntaxEditor.Core assembly in the output directory of the project, but there is no direct reference to it in the project because I am using PackageReference for my NuGet packages, not packages.config.

I thought that might be something to do with it, so I tested a new packages.config project instead but I still get the same problem (see the attached screenshot).

So the absolute minimal reproduction steps I can come up with are:

1. Create a new WPF project on .NET 4.7.2 using Visual Studio 2019 (latest version, 16.4.3).

2. Add the NuGet package Telerik.Windows.Controls.SyntaxEditor.for.Wpf 2020.1.115 to the project.

3. Add the NuGet package Telerik.Windows.Themees.Fluent.for.Wpf 2020.1.115 to the project.

4. Paste the resource dictionary references from my original post (wrapped in <ResourceDictionary> and <ResourceDictionary.MergedDictionaries> elements) into <Application.Resources> in App.xaml.

After doing those four steps, I immediately get the error and no amount of building or closing/reopening the solution etc seems to make it go away.

If you still can't reproduce this, then I suppose that it's not that important and you can close this issue, because as I said it doesn't prevent my application from running. It just seems to be a "not real" designer error which is annoying.

Thanks,

Adam

Editor following Html5 form validation

$
0
0

Hi,

I'm currently building a form which includes some basic text inputs and a RTF editor. I use the KendoReact Editor to offer the cool control with nice copy and paste and formatting options.

I understand from your documentation that this control does not support Html5 form validation. In particular, I need to make this rte field required. As the rest of the form follows the html5 form validation (with all the nice UI hints if you try to submit) I'm looking for a way to accomplish the same with the Editor control. Has anyone accomplished this before?

Drawer broken in Internet Explorer 11 (Latest Kendo Build)

$
0
0

Hello,

Thank you for the provided description.

I tried to reproduce the Kendo UI Drawer not opening on Safari on a genuine device and the widget works as expected:

https://demos.telerik.com/aspnet-mvc/drawer/mini

The Kendo UI team tests the widgets in real devices and OS as emulations do not provide a true environment in most cases:

https://docs.telerik.com/kendo-ui/intro/supporting/browser-support#notes-on-web-browser-support

Nonetheless, I did try it out of curiosity but was not able to reproduce it:

In case you find any issues with the widget besides the emulation mode in IE 11, please provide us with details how to reproduce them.

It is important to note that IE 11 is no longer updated by Microsoft(except security updates)

https://support.microsoft.com/en-us/help/17454/lifecycle-faq-internet-explorer

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.
Viewing all 81499 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>