Questions tagged [dataview]

A dataview is a .net class which represents a databindable, customized view of a DataTable for sorting, filtering, searching, editing, and navigation. The DataView does not store data, but instead represents a connected view of its corresponding DataTable. Changes to the DataView’s data will affect the DataTable. Changes to the DataTable’s data will affect all DataViews associated with it.

A DataView enables you to create different views of the data stored in a DataTable, a capability that is often used in data-binding applications. Using a DataView, you can expose the data in a table with different sort orders, and you can filter the data by row state or based on a filter expression.

A DataView provides a dynamic view of data in the underlying DataTable: the content, ordering, and membership reflect changes as they occur. This behavior differs from the Select method of the DataTable, which returns a DataRow array from a table based on a particular filter and/or sort order: thiscontent reflects changes to the underlying table, but its membership and ordering remain static. The dynamic capabilities of the DataView make it ideal for data-binding applications.

A DataView provides you with a dynamic view of a single set of data, much like a database view, to which you can apply different sorting and filtering criteria. Unlike a database view, however, a DataView cannot be treated as a table and cannot provide a view of joined tables. You also cannot exclude columns that exist in the source table, nor can you append columns, such as computational columns, that do not exist in the source table.

References

723 questions
3
votes
2 answers

New DataView vs. DefaultView of a DataTable

Why would you construct a new DataView instead of using the DefaultView of the DataTable in C#? What are the scenarios creating a new DataView is preferable? What are the advantages and disadvantages of both? var dataView = new…
Brk
  • 478
  • 2
  • 6
  • 17
3
votes
1 answer

How to get size of a DataView type (eg. Uint32=4, Float64=8) to advance the offset?

I'm parsing a serialized object with a DataView and want to be able to increment an offset variable depending on data sizes. I'd rather not redefine variables for simple things like BYTES_PER_UINT16 ... var dv = new DataView(payload); var offset =…
tarabyte
  • 17,837
  • 15
  • 76
  • 117
3
votes
2 answers

How to apply filter to DataView with Multiple "AND" conditions

I have a DataTable containing the some rows. Which is copied to DataView. Now I have IDs in form of List. which contains the selected items from GridView. Now I want to filter this DataView using AND as filter. When I apply just one it…
SHEKHAR SHETE
  • 5,964
  • 15
  • 85
  • 143
3
votes
1 answer

SlickGrid filter not working

I am fairly new to SlickGrid. I am trying to make SlickGrid filter work but no luck. I am following the example (http://mleibman.github.io/SlickGrid/examples/example4-model.html). Below is my source code. $(document).ready(function() { var…
nav
  • 148
  • 2
  • 5
  • 13
3
votes
3 answers

How to set selected row of DataGridView to newly-added row when the grid is bound to sorted DataView?

I have a DataGridView bound to a DataView. The grid can be sorted by the user on any column. I add a row to the grid by calling NewRow on the DataView's underlying DataTable, then adding it to the DataTable's Rows collection. How can I select the…
Phillip Wells
  • 7,402
  • 9
  • 43
  • 41
3
votes
3 answers

DataView LIKE function on Integer value

I have Sql table Tracks which keeps track information such as TrackID and TrackName. I have c# application with textbox and listbox. I use dataSet to retrieve sql table and when I write "3" on textbox, I want to get track names on listbox which has…
Sertan Pekel
  • 593
  • 2
  • 5
  • 23
3
votes
1 answer

discrepancy between Float32Array and DataView

Thought I understood how Float32Array works, but it looks like I'm not quite there. In the simplest example possible: buffer = new ArrayBuffer(128); dataView = new DataView(buffer); floatArray = new Float32Array(buffer); dataView.setFloat32(8,…
Nick
  • 220
  • 1
  • 2
  • 12
3
votes
5 answers

Filtering a empty string in DataTable

How do filter a empty String in DataTable? I need to filter a column (say Customer Name where the name is string.Empty) I tried this but i cant get into right way.. I need to filter the DataView through DataView.RowFilter.. so how to give filter…
Sankarann
  • 2,625
  • 4
  • 22
  • 59
3
votes
0 answers

DataView NullReferenceException in OnListChanged

I have a fairly complex WinForms app that uses data binding to tie strongly typed DataTables to controls (not sure if this fact matters here). An exception gets raised when a change to a column triggers logic that updates another column on that…
Kleinux
  • 1,511
  • 10
  • 22
3
votes
2 answers

DataView RowFilter with TimeSpan DataType

I try to use the DataView RowFilter for a column with DataType "TimeSpan" as following: dv.RowFilter = ("Convert([time],System.String) LIKE '17:12:00'") I've found that the search Parameter "%17% or %12%, for the double Zeros i have to use a single…
3
votes
1 answer

WPF datagrid hide column with dynamic datasource

I'm binding a datagrid to a DataView. I would like to hide the ID column when the data is displayed. The ID column needs to exist in the data as it is used in another part of my code. The ID column is always the first (index 0) column. Am I right…
Jay
  • 2,077
  • 5
  • 24
  • 39
3
votes
1 answer

Injection Attacks against .NET DataView RowFilter

So I'm writing a handler that filters a cached DataTable based on the AppRelativeCurrentExecutionFilePath using the DataView RowFilter property. What's the best way to encode the input to prevent an injection attack? Is the following sufficient? …
MyItchyChin
  • 13,733
  • 1
  • 24
  • 44
3
votes
1 answer

How can i handle mouseclicks of items inside a dataview

each item in my dataview has a text and a div which represents a button. The button is only shown when the mouse is over the item. How can i handle a mouseclick on the button-div? What i have so far is this: xtype: 'dataview', store:…
suamikim
  • 5,350
  • 9
  • 40
  • 75
3
votes
3 answers

Filter number in a DataView using RowFilter in C#4.0

I'm trying to filter my DataView DataSet using RowFilter. I would like to perform a like statement on an Integer column So something like this: myDataView.RowFilter ="ID LIKE %1%"; This works fine for string columns but I receive an error when…
user1131661
  • 229
  • 3
  • 8
  • 19
3
votes
4 answers

Sencha Touch 2 list background change

I have a list within my application, but was wondering if it is possible to have each list displayed show a different background colour, rather than the same one through out each item? I have created a template but would be nice to have the…
Simon Davies
  • 3,668
  • 9
  • 41
  • 69