Click here to Skip to main content
15,896,111 members

WPF RadGridView using datatabel

lean90 asked:

Open original thread
Hi All
I have a radGridView - WPF With
HTML
<telerik:RadGridView Grid.Row="1" Name="grdUpload" FontWeight="Bold" ShowGroupPanel="False" AutoGenerateColumns="true"
 IsReadOnly="True" ShowInsertRow="False"   ItemsSource="{Binding DtRecord, Mode=TwoWay}" SnapsToDevicePixels="False" CanUserFreezeColumns="False" SelectedItem="{Binding DrSelectedData,Mode= Default}" RowStyleSelector="{StaticResource radRowStyle}" />                 

Code by MVVM desgin patten

Description :
DtRecord is a DataTable in View Model
VB
Private m_DtRecord As DataTable
Public Property DtRecord As DataTable
Get
    Return m_DtRecord
End Get
Set(value As DataTable)
    m_DtRecord = value
    OnPropertyChanged("DtRecord")
End Set
End Property

And I have a method for Search Record in DtRecord

VB
Overloads Sub SearchDataLog()
    'TODO: SearchDataLog
     Dim dtSearch As DataTable = m_staticDataTable.Copy()
    'Add new DataTable
    For Each dr As DataRow In listDataRows
        dtSearch.Rows.Add(dtSearch.NewRow())
        For Each cl As DataColumn In dtSearch.Columns
            Dim clName As String = cl.ColumnName
            dtSearch.Rows(dtSearch.Rows.Count - 1)(clName) = dr(clName)
        Next
    Next
    DtRecord = dtSearch
End Sub

listDataRows is an expected list with collection rows

I Work with Follow
Step 1 : Fill data to Gridview --> Displays All record
Step 2 : I Sorting by a Other column --> Order with column
Step 3 : I Search a record dose not exit --> display no once or more Record
Step 4 : I Search a record is exit --> Exception
--> I have an Exception : Cloumns '[ *** ]' Dose not exit .
*** : Is the Column name I sorted

Note : I'm sure DtRecord result Contains column
Message Error : OnpropertyChanged("DtRecord") Rows on my code File
Tags: C#, WPF, WPF Toolkit

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900