I'm having an issue with the RadMultiColumnComboBox where it accepts returns, so it grows the field when it shouldn't. I tried this but it had no effect:
private void MultiColumnComboBox_Loaded(object sender, RoutedEventArgs e)
{
var textBox = MultiColumnComboBox.FindChildByType<TextBox>();
if (textBox != null)
{
textBox.AcceptsReturn = false;
textBox.AcceptsTab = false;
}
}
<!-- Main data grid -->
<telerik:RadGridView
Name="GridView"
Grid.Row="1"
Margin="3"
DataContext="{Binding Requests}"
ItemsSource="{Binding}"
ShowGroupPanel="False"
SelectionMode="Multiple"
SelectionUnit="FullRow"
>
<telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Id}" Header="{DynamicResource 100314}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Branch}" Header="{DynamicResource 100214}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=OperName}" Header="{DynamicResource 100315}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=OperRefer}" Header="{DynamicResource 100316}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CrtUsr}" Header="{DynamicResource 100317}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CrtDtm}" Header="{DynamicResource 100318}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SndUsr}" Header="{DynamicResource 100319}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SndDtm}" Header="{DynamicResource 100320}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Status}" Header="{DynamicResource 100242}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Remark}" Header="{DynamicResource 100114}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RetCode}" Header="{DynamicResource 100321}" />
</telerik:RadGridView.Columns>
<telerik:EventToCommandBehavior.EventBindings>
<!-- Scroll event (RowLoaded) -->
<telerik:EventBinding
Command="{Binding DataContext.ScrollCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
EventName="RowLoaded"
PassEventArgsToCommand="True"
RaiseOnHandledEvents="True" />
</telerik:EventToCommandBehavior.EventBindings>
</telerik:RadGridView>
Is it possible to have the RadCalendar inside the RadDatePicker and RadDateRangePicker to have a different theme than the RadDatePicker and the RadDateRangePicker?
I tried setting this within the RadDatePicker control's xaml:
<telerik:RadDateTimePicker.CalendarStyle>
<Style TargetType="telerik:RadCalendar">
<Setter Property="telerik:StyleManager.Theme"
Value="Windows11" />
</Style>
</telerik:RadDateTimePicker.CalendarStyle>
...but it has no effect.
There is the a form:
| Segment | TimeIn | TimeOut | Duration |
| 1 | XX:XX:XX:XX | XX:XX:XX:XX | XX:XX:XX:XX |
| 2 | XX:XX:XX:XX | XX:XX:XX:XX | XX:XX:XX:XX |
| 3 | XX:XX:XX:XX | XX:XX:XX:XX | XX:XX:XX:XX |
| 4 | XX:XX:XX:XX | XX:XX:XX:XX | XX:XX:XX:XX |
The number of Segment depends on how many xml file is found. I want to limited the information cannot be empty in middle (without the 1st seg1 and last seg4). How can I set get these middle segment number? My way is using SegmentNo.Text <> 1 and SegmentNo.Text <> last. However it can't use ".last". How can I get the last row's Segment No?
For Each r As GridDataItem In gridSegment.Items
If FileName.Text <> "" Then
// Red the textbox if data is missing
Else
If timeIn.Text = "" AND timeOut.Text = "" AND Duration.Text = "" Then
If Segment.Text <> 1 AND Segment.Text <> ??? Then
// Red that row all textbox
End If
End If
End If
Next
Hello dear community.
We have a problem, which results in references not being cleaned up properly and the memory leaking over time.
The application works like this:
We have a RadTabbedWindow, with RadTabItems. Those RadTabItems have Views with ViewModels (MVVM), injected via PRISM.
Now when we close the tab, the view is not unloaded or garbage collected. When analysed with Resharper DotMemory, you can see that in this example the StyleSelectors or the ResourceDictionarys keep it referenced and thus not allowing it to be collected.
To find a Solution to the problem, we have broken down the control to the most simple elements (Simplified ScheduleView.txt). When tested, we noticed that Events and StyleSelectors are keeping the items referenced. So we wrote an UnloadBehavior (which is executed when closing the tab). There is a lot more code in it, handling other stuff, but in the uploaded file (UnloadBehavior.txt) I have only left the stuff regarding this particular case.
You can see in MasterViewTop1.png (1 being the top, 2 the middle, 3 the bottom) the reference path.
In this particular code, the two StyleSelectors:
GroupHeaderStyleSelector
AppointmentStyleSelector
hinder the cleaning up.
When I give the RadScheduleView a x:Name Property and use them in code behind to set those StyleSelectors to null, it gets unloaded. Example: ObjectName.GroupHeaderStyleSelector = null;
But our application is gonna be big and we need a general solution. We don't want to give each object a name and unload StyleSelectors, Events, etc.. in the code-behind and set them to null. We need a general solution.
I can assure that neither the ViewModel, nor the code-behind is at fault. At this particular case, it's just those two StyleSelectors. I know about events, because the RadTimeBar causes the same problem, but with the VisiblePeriodChanged property, which is an event. But we want to solve this step first, which will probably solve all other problems, too. We just need to understand what has gone wrong.
Does anybody have an idea what can be done or what is wrong with the code?
I can guarantee that the UnloadBehavior is executed and reaches the DependencyProperties of the RadScheduleView and also sets them to null. But for some reason the objects and the view stay in the memory, even though they don't when I manually do it in the code-behind.
To summarise:
- We need a general solution to unload Telerik objects and clear up references for Events, StyleSelectors and everything referencing and locking the UserControl to be garbage collected.
- When done in Code-Behind it works, but when done in the UnloadBehavior nothing happens.
Hello everyone!
I want to let my users display a Speed field: this will be a custom field, of course Speed = Distance / Time.
The problem I have is that some of my records are incomplete (have only either distance or time populated), but those records are still being used.
From what I understand, when I get an aggregate value the aggregation function is always set to sum, and incomplete records are still being put into the sum function (even if the other value is null).
I would like to be able to do both of these:
Thanks for your input!
public class CalculatedSpeedCalculatedField : CalculatedField
{
private RequiredField distance;
private RequiredField time;
public CalculatedSpeedCalculatedField()
{
this.Name = "CustomCalculatedSpeed";
this.DisplayName = "Custom Calculated Speed";
this.distance = RequiredField.ForProperty("distance");
this.time = RequiredField.ForProperty("time");
}
protected override IEnumerable<RequiredField> RequiredFields()
{
return new List<RequiredField>
{
this.distance,
this.time,
};
}
protected override AggregateValue CalculateValue(IAggregateValues aggregateValues)
{
var aggregateDistance = aggregateValues.GetAggregateValue(this.distance);
var aggregateTime = aggregateValues.GetAggregateValue(this.time);
if (aggregateDistance.IsError())
{
return aggregateDistance;
}
else if (aggregateTime.IsError())
{
return aggregateTime;
}
double dist = aggregateDistance.ConvertOrDefault<double>();
double tim = aggregateTime.ConvertOrDefault<double>();
return new DoubleAggregateValue(dist / tim);
}
}
Hi,
I have a radgridview which I have configured to sort using "telerik.RadGridView.SortDescriptors" based on whether a checkbox is tick or untick. However, upon ticking/unticking the checkbox, the radgridview does not sort based on the condition that I have specified. May I ask for the solution for this?