Telerik Forums
UI for WPF Forum
5 answers
1.4K+ 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
336 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
142 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
288 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
136 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
144 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
315 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
378 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
321 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
3 answers
206 views
I want to implement the following features using the Schedule View, Is there an example that can help me.

- Display specific dates for a resource for ex (calendar should display 17th Oct, 1st Nov and 25 Nov)
- I also have to do that same for multiple resources for ex calendar should display (For resource 1 -- 17th Oct and 1st Nov) (For resource 2 -- 20 Dec)
- Want to display a custom range, the user will be able to say show me calendar for next 4,5,7,10 days or show me calendar from 17 - 22

I believe if there is way to do the first 2 i should be able to use that to implement the last feature.

Thanks
vikas


Vikas
Top achievements
Rank 1
 answered on 23 Oct 2014
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?