This is a migrated thread and some comments may be shown as answers.

RadCombobox Loading event on RadGridView

3 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gorka S.
Top achievements
Rank 1
Gorka S. asked on 27 Sep 2018, 11:10 AM

Hello,

A multi-selection RadComboBoxis integrated into a cell of a RadGridView in the project that is attached.

The problem I have when trying to add a handle to an event to customize the loading of the multiple values of the RadComboBox.

This code does not work ...

FrameworkElementFactory dateFactory = new FrameworkElementFactory (typeof (RadComboBox), "Target");
dateFactory.SetValue (RadComboBox.AllowMultipleSelectionProperty, true);
dateFactory.SetValue (RadComboBox.ItemsSourceProperty, new List <string> {"DBF", "REP"});

                 // Add handler not rule
                 RoutedEventHandler handler = new RoutedEventHandler (LoadedTarget_RadComboBox);
                 dateFactory.AddHandler (RadComboBox.LoadedEvent, handler, true);



On the other hand, if I add the handler outside of a Grid it works correctly

Thanks in advance.

[I'm attaching the test project code concerning the problem]

3 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 01 Oct 2018, 01:09 PM
Hello Gorka,

I'm afraid I'm unable to find the attached project you're refering to.

As our forum system does not allow attaching files other than images to a reply, may I kindly ask you to open a new support ticket and attach the project there so that I can investigate an further assist you?

Thank you in advance for your cooperation on the matter.

Regards,
Dilyan Traykov
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.
0
Gorka S.
Top achievements
Rank 1
answered on 16 Oct 2018, 09:01 AM
Likewise, I need to add an data annotation to a new grid column dynamically...

>     GridViewDataColumn column = new GridViewDataColumn();
>     column.DataMemberBinding = new Binding(string.Format("Descriptions[{0}]", l));
>     column.Header = l;
>     column.UniqueName = l;
>     ((RadGridView)sender).Columns.Add(column);
>     
>     RequiredAttribute ra = new RequiredAttribute();


Is there any way to do it?    

  thanks in advance
0
Dilyan Traykov
Telerik team
answered on 16 Oct 2018, 03:50 PM
Hello Gorka,

Adding an attribute to the column itself would not be possible. Instead, you can specify the attribute on the bound data property.

Alternatively, you can handle the CellValidating event and do the required validation manually.

Please let me know if you find any of these approaches applicable.

Regards,
Dilyan Traykov
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.
Tags
GridView
Asked by
Gorka S.
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Gorka S.
Top achievements
Rank 1
Share this question
or