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
2
votes
2 answers

Replace new line char with
XSL

I have a Sharepoint list which I want to convert to a JSON via an XSL dataview. I have an XSL recursive replace function which I use to replace all special characters (escape backslash, double quotes to " etc) which gives me nice clean JSON…
Fergal
  • 2,484
  • 2
  • 36
  • 48
2
votes
1 answer

Sharepoint XSL data view query string filtering

Lets say I have a list called events. Using SP Designer I can add a webpart to a page, select the events list, and a data grid with standard sharepoint controls and column filtering will be added to the page, similar to the "allitems.aspx" view of…
Fred
  • 21
  • 1
  • 2
2
votes
1 answer

How to sort a DataView in a case-insensitive manner?

I have a DataTable. I'd like to sort its default view by a column name 'city'. I'd like the sort to be case-insensitive. Here is the code I have: DataTable dt = GetDataFromSource(); dt.DefaultView.Sort = "city asc"; MyReport.DataSource =…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
2
votes
1 answer

Inserting data from a asp.net web application to SQL Server

I am currently trying to create a project in ASP.NET to create a stock input web application for a cafe which allows users to input stock data from web. I want to know how to save data from browser to SQL Server. Screenshot of my current table…
2
votes
1 answer

filtering datagridview if DataSorce is BindingList, that implements IBindingListView

Problem: store non-simple class property values. I have BindingListView and this is DataSorce of my datagridview. I would like to notice that Hotel class looks like this. public class Hotel { private Address address; private…
2
votes
1 answer

How do I make a C# DataView column invisible?

How do I make a C# DataView column invisible? I thought it would be similar to ReadOnly but the following doesn't work because there is no "visible" property. foreach(DataColumn c in myDataView.Table.Columns) { …
user492922
  • 925
  • 2
  • 12
  • 23
2
votes
2 answers

Using Like statement with DataView RowFIlter

I have a DataTable with some data and I want to filter with LIKE query so I have written a code like below and everything working fine, I'm generating the query and passing it to RowFilter object of DataView. if (results.Count() == 2) { if…
Shakir Ahamed
  • 1,290
  • 3
  • 16
  • 39
2
votes
1 answer

DataView rowfilter always includes last of the set

When using dataView.RowFilter I always get the filtered result including the last element of the dataset. I have a test dataset: private TestClass[] items = { new TestClass{name = "Hans", age = 10 }, new TestClass{name = "Bert", age = 5 }, …
Chevalric
  • 79
  • 7
2
votes
1 answer

How to set a signed 24-bit integer in a DataView?

I found this, but it's for unsigned 24-bit integers: DataView.prototype.setUint24 = function(pos, val) { this.setUint16(pos, val >> 8); this.setUint8(pos+2, val & ~4294967040); // this "magic number" masks off the first 16 bits } Simply…
Maxime Dupré
  • 5,319
  • 7
  • 38
  • 72
2
votes
0 answers

DataView.RowFilter and "N2" formatted numbers - how to achieve "what you see is what you filter"?

I have a column of decimal numbers, which are displayed using N2 formatting. This means that the number 12000.4656887 will be shown as 12,000.47: At the same time, I have a textbox where the user can enter text, and I set a DataView.RowFilter…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
2
votes
0 answers

C# DataView Filter expression DateTime format

I'm defining a filter on a DataGridView on a DateTime column as follow: BindingSource.Filter = "Column = '2016-05-26'" Obviously the equality is not correct as the Column is expressed with the timestamp. Then, I would like to convert the datetime…
Fede
  • 804
  • 1
  • 10
  • 21
2
votes
2 answers

Pivot data dynamically for google line chart

I want to display "population" of various countries through the years in the same line chart. The data displayed is based on selections from a multi-select dropdown "Countries". Underlying Data Table has 3 columns: Year, Country,…
sam
  • 173
  • 1
  • 1
  • 10
2
votes
1 answer

How can I filter data with Dataview when column name include "-" type of character

My table has three columns(NIGHTS,CRUISE-ID,DEP-DATE).I found a way to filter data table like this.(this link help a lot :Helpful). DataView dv = new DataView(table); dv.RowFilter = "NIGHTS=7";//query this works fine and filtered data…
bill
  • 854
  • 3
  • 17
  • 41
2
votes
1 answer

Asp ModalPopupExtender not displaying detail view

I am using a ModalPopupExtender within an updatePanel to show a detailView when a user selects a "Details" Button within a GridView. The problem is that when the button is selected the popup is not being displayed. I have stepped through the code…
Isawpalmetto
  • 785
  • 3
  • 12
  • 18
2
votes
1 answer

Binding DataGrid to two DataTable

I've two DataTable with the exactly same structure, schema and constraints, but with different rows. What I need is to display these tables into a DataGrid, concatenated, i.e. first the rows of the first DataTable, then the rows of the second. I…
WoDoSc
  • 2,598
  • 1
  • 13
  • 26