Questions tagged [datatable]

The term "datatable" is ambiguous. In .NET, it's a class that represents a table of in-memory data. In component based MVC frameworks like JSF and Wicket, it's an UI component that dynamically renders a HTML table based on a collection. For jQuery DataTables plugin, please use the [datatables] tag, for the data.table R package please use [data.table]. For the Python datatable package, use [py-datatable].

DataTable in .NET

A DataTable is a .NET class that represents one table of in-memory data. Unlike other programming languages and platforms, a .NET DataTable is not a GUI control but rather a representation of a SQL table directly accessible in code and a source of data for other controls.

A DataTable may exist as part of a DataSet, which represents an in-memory relational data store. In that context, they can be connected through instances of the DataRelation class, and constrained by ForeignKeyConstraint or UniqueConstraint instances.

A DataTable has a set of DataColumn instances, which describe its schema. Data is stored in DataRow instances.

A DataTable may be sorted and filtered without changing the data by attaching it to a DataView. The sorted and filtered rows are then accessed as instances of the DataRowView class.


DataTable in JSF

A <h:dataTable> is an UI component which allows you to render a HTML table dynamically based on a given List<Entity>. You can specify columns using <h:column>. Assuming that Entity is a fullworthy javabean with 3 properties id, name and value, here's an example how you can render a dynamically sized HTML table out of it:

<h:dataTable value="#{bean.entities}" var="entity">
    <h:column>#{entity.id}</h:column>
    <h:column>#{entity.name}</h:column>
    <h:column>#{entity.value}</h:column>
</h:column>

DataTable in Wicket

A data table builds on data grid view to introduce toolbars. Toolbars can be used to display sortable column headers, paging information, filter controls, and other information.

Data table also provides its own markup for an html table so the user does not need to provide it himself. This makes it very simple to add a datatable to the markup, however, some flexibility. (from Wicket 1.4.18 Javadoc)

22197 questions
3
votes
1 answer

C# - Merge two DataTables where rows are duplicate

I can find lots of information about merging two DataTables and dropping duplicate rows, but I need the opposite. I need to know if anyone has an easy way to merge two DataTables where the result of the merge is a DataTable with only rows that exist…
Dustin Ruckman
  • 103
  • 2
  • 14
3
votes
2 answers

case_when with multiple conditions in dplyr R

I have a data.frame that looks like this df <-data.frame(Day=c(0,0,0,1,1,1),type=c("tr1","tr2","ctrl","tr1","tr2","ctrl"), mean=c(0.211,0203,0.199,0.119,0.001,0.254), sd=c(0.07,0.141,0.096, 0.0848, 0.0006, 0.0474)) …
LDT
  • 2,856
  • 2
  • 15
  • 32
3
votes
1 answer

DataTables - How to sort by date (dd.mm.yyyy)

I have a table with multiple columns. 1 column contains date in format dd.mm.yyyy (example: 26.05.2021). I'm trying to achieve a default sorting by date. My table looks like this:
neisor
  • 384
  • 4
  • 15
3
votes
1 answer

Table with package kableextra - how to add lines to the tables?

has anyone an idea how to add a line to this table created with the package kableextra?
Joe94
  • 91
  • 7
3
votes
0 answers

Need Datatables's column visibility in my KeenThemes datatable

First question here on SO and not very familiar with datatables, so please bear with me if I'm leaving out info! So I am using Metronic's/KeenThemes's plugin to show a datatable and I want to use Datatables's column visibility implementation to…
3
votes
6 answers

How to load on demand excel rows in a data table c#

I have a requirement where-in I have to fill dataTable from a sheet of Microsoft excel. The sheet may have lots of data so the requirement is that when a foreach loop is iterated over the data table which is supposed to hold the data from Microsoft…
user3048027
  • 387
  • 1
  • 5
  • 24
3
votes
1 answer

Unable to add event into DataTable Pagination buttons when using setInterval

I'm working on a Table that logs all action and refreshes the table based on the interval given. Everything works fine except when using setInterval, here's my code: var interval = 3000; var interval_en = true; $(document).ready(function() { …
Shiz
  • 695
  • 10
  • 27
3
votes
4 answers

Why do Powershell return as null when called from C# app code?

I'm using this as a reference: http://msdn.microsoft.com/en-us/library/dd182449(v=VS.85).aspx So the implementation is very similar. I'm executing the following PowerShell command to retrieve process information from the intended computer through…
Jae
  • 105
  • 5
3
votes
1 answer

generic method to get linq result to datatable for select new with multiple selects

I'm trying to get the result of a join query with multiple selects into a dataTable, without selecting every fields separately. This is the setup: public class info { public int id {get;set;} public int linked { get; set; } public int…
user369122
  • 792
  • 3
  • 13
  • 33
3
votes
1 answer

change color of paginated datatable in flutter?

i look to change the color of paginated datatable using flutter , i use dark themes and paginated datatable take that color , also i read from the flutter web site enter link description here to use this CardTheme, but how to use it .. this my…
Lansen Portan
  • 131
  • 1
  • 7
3
votes
2 answers

Laravel Datatables: How to sort column with the second data

How do I sort according to the second data? The sorting works only on the ID. But in my table, I added a badge count and that's what I want to sort by. Here is my controller return DataTables::of($users) ->addIndexColumn() …
draw134
  • 1,053
  • 4
  • 35
  • 84
3
votes
4 answers

Display Group by sum in new column

I want to display group by sum in new column in same data table. For example: I want output to be like: I have tried like below: group by sno and stored in different table. by using for loop, i am assigning total values to old data table. for…
Bin
  • 59
  • 5
3
votes
2 answers

How to ignore MaxLength constraint on an ADO.NET Datatable.DataColumn when loading data

A recurring problem in my experience when using Datasets and DataTables is that changing the database schema after the Dataset is compiled and released will cause constraint checking to fail. Of course, this is generally a good thing. However,…
kev
  • 135
  • 1
  • 4
  • 14
3
votes
1 answer

jquery: How do I access the underlying DataTable inside a createdRow() callback?

When a row is created, I would like to add a child row containing a
, for later population via on.click() + DataTable() + ajax. Pretty simple. The createdRow() callback seems like a great place to do this ... if I could get it to…
Bean Taxi
  • 1,104
  • 1
  • 9
  • 22
3
votes
4 answers

is there any faster way to populate a resultset from a database query?

i have the following code that queries a db and populates a datatable. private DataTable Run(string sql) { var conn = new OdbcConnection(); string connString = "[myConnString];"; conn.ConnectionString = connString; …
leora
  • 188,729
  • 360
  • 878
  • 1,366
1 2 3
99
100