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
4
votes
1 answer

Remove empty columns from DataTable/DataView

I have a DataTable that returns data from a stored-procedure (it's generated by a dynamic pivot statement, but I don't think that is relevant). The returned data may have columns without data. How can I generate a DataView at runtime that excludes…
Zev Spitz
  • 13,950
  • 6
  • 64
  • 136
4
votes
4 answers

Missing operand after '=' operator

I have this line of code which uses a dataview view_1 and I'm trying to filter the datagridview by product_name and its size using the RowFilter. Here is the code: view_1.RowFilter = "product_name = '" + cboProduct.Text + "' AND size = " +…
Harvey
  • 399
  • 4
  • 15
  • 31
4
votes
4 answers

How to pull a SQL Server table into memory in order to run queries against it

I'm running > 50K simple selects on a table in sql server and I'd really like to speed it up. I've read that you can pull the data into memory and use something like a dataview to query against. Is there a way to use something in Linq to end up with…
user1266921
  • 225
  • 3
  • 14
3
votes
4 answers

dataview rowfilter value to datatable convertion

I want to convert dataview rowfilter value to datatable. I have a dataset with value. Now i was filter the value using dataview. Now i want to convert dataview filter values to datatable.please help me to copy it........ My partial code is here: …
Fernando
  • 358
  • 3
  • 8
  • 21
3
votes
2 answers

LINQ on a DataView

I cannot query a DataView without casting. The two lines of code in the method IsPresent are taken from "LINQ - Specified cast is not valid with dataview use" and seem to work for everyone, except for one commenter. I am "using" the LINQ namespace,…
AMissico
  • 21,470
  • 7
  • 78
  • 106
3
votes
2 answers

How to add new row on top in Slickgrid?

How to add new row on top instead of defaulted to bottom, in slickgrid dataview impelmentation also it is appreciated someone provide example of deleting a row.
3
votes
1 answer

WPF datagrid refreshes on it's own when it's not supposed to

I feel like I'm missing something here, but I have this datagrid which when the datasource changes, automatically redraws it self with no logical reason for it doing so. I have the datagrid bound to a DataView property which implements…
Steinthor.palsson
  • 6,286
  • 13
  • 44
  • 51
3
votes
1 answer

How to filter a dataview from the ith row to jth row? (C#)

I know there's the RowFilter option to filter according to column value. Also there are methods to choose the top N rows. But how do I filter out and get rows from (I prefer getting it to the same DataView dv), say, position 10 to position 23?…
nawfal
  • 70,104
  • 56
  • 326
  • 368
3
votes
4 answers

How to sort a DateTime-column in DataView?

I have a gridview with some columns and I need to sort the gridview by a date-column. But I fail in sorting it correctly. This is the code that I use: dt.DefaultView.Sort = "Meldingsdatum asc"; gvOutlookMeldingen.DataSource =…
Tassisto
  • 9,877
  • 28
  • 100
  • 157
3
votes
0 answers

DataGridView Custom Sorting With Datasource

In my C# .NET application, I have a DataGridView. The grid's DataSource is a BindingSource, and the BindSource is bound to a filtered DataView of a DataTable that is requeried from SQL frequently. I can already sort columns in the grid, but the…
Rett
  • 41
  • 1
  • 4
3
votes
2 answers

Remove Record from a DataView

I have a DataView which has been populated with a list of files from a database table. I want to iterate through the DataView to see if there are any files there of a particular type, and if so, do something with that record, and then remove it from…
Elie
  • 13,693
  • 23
  • 74
  • 128
3
votes
0 answers

Totally not getting something about ArrayBuffers and DataViews.

Here's what I'm trying to do (trying to convert the upper 3 bytes of a little endian number at a point in an ArrayBuffer into the number itself): var tmp = new DataView("\0" + array_buffer.slice(i+4, i+7), 0, 4).getUint32(0, true); This fails…
KarenRei
  • 589
  • 6
  • 13
3
votes
2 answers

Unable to have a dash (-) in the name of a datatable column for filtering

I got a problem with filtering datatables. One Column is calles BANF-Nummer. Using a filter, I got a error message. I wrote the following code for that: FilterExpression = "(Kontierungsobjekt = 'Kostenstelle' OR Kontierungsobjekt = 'Co-Auftrag') AND…
CJens
  • 39
  • 8
3
votes
1 answer

Converter gets a DataRowView instead of DataGridCell

DataGrid.ItemSource gets set in code behind to a dataview. Column names and count needs to change on the fly, so a list of objects doesn't work very well. I have the table display working completely correctly. Which is great, but my GridCellStyle…
Richard June
  • 706
  • 5
  • 15
3
votes
2 answers

why can't the datacontext detect changes to controls binded to a dataview when these changes are done via js?

I created a javascript AdoNetDataContext and created a DataView from it. I was using textboxes on the template for the table columns. AdoNetDataContext can track changes if there were any on the textboxes corresponding to the table columns used. But…
Jronny
  • 2,164
  • 4
  • 30
  • 41