diff --git a/Readme.md b/Readme.md index c42384e..c179a31 100644 --- a/Readme.md +++ b/Readme.md @@ -1,20 +1,19 @@ - -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128652847/21.1.5%2B) -[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E1920) -[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) - - -*Files to look at*: - -* [Products.cs](./CS/DXGrid_SelectRows/Products.cs) (VB: [Products.vb](./VB/DXGrid_SelectRows/Products.vb)) -* [Window1.xaml](./CS/DXGrid_SelectRows/Window1.xaml) (VB: [Window1.xaml](./VB/DXGrid_SelectRows/Window1.xaml)) -* [Window1.xaml.cs](./CS/DXGrid_SelectRows/Window1.xaml.cs) (VB: [Window1.xaml.vb](./VB/DXGrid_SelectRows/Window1.xaml.vb)) - -# How to select rows that contain the specified value - - -

This example shows how to select rows whose 'UnitPrice' column contains a value equal to or greater than 20. To select rows, click the 'Select' button.

- -
- - + +[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E1920) +[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) + + +*Files to look at*: + +* [Products.cs](./CS/DXGrid_SelectRows/Products.cs) (VB: [Products.vb](./VB/DXGrid_SelectRows/Products.vb)) +* [Window1.xaml](./CS/DXGrid_SelectRows/Window1.xaml) (VB: [Window1.xaml](./VB/DXGrid_SelectRows/Window1.xaml)) +* [Window1.xaml.cs](./CS/DXGrid_SelectRows/Window1.xaml.cs) (VB: [Window1.xaml.vb](./VB/DXGrid_SelectRows/Window1.xaml.vb)) + +# How to select rows that contain the specified value + + +

This example shows how to select rows whose 'UnitPrice' column contains a value equal to or greater than 20. To select rows, click the 'Select' button.

