Telerik Forums
UI for WPF Forum
2 answers
218 views
Hi, I'm grouping my list of values from an object. 
This object might be one of these 3 classes: Class1, Calss2, Calss3. This is working.

I followed your sample: http://www.telerik.com/forums/group-header-style for a custom header template.

But when I'm selecting the template from each group header I find the string "Class1", "Calss2", "Calss3" instead of its real value.

What am I doing wrong? Am I missing something?
Martin Ivanov
Telerik team
 answered on 24 Oct 2014
5 answers
1.3K+ views

What I try to achieve is to apply a filter to my RadGridView whenever user checks / unchecks a checkbox (pretty straightforward, right?). My code works fine when I set the AutoGenerateColumns flag of my gridview to True, but does nothing when I switch the flag to False (the IsActive flag of my ColumnFilterDescriptor never changes to True). I need to apply a specific template to my columns so the AutoGenerateColumns flag has to be False. Both of the columns I try to filter have the IsFilterable flag to True and are binded to a string (and not a custom defined class). Here is my RadGridView:

<Merging:RadGridViewWithSelectedItemsEditable
      x:Name="SelectedUserAttributesGridView"
      Grid.Row="0"
           ItemsSource="{Binding MergeDetailsViewModel}" 
      AutoGenerateColumns="False" 
           VerticalAlignment="Top" 
           CanUserDeleteRows="False"
           CanUserFreezeColumns="False"
           SelectionMode="Extended"
      ScrollMode="Deferred"                          
      CanUserInsertRows="False" 
      CanUserReorderColumns="True" 
      CanUserResizeColumns="True" 
      CanUserSelect="False" 
      CanUserSortColumns="False" 
      ShowGroupPanel="False" 
      FrozenColumnsSplitterVisibility="Hidden" 
      GridLinesVisibility="None"                             
      RowIndicatorVisibility="Collapsed"                    
      IsEnabled="{Binding MergeDetailsEnabled}">
 
                   <Merging:RadGridViewWithSelectedItemsEditable.Columns>
                       <telerik:GridViewColumn Header="Well">
                           <telerik:GridViewColumn.CellTemplate>
                               <DataTemplate>
                                   <TextBlock VerticalAlignment="Center" Margin="3,0,3,0" Text="{Binding WellName}"  />
                               </DataTemplate>
                           </telerik:GridViewColumn.CellTemplate>
                       </telerik:GridViewColumn>
                       <telerik:GridViewColumn Header="UWI">
                           <telerik:GridViewColumn.CellTemplate>
                               <DataTemplate>
                                   <TextBlock VerticalAlignment="Center" Margin="3,0,3,0" Text="{Binding UWI}"  />
                               </DataTemplate>
                           </telerik:GridViewColumn.CellTemplate>
                       </telerik:GridViewColumn>
                       <telerik:GridViewColumn Header="{Binding SelectedAttributes[0].Name}" IsFilterable="True">
                           <telerik:GridViewColumn.CellTemplate>
                               <DataTemplate>
                                   <TextBlock VerticalAlignment="Center" Margin="3,0,3,0" Text="{Binding FirstSelectedAttributeValue}"  />
                               </DataTemplate>
                           </telerik:GridViewColumn.CellTemplate>                            
                       </telerik:GridViewColumn>
                       <telerik:GridViewColumn Header="{Binding SelectedAttributes[1].Name}" IsFilterable="True">
                           <telerik:GridViewColumn.CellTemplate>
                               <DataTemplate>
                                   <TextBlock VerticalAlignment="Center" Margin="3,0,3,0" Text="{Binding SecondSelectedAttributeValue}"  />
                               </DataTemplate>
                           </telerik:GridViewColumn.CellTemplate>
                       </telerik:GridViewColumn>
                       <telerik:GridViewColumn Header="Preview">
                           <telerik:GridViewColumn.CellTemplate>
                               <DataTemplate>
                                   <TextBlock VerticalAlignment="Center" Margin="3,0,3,0" Text="{Binding Preview}"  />
                               </DataTemplate>
                           </telerik:GridViewColumn.CellTemplate>
                       </telerik:GridViewColumn>
                   </Merging:RadGridViewWithSelectedItemsEditable.Columns>                   
                     
               </Merging:RadGridViewWithSelectedItemsEditable>

where FirstSelectedAttributeValue and SecondSelectedAttributeValue are both string properties of my class Well, and MergeDetailsViewModel an ObservableCollection<Well>.

Here is the code of the event handler for the checkbox that applies the filter:

private void CheckBoxClicked(object sender, RoutedEventArgs e)
{
    if (ShowHideNullValuesButton.IsChecked != null && (bool)ShowHideNullValuesButton.IsChecked)
    {
        ApplyNonNullFilter(2);
        ApplyNonNullFilter(3);             
    }
    else
        SelectedUserAttributesGridView.FilterDescriptors.Clear();
}
private void ApplyNonNullFilter(int columnIndex)
{
    Telerik.Windows.Controls.GridViewColumn attributeValueColumn =
  SelectedUserAttributesGridView.Columns[columnIndex];
    IColumnFilterDescriptor attributeValueColumnFilter =
  attributeValueColumn.ColumnFilterDescriptor;
    attributeValueColumnFilter.SuspendNotifications();
    attributeValueColumnFilter.FieldFilter.Filter1.Operator = FilterOperator.IsNotEqualTo;
    attributeValueColumnFilter.FieldFilter.Filter1.Value = "NaN";
    attributeValueColumnFilter.FieldFilter.Filter1.IsCaseSensitive = true;
    attributeValueColumnFilter.ResumeNotifications();
}

