Telerik Forums
UI for WPF Forum
7 answers
558 views

Hi, I've got a grid where one of my columns shows an alphanumeric id and I want to sort the numbers correctly so I've implemented manual sorting. The bound data comes from a DataTable so I don't have a viewmodel for the rows. My sorting code, which I've hooked up to the Sorting-event, looks something like this:

private void OnGridViewSorting(object sender, GridViewSortingEventArgs e)
{
  if (e.Column.IsCustomSortingEnabled)
  {
    var dataView = (DataView)e.DataControl.ItemsSource;
    if (e.NewSortingState == SortingState.None)
    {
      // TODO: We should maybe reset sorting, not just return here.
      return;
    }
        
    if (dataView.Table.Rows.Count > 0)
    {
      e.Cancel = true;
      DataTable dtNew;
      if (e.OldSortingState == SortingState.None)
      {
        e.NewSortingState = SortingState.Ascending;
        dtNew = dataView.Table.AsEnumerable().OrderBy(x => (string)x[e.Column.Name], GenericStringLogicalComparer.Default).CopyToDataTable();
      }
      else
      {
        e.NewSortingState = SortingState.Descending;
        dtNew = dataView.Table.AsEnumerable().OrderByDescending(x => (string)x[e.Column.Name], GenericStringLogicalComparer.Default).CopyToDataTable();
      }
      var existingDataView = (DataView)this.ItemsSource;
      for (int n = 0; n < existingDataView.Table.Rows.Count; ++n)
      {
        // Just copy the item array instead of rebuilding table
        existingDataView.Table.Rows[n].ItemArray = dtNew.Rows[n].ItemArray;
      }
      existingDataView.Table.AcceptChanges();
    }
  }
}

 

But I have two issues:

  1. When sorting on several columns I want to manage the sorting indices showing in the column headers, but I don't know how. It seems like they correspond to what's in the SortDescriptors collection. But I can't really edit the descriptors without adding some other sorting, can I? Is there some way to manually update the indices? Or set the SortDescriptors without really add another sort.
  2. We can store the state of grids to user-defined views, and do this by using the PersistenceManager to get xml describing the state of the grid. But since the sorting is defined by the SortDescriptors collection our manually sorting is not exported to xml.

I guess that both problems is about how I should edit the SortDescriptors when using the Sorting event.

Martin Ivanov
Telerik team
 answered on 19 Sep 2019
1 answer
2.9K+ views

I want to remove the "Select All" option from multi select check box filter in kendo grid view, when there is no data to be shown on UI or when grid is empty.

Any setting i can do to do so?

Nikolay
Telerik team
 answered on 18 Sep 2019
3 answers
636 views

Hello

We are facing the challenge, to present tasks to our customers.
Each task can consist out of n tasks, but can also stand alone. These child-tasks should be displayed in a hierarchical manner and must be searchable (down to the tree-leaves).

Now we have been wondering if it's easier to build a hierarchy in a GridView, where the Search is implemented, or use the TreeListView, which meets our hierarchical needs.
Since the hierarchical GridView creates new Grids for each hierarchy-level, it seems quiet challenging for me, too.

For the TreeView, you are providing an search-example:
https://docs.telerik.com/devtools/wpf/controls/radtreeview/how-to/implement-search-filter-sort
can this be adopted for the TreeListView?
I'm also wondering, if the search-box from GridView is accessible somehow in the TreeListView somehow.

So our main-concern is, which control is the way to go?

We are grateful for any advice you can give us.

Best Regards

Nico

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Sep 2019
4 answers
484 views

Hi,

I'm currently setting my ItemsSource for my RadGrid to be of type QueryableCollectionView

 

I also set the selecteditem to be of type IDTO. 

 

When I use an QueryableCollectionView, by default, SelectedItem is set to the first item in the collection. If I were to use an ObservableCollection, it's completely fine, SelectedItem is empty until an item is selected. May I ask how do I set it so the QueryableCollectionView doesn't set the value by default. 

 
Vladimir Stoyanov
Telerik team
 answered on 18 Sep 2019
1 answer
220 views

Hi Team,

I am facing an issue with Ribbonview during design time I can not see the ribbon control.

Scenario:

I have created a user control as a container for my Ribbonview. During design time we need to specify the height of that container user control to more than 250 like 251 in order to see this control during design time.

Dimitar Dinev
Telerik team
 answered on 18 Sep 2019
1 answer
68 views

<telerik:RadGridView.FilterDescriptors>   

     <telerik:CompositeFilterDescriptor LogicalOperator="Or">       

          <telerik:CompositeFilterDescriptor.FilterDescriptors>             

               <telerik:FilterDescriptor Member="Hardcoded" Operator="IsEqualTo" Value="false"/>        

          </telerik:CompositeFilterDescriptor.FilterDescriptors>   

     </telerik:CompositeFilterDescriptor>

</telerik:RadGridView.FilterDescriptors>

Dimitar Dinev
Telerik team
 answered on 18 Sep 2019
5 answers
151 views

When the editor becomes active, the contextualgroup IsActive is set to true and RibbonTab appear visible. When user selects it, it looks like in "before" picture. Everything ok. But when in this time the editor is closed, IsActive is set to false, but no other RibbonTab is automatically selected and in appears like in "after" picture. In the samples, i have not seen any special source code to select to another RibbonTab in this case. What is necessary to do in this case and how to define RibbonTab to be selected when ContextualGroup.IsActive is set to false?

 

Thanks, Ivo Kovacka

 

 

Martin Ivanov
Telerik team
 answered on 18 Sep 2019
7 answers
909 views

Hi,

I need to hide a RadWindow completely and have tried multiple ways but they do not give the expected result. In fact, I have tried minimizing the window and hiding the icon from the taskbar (but I haven't found such a method in the documentation), or setting the visibility to Hidden but none of those completely hide the Window. How is it possible to hide a window, other than by closing it?

Kind regards,

Alexandre

Martin Ivanov
Telerik team
 answered on 18 Sep 2019
12 answers
441 views

telerik version - 2018.2.515.40

Check box tick color in GridViewCheckBoxColumn does not react to Expression Dark theme when it is in view mode.

<telerik:GridViewCheckBoxColumn Header="{Binding OperatorCaption, Mode=OneWay}" DataMemberBinding="{Binding opr}"/>
<telerik:GridViewCheckBoxColumn Header="{Binding TechnicianCaption, Mode=OneWay}" DataMemberBinding="{Binding technician}"/>
<telerik:GridViewCheckBoxColumn Header="{Binding EngineerCaption, Mode=OneWay}" DataMemberBinding="{Binding engineer}"/>
<telerik:GridViewCheckBoxColumn Header="{Binding AdminCaption, Mode=OneWay}" DataMemberBinding="{Binding administrator}"/>
Vladimir Stoyanov
Telerik team
 answered on 17 Sep 2019
1 answer
132 views

I have a RadComboBox trying out the new AllowMultipleSelection feature but the problem is that it keeps auto-selecting an item in the ItemsSource on first display even though the control was initialized to have nothing selected and the user never had a chance to select anything. The SelectionChanged event doesn't capture this first stealth selection so all my viewmodel selection state is screwed up.

 

Is there a way to stop it?

Dilyan Traykov
Telerik team
 answered on 17 Sep 2019
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
PersistenceFramework
DataPager
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?