+ +
+ + diff --git a/VB/DXGrid_SelectRows.Net5.sln b/VB/DXGrid_SelectRows.Net5.sln index 7d2af25..3da6720 100644 --- a/VB/DXGrid_SelectRows.Net5.sln +++ b/VB/DXGrid_SelectRows.Net5.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 +Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 16 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DXGrid_SelectRows", "DXGrid_SelectRows\DXGrid_SelectRows.Net5.vbproj", "{B77F63EB-3F21-4AAF-88D9-6DE26A04E6F9}" EndProject diff --git a/VB/DXGrid_SelectRows.sln b/VB/DXGrid_SelectRows.sln index a106f59..1f71f80 100644 --- a/VB/DXGrid_SelectRows.sln +++ b/VB/DXGrid_SelectRows.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 +Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DXGrid_SelectRows", "DXGrid_SelectRows\DXGrid_SelectRows.vbproj", "{B77F63EB-3F21-4AAF-88D9-6DE26A04E6F9}" EndProject diff --git a/VB/DXGrid_SelectRows/App.xaml b/VB/DXGrid_SelectRows/App.xaml new file mode 100644 index 0000000..90d9901 --- /dev/null +++ b/VB/DXGrid_SelectRows/App.xaml @@ -0,0 +1,5 @@ + + + + + diff --git a/VB/DXGrid_SelectRows/App.xaml.vb b/VB/DXGrid_SelectRows/App.xaml.vb new file mode 100644 index 0000000..31f5096 --- /dev/null +++ b/VB/DXGrid_SelectRows/App.xaml.vb @@ -0,0 +1,12 @@ +Imports System.Windows + +Namespace DXGrid_SelectRows + + ''' + ''' Interaction logic for App.xaml + ''' + Public Partial Class App + Inherits Application + + End Class +End Namespace diff --git a/VB/DXGrid_SelectRows/DXGrid_SelectRows.Net5.vbproj b/VB/DXGrid_SelectRows/DXGrid_SelectRows.Net5.vbproj index f538899..b498e4d 100644 --- a/VB/DXGrid_SelectRows/DXGrid_SelectRows.Net5.vbproj +++ b/VB/DXGrid_SelectRows/DXGrid_SelectRows.Net5.vbproj @@ -1,22 +1,23 @@ + On net5.0-windows WinExe - + + DXGrid_SelectRows false true true x86;AnyCPU false - obj*/** - On - Binary - Off - On + false - + + + + @@ -33,4 +34,4 @@ - + \ No newline at end of file diff --git a/VB/DXGrid_SelectRows/DXGrid_SelectRows.vbproj b/VB/DXGrid_SelectRows/DXGrid_SelectRows.vbproj index 869c356..827c74c 100644 --- a/VB/DXGrid_SelectRows/DXGrid_SelectRows.vbproj +++ b/VB/DXGrid_SelectRows/DXGrid_SelectRows.vbproj @@ -1,62 +1,40 @@ - + + On Debug AnyCPU 9.0.30729 2.0 {B77F63EB-3F21-4AAF-88D9-6DE26A04E6F9} WinExe - + Properties + + DXGrid_SelectRows v4.5.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + 4 obj.NetFX - On - Binary - Off - On true full false bin\Debug\ - true - true + DEBUG,TRACE prompt - true + 4 pdbonly true bin\Release\ - false - true + TRACE prompt - true + 4 - - - - - - - - - - - - - - - - - - - - @@ -95,7 +73,7 @@ - + MSBuild:Compile Designer @@ -103,10 +81,11 @@ MSBuild:Compile Designer - - Application.xaml + + App.xaml Code + Window1.xaml Code @@ -114,33 +93,32 @@ - + Code - + True True Resources.resx - + True Settings.settings True - - VbMyResourcesResXFileCodeGenerator + + ResXFileCodeGenerator Resources.Designer.vb - My.Resources + DXGrid_SelectRows.Properties - + SettingsSingleFileGenerator Settings.Designer.vb - My - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VB/DXGrid_SelectRows/Properties/Settings.Designer.vb b/VB/DXGrid_SelectRows/Properties/Settings.Designer.vb new file mode 100644 index 0000000..070fffa --- /dev/null +++ b/VB/DXGrid_SelectRows/Properties/Settings.Designer.vb @@ -0,0 +1,25 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3603 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ +Namespace DXGrid_SelectRows.Properties + + + + Friend NotInheritable Partial Class Settings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As DXGrid_SelectRows.Properties.Settings = CType((Global.System.Configuration.ApplicationSettingsBase.Synchronized(New DXGrid_SelectRows.Properties.Settings())), DXGrid_SelectRows.Properties.Settings) + + Public Shared ReadOnly Property [Default] As Settings + Get + Return DXGrid_SelectRows.Properties.Settings.defaultInstance + End Get + End Property + End Class +End Namespace diff --git a/VB/DXGrid_SelectRows/Properties/Settings.settings b/VB/DXGrid_SelectRows/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/VB/DXGrid_SelectRows/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/VB/DXGrid_SelectRows/ViewModel.vb b/VB/DXGrid_SelectRows/ViewModel.vb new file mode 100644 index 0000000..4fe893e --- /dev/null +++ b/VB/DXGrid_SelectRows/ViewModel.vb @@ -0,0 +1,46 @@ +Imports DevExpress.Mvvm +Imports DevExpress.Mvvm.DataAnnotations +Imports System.Collections.ObjectModel +Imports System.Linq + +Namespace DXGrid_SelectRows + + Public Class ViewModel + Inherits ViewModelBase + + Public Sub New() + Products = ProductList.GetData() + Selection = New ObservableCollection(Of Product)() From {Products.ElementAt(0)} + End Sub + + Public Property Products As ObservableCollection(Of Product) + Get + Return GetValue(Of ObservableCollection(Of Product))() + End Get + + Set(ByVal value As ObservableCollection(Of Product)) + SetValue(value) + End Set + End Property + + Public Property Selection As ObservableCollection(Of Product) + Get + Return GetValue(Of ObservableCollection(Of Product))() + End Get + + Set(ByVal value As ObservableCollection(Of Product)) + SetValue(value) + End Set + End Property + + + Public Sub SelectRows(ByVal textValue As String) + Dim value = Double.Parse(textValue) + Selection = New ObservableCollection(Of Product)(From item In Products Where item.UnitPrice >= value Select item) + End Sub + + Public Function CanSelectRows(ByVal textValue As String) As Boolean + Return Double.TryParse(textValue, Nothing) + End Function + End Class +End Namespace diff --git a/VB/DXGrid_SelectRows/Window1.xaml b/VB/DXGrid_SelectRows/Window1.xaml index 54eb550..8cf2705 100644 --- a/VB/DXGrid_SelectRows/Window1.xaml +++ b/VB/DXGrid_SelectRows/Window1.xaml @@ -1,10 +1,26 @@ - - - + + + + + + + + + + - + -