What am I missing? Why filtering fails? Btw, I don't get any errors or exceptions when building and running the code. Thanks.
Dimitrina
Telerik team
 answered on 24 Oct 2014
5 answers
296 views
Hi,

I have a radmaskednumericinput which is binded two way to a property, but there is a problem, when focusing the textbox, the value from code is overided with zero.

Thanks,
Rachel.
Milena
Telerik team
 answered on 24 Oct 2014
1 answer
118 views
There is an IsDropAllowed property but no IsDragAllowed, have I missed it or an equivalent property or will I have to revert to a coding solution?

Thank you,
Martin Ivanov
Telerik team
 answered on 24 Oct 2014
7 answers
256 views
Hi,

I need DateTimeCategoricalAxis.MajorTickInterval's value is dynamic.

For examaple:
I have a list binding with a LineSeries. the list's count are dynamic.
When the number of list is extremely small or large, it will be necessary to set the value of MajorTickIntrval dynamic.
So, the DateTimeCategoricalAxis.MajorTickInterval's value need to changed with List.count.
like:
//Count: List's count
//MajorStepNum: How many labels are there below the X axis.
MajorTickInterval = Count / MajorStepNum > 1 ? Count / MajorStepNum + 1 : 1;

But the DateTimeCategoricalAxis.MajorTickInterval can not be Binding.(will thrown an exception)
So, have other way can be done this? (Except for the assignment MajorTickInterval)

Thanks
Petar Marchev
Telerik team
 answered on 24 Oct 2014
1 answer
110 views
I have implemented a custom resizing service as per your guide http://www.telerik.com/help/wpf/raddiagram-howto-customize-resizing.html. However i wonder if it is possible to disable the small corners so that users dont try and resize shapes that cant be resized.
Zarko
Telerik team
 answered on 24 Oct 2014
3 answers
121 views
I have a GridView (WPF 4.5, Q2 2013) that has another GridView in its RowDetailsTemplate. When I set the width to "*" on any columns of the second RadGridView, the DetailsPresenter gets extremely long (about 10000 px), even though I only have two columns that should fit on the screen.

I found a strange solution: in a new style for RadGridView, if I wrap the GridViewVirtualizingPanel in a Grid and apply it to "SecondGridView" in the RowDetailsTemplate, the columns size normally. I am hesitant to do this because I don't understand why it works; is there a better way?

Here is what I am working with, where the columns get really long:

<DataTemplate x:Key="MyRowDetailsTemplate" >
        <Border >
            <controls3:RadGridView x:Name="SecondGridView" ItemsSource="{Binding MoreItems}">
                    <controls3:RadGridView.Columns>
                        <controls3:GridViewDataColumn Width="*"
                                                      MinWidth="200"
                                                      Header="Name" />
                        <controls3:GridViewDataColumn Width="75"
                                                      MinWidth="75"
                                                      Header="Status" />
                    </controls3:RadGridView.Columns>
                </controls3:RadGridView>
        </Border>
    </DataTemplate>
 
<controls:RadGridView Name="TemplateRoot"
                                      ItemsSource="{Binding MyItems}"
                                      RowDetailsTemplate="{DynamicResource MyRowDetailsTemplate}">
                    <controls:RadGridView.Columns>
                        <controls:GridViewDataColumn Width="*"
                                                     MinWidth="200"
                                                     Header="Name"/>
                        <controls:GridViewDataColumn Width="75"
                                                     MinWidth="75"
                                                     Header="Status"/>
                    </controls:RadGridView.Columns>
</controls:RadGridView>
Dimitrina
Telerik team
 answered on 24 Oct 2014
1 answer
279 views

Hello,

I have an application with a radspreadsheet and a button. When i click the button with the cell in edit mode (i have the cursor of the mouse inside it) i cant get the new value of the cell. Is there any way to end the edit mode of the current cell?.

When i write on C2 "1" ,exit the cell and click on save i get "1".


Then, when i write on C2 "2" , and click on save without exit the cell i still get "1" instead of "2".


Thanks!














Anna
Telerik team
 answered on 24 Oct 2014
4 answers
344 views
Hi Telerik,

I have this RadGridView:

<telerik:RadGridView IsFilteringAllowed="False" BorderBrush="#9AB400" Name="gridView" Grid.Column="0" ItemsSource="{Binding ChamberMeasurements}" AutoGenerateColumns="True" Margin="120,10,12,0" VerticalAlignment="Top" ShowGroupPanel="False">
</telerik:RadGridView>

When i click a row in the table created by the RadGridView then the selected row is not highlighted and i don't understand why. Should i set the color of the selected row somehow?

The ChamberMeasurements property is of type DataTable.

Can you tell me if i am doing something wrong or missing something?

Best regards,
Jeppe
Unisense
Top achievements
Rank 1
 answered on 24 Oct 2014
3 answers
285 views
Hi everyone,

I'm using two Telerik NumericUpDown controllers (lets say A and B)

If A is edited B is set to 0

If B is edited A is set to B.Value * Variable

If I use only the ValueChanged event I'm not able to implement this.

Is it possible to capture arrowUp or arrowDown clik events?


Thanks everyone, I hope I made myself clear, sorry if not it's my first post here.
Pooja
Top achievements
Rank 1
 answered on 23 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?