Menu
  • HOME
  • TAGS

How to add a checkbox to a GridView and select/deselect based on a SQL table row value

c#,html,asp.net,gridview,datatable

Add this for a column with checkbox <asp:TemplateField HeaderText="Complete"> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("CT").ToString() == "1" ? true : false %>' /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> ...

JQuery 1.4.4 and Datatable 1.7 not working

javascript,jquery,json,xml,datatable

I gave up debugging the XML parsing - too cryptic. There is no need for porting the XML to JSON at all. So made this up instead : var table = $('#dynamicPhoneDirectory').dataTable(); var parser = new DOMParser(), xmlDoc = parser.parseFromString(rawxmlData,"text/xml"), phoneBook = xmlDoc.querySelector('PhoneBooks'), phoneBooks = phoneBook.querySelectorAll('PhoneBook'); for (var i=0;i<phoneBooks.length;i++) {...

dataTable doesn't show list [duplicate]

postgresql,jsf,datatable

I've found the solution guys! Hope this helps for someone that had my same problem. I added this @PostConstruct public void init() { prodotti = pFacade.getCatalogoProdotti(); } in the prodottoController bean, and now it shows all the products on the database!! That PostConstruct must be used everytime we use a...

spring mvc- primefaces: pagination does not working

spring,jsf,primefaces,datatable,bootstrap

I'm not sure what went wrong on your end, but I copied your code into a testproject and the paginator works just fine with PrimeFaces 5.2.

Displaying all pages from the pagination of a datatable

javascript,jquery,datatable,pagination,jquery-datatables

DataTables 1.10 does not have this ability natively, however there are pagination plug-ins that provide additional functionality. One of them, Ellipses, has an extra option iShowPages allowing to set how many pages to display in pagination control. Below is a sample code: var table = $('#example').DataTable({ "pageLength": 5, "pagingType": "ellipses",...

NullReferenceException on DataRow C# [duplicate]

c#,datatable,datarow

Initialize your array first: ObjectProperties aa = new ObjectProperties(); aa.fieldParams = new FieldParameters[parsedData.Rows.Count]; //initialize your array first You also haven't initialized your Array's elements: foreach (DataRow row in parsedData.Rows) { aa.fieldParams[counter] = new YourArrayType(); //instantiate the current element //...your code... counter++; } Remember you have to instantiate every element of...

Access particular row of p:datatable in Backing Bean on click of h:CommandLink without binding attribute

jsf,jsf-2,primefaces,datatable

But MOST of all, Take a look at the first selection example in the PrimeFaces showcase http://www.primefaces.org/showcase/ui/data/datatable/selection.xhtml

highcharts datatable - function parameters

javascript,highcharts,datatable

Call drawTable function in load function, instead of reference. load: function(){ Highcharts.drawTable(this, 310, 100, 0, '', 20, 20, 2.5) } Example: http://jsfiddle.net/z9zXM/1035/...

Creating a sample data table with X, Y, Z axis (student, cours, score) to bind to grid

c#,sql,datatable

The display structure you are trying to achieve isn't how you would set the information out within a data set You could then cut/ Slice the data any way you like for displaying purposes Quick way of displaying to the grid Create an object -> put the data in to...

Improve DataGridView rows managing

.net,vb.net,winforms,datagridview,datatable

what can I do to manage a DataSource instead of directlly manage the rows collection of the control A Class and a collection are pretty easy to implement as a DataSource and will also it will be pretty easy to modify your MoveUp/Dn methods for it. Class DGVItem Public Property...

Join some rows in datatable

c#,datatable

Try this var result = (from p in ur_data_table.AsEnumerable() group p by new{ col1 = p["TYPE"], col2 = p["CODE"] , col3 = p["NAME"]} into groupedTable select new { X = groupedTable.Key, //Each Key contains col1,col2 & col3 VALUE = groupedTable.Sum((s1) => int.Parse(s1["VALUE"].ToString())) }).ToList(); Here first your datatable will convert as...

datatable with html content

jquery,html,checkbox,datatable

Use mrender property - $('#newItemBasketTab').dataTable({ "aaData": result.itembasketdata, "aoColumnDefs": [ { "aTargets": [ 0 ], "mData": "ID", "mRender": function ( data, type, full ) { var checked = "checked"; if(data) { checked = "checked"; } return "<input type='checkbox' checked='" + checked + "'>"; } }, {"mData": "nic5dcodename"}, {"mData": "asiccprodcodename"}, {"mData": "unit_name"},...

How to display data into tag using datatable?

c#,asp.net,datatable,code-behind

Use data controls especially GridView. Add following markup in .aspx page <asp:GridView runat="Server" id="data"/> Code in click handler. protected void Button1_Click(object sender, EventArgs e) { MSConnector connector = new MSConnector(); connector.ConnectionString = "SERVER=xbetasql,52292;UID=username;Password=secret;DATABASE=ATDBSQL;"; DataSet selectedAngels = connector.ExecuteQuery("select * from customer where idcustomer = 453433"); DataTable dt = selectedAngels.Tables[0]; data.DataSource =...

JavaScript: Add table values to input field on button click

javascript,input,data,datatable

I created the whole solution on codepen. This is the function used: var clicks = 0; function csv() { var box = document.getElementsByName('text')[0]; if(clicks === 0){ var newcsv = ""; var tds = document.getElementsByTagName("TD"); for(var i = 0; i < tds.length; i++) { newcsv += tds[i].innerHTML; if(i != tds.length-1) newcsv...

Is it possible to define a column type in DataTable at run time?

c#,datatable,system.data,system.data.datatable

tempCheck is already a type, so you don't need the typeof: myDataTable.Columns.Add(columnName, tempCheck); typeof is an operator that is used to get an instance of System.Type from a type name, and this is done at compile time. The error "The type or namespace name 'tempCheck' could not be found" is...

Error occurred while convert the dataTable to excel. [duplicate]

excel,jsf,primefaces,datatable

The error is self-explanatory, and confirmed in the Primefaces manual: For pdf exporting itext and for xls exporting poi libraries are required in the classpath. So here you go: https://poi.apache.org/download.html...

Binding datatable values into a checkbox that's placed inside GridView

asp.net,gridview,datatable

You code is right you may not be getting check boxes to be checked because some values may be saved with a space at beginning or at end so you need to use Trim() method also just to make sure that your condition satisfies call ToUpper() to convert database value...

ignoring jquery plugin datatables empty rows on post action to database with laravel 5

php,laravel,datatable

I think you've over-complicated things. Using a combination of filtering the array and then an incremental for through the array will not work. If any entries are filtered out, your for loop won't make it to the end of your array. Just step back and simplify it: // assumes the...

Adding image to GridView created in CodeBehind

c#,asp.net,gridview,datatable

You can make use of <asp:ImageField/> within the the Gridview to achieve this. So your markup will look like <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false"> <Columns> <asp:ImageField DataImageUrlField="Value" ControlStyle-Width="100" ControlStyle-Height="100" HeaderText="My Image" /> </Columns> </asp:GridView> In your C# code you can use List to add the images. So something as simple as...

Why when I export from datatable to csv it's same sorts by another columns what I want

c#,sorting,csv,datatable

ok..I did it. I had only assign DefaultView to Datatable befor import DataTable to dataGridView. datatable = datatable.DefaultView.ToTable(); ...

HIVE: apply delimiter until a specified column

hadoop,datatable,hive,delimiter

Use regular expresion https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-ApacheWeblogData you can define when use space as delimiter and when part of data

How to Filter a DataView by another datatable row attribute

c#,datatable,dataview

Use LINQ to join the two collections on the common field. This will give you a projection that contains all 3 fields (1 field of the DataTable and 2 fields of the DataView) for only the rows that exist in both collections (as you are joining them). You can then...

DataTable.Update Fails and Throws DBConcurrencyException

c#,datatable,sqlcommand,sqldataadapter,sqlcommandbuilder

This error only occurs when, to quote MSDN An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. To get this error means that the database has changed since the DataTable was created. The error tells you that the UpdateCommand affected 0 of the expected...

How to upload/import a file in the new R shiny version 0.12 using DT package

r,datatable,upload,shiny

Your code is fine. Are you sure you're updated to the absolute latest shiny and DT? Both of them have been updated pretty heavily the past couple weeks, so make sure you install their GitHub version. I would guess that one of the packages is not up to date. Note...

Datatables shared parameters affected by sorting

jquery,sorting,datatable

var newChildParams = $.extend({}, childParams); is shallow copy here, which means newChildParams only point to childParams's address. If you change the variable in newChildParams, childParams will update too. The solution is use deep copy var newObject = jQuery.extend(true, {}, oldObject);. It will copy the object to another memory address. You...

Datatable link stops working after page one

javascript,php,jquery,mysql,datatable

use below code your problem is called Event Delegation. Event delegation allows us to attach a single event listener, to a parent element, that will fire for all descendants matching a selector, whether those descendants exist now or are added in the future. <script> jQuery(document).ready(function($) { $(document).on('click','.clickable-row',function() { window.document.location =...

Splitting a Datatable based on Column value

c#,list,datatable

considering dt datatable has all the records including both the columns, you can create two DataView with your filter condition like EnumerableRowCollection<DataRow> query = from data in dt.AsEnumerable() where data.Field<bool>("a") == true select data; DataView view1 = query.AsDataView(); EnumerableRowCollection<DataRow> query1 = from data in dt.AsEnumerable() where data.Field<bool>("a") == false select...

Primeface Datatable filtering removed when sorting with o:form includeRequestParams=“true”

primefaces,filter,datatable,omnifaces,http-request-parameters

Ok so i found out that filteredValue was reseted on each ajax call because of the @RequestScoped. I think i was kind of mixing up things. So i switched all @ManagedBeans to @Named then i created a new @SessionScoped Bean with most of the attributes and i @inject a @RequestScoped...

Don't split the string if contains in double marks

c#,datatable

Don't try and re-invent the CSV-parsing wheel. Use the parser built into .NET: Microsoft.VisualBasic.FileIO.TextFieldParser See http://stackoverflow.com/a/3508572/7122....

datatable plugin not working

jquery,html,jquery-plugins,datatable

What browser you are using.? Your code seems to be working fine. https://jsfiddle.net/khze0tsf/ Only thing i can possible think of 1. You dont have reference to jquery 2. path to datatable library is wrong Add jquery and datatables CDN <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> ...

IDataReader vs DataTable; pros and cons

c#,datatable,sqlbulkcopy,idatareader

With the default case, both should have similar performance otherwise horses.. But there is one difference though, WriteToServer with DataTable as parameter will insert all rows from DataTable , but with IDataReader copy starts with next available row in the reader (which would be set to first row in default...

C# Find non matching values in DataTables

c#,datatable,matching,relation

Well, you could of course use a little bit of LINQ by turning the data tables into IEnumerables using the AsEnumerable()1 extension method. I am using a few assumptions to illustrate this: "id" is the column with an integer value relating rows in FEData and SSFEData. "id" is the primary...

Get p:dataTable row data via p:selectOneMenu

jsf-2,primefaces,datatable,row,selectonemenu

This way I can loop through my list of objects, allocate that specific object of the row and change the value That effort is unnecessary. Just bind input component's value directly to the desired property. <p:selectOneMenu value="#{car.selectedValue}"> This way JSF will transparently do all that effort for you. If...

How to change the position of text “No data available in table” in datatables?

javascript,jquery,css,datatable,jquery-datatables

Try this: Use this class in your css to position it in the right way . "td.dataTables_empty" . ...

DataTable.Rows returns second row in c#

c#,datatable,oledb

Please change your connection string's HDR=YES property to NO as per my comment. conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source = '" + path + "'" + @";Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;ImportMixedTypes=Text; TypeGuessRows=0"""; "HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite.....

pick a random records from a datatable

c#,random,datatable

Could you try something like, dt2 = dt.Clone(); dt.AsEnumerable().Select(x => x["IC_NUMBER"].ToString()).Distinct().ToList().ForEach(x => { DataRow[] dr = dt.Select("IC_NUMBER = '" + x + "'"); dt2.ImportRow(dr[0]); dr.ToList().ForEach(y => dt.Rows.Remove(y)); dt.AcceptChanges(); }); EDIT: int totalWinners = 10; Random rnd = new Random(); dt2 = dt.Clone(); for (int i = 1; i <= totalWinners;...

Stored Procedure for insert

sql-server,stored-procedures,datatable,syntax-error,sql-insert

You need the form of insert that takes a select rather than a values: insert into theTable (col1, col2, ...) select col1, col2, ... from ... where... All the features of a select are available (column aliases, grouping, joins, sub queries, ...)....

How to append datatable to existing records in CSV file

powershell,csv,datatable

Since PowerShell v3 the Export-Csv cmdlet has an -Append parameter that allows appending to an existing CSV. $data | Export-Csv 'MyFile.csv' -Append -NoType On earlier versions you can work around that by converting the data to CSV, skip the header line, then append to the output file using Add-Content or...

DataTable Modifies Date Format - WHY?

c#,sql,asp.net,sql-server,datatable

DataTable uses .NET DateTime class and it probably get converted to string with DateTime.ToString() method when CSV is created. That method uses date format from current Thread's Culture settings. You need to use DateTime.ToString(string format) overload when creating CSV to specify desired format of DateTime. Here's general description of culture-specific...

DataTables search child row content

jquery,datatable,datatables,jquery-datatables,datatables-1.10

I have to ask : What make you believe you can search in child row content you are injecting dynamically only when the child rows are shown? And how should a column() search could cover content from other rows, ever? When this said, there is of course a workaround. Instead...

Checkboxes will only work on current pagination page in jQuery datatables

javascript,php,jquery,checkbox,datatable

you can get all the selected check box values using following code this might be helpful for you var myArray = []; var id = ""; var oTable = $("#example").dataTable(); $(".class1:checked", oTable.fnGetNodes()).each(function() { if (id != "") { id = id + "," + $(this).val(); } else { id =...

Primefaces datatable duplicate “No records found” while doing column freeze for empty records

jsf,jsf-2,primefaces,datatable

I didn't find any solution to above problem.So, I manually overrided the css of second table generated by the above p:datatable. My css is: <style> .ui-datatable-frozenlayout-right .ui-datatable-empty-message td { display: none; //or visibility:hidden; } </style> ...

Adding property in php datatable for google chart custom html tooltips

javascript,php,jquery,datatable,google-visualization

You were on the right track with array('type' => 'string', 'role' => 'tooltip', 'p' => '{ html : true}'),but you need to have an additional array for the 'html': true part. It should look like array('type' => 'string', 'role' => 'tooltip', 'p' => array('html' => true)); I tried it out...

p:dataTable not showing updated records from database on Dialog close

ajax,jsf,primefaces,datatable,dialog

When you try to update a component from ManagedBean using RequestContext.update() you should not use the relative component id, because you'd have nothing to relate to. To fix your problem remove : before Requests in your listener. RequestContext.getCurrentInstance().update("Requests"); If you feel updating a component from managed bean, increases cohesion. You...

dataview.rowfilter syntax error - missing operand mystery

vb.net,datagridview,datatable,dataview,rowfilter

It looks like you have a white space in the Datatable column header. So, you have to enclose the Column name in the RowFilter within square brackets. Dim dtdv As New DataView dtdv = dt.DefaultView dtdv.RowFilter = "[Controller ID] = 'PS2USB1'" XMLDGV.DataSource = dtdv ...

jsf - foreign key in datatable

jpa,datatable

I'm happy to say I found the solution! (kudos for @Mauricio Gracia to enlight my finding-a-solution path) First, I removed the "fetch = FetchType.LAZY" from the customer relationship in Order class @ManyToOne(cascade={CascadeType.PERSIST}) @JoinColumn(name = "customer_id") private Customer customer; Then, I serialized the Customer class @Entity public class Customer implements Serializable...

Export DataTable to CSV File with “|” Delimiter

c#,asp.net,csv,datatable,export

You can try: StringBuilder sb = new StringBuilder(); string[] columnNames = dt.Columns.Cast<DataColumn>(). Select(column => column.ColumnName). ToArray(); sb.AppendLine(string.Join("|", columnNames)); foreach (DataRow row in dt.Rows) { string[] fields = row.ItemArray.Select(field => field.ToString()). ToArray(); sb.AppendLine(string.Join("|", fields)); } File.WriteAllText("test.csv", sb.ToString()); ...

how to remove a row from datatable

c#,winforms,datatable

This should do the trick instead of Delete and AcceptChanges: Form1.dt.Rows.RemoveAt(i); Update: Caution when using a DataAdapter and relational data source along with your DataTable. Using Remove modifies the DataTable, but not the actual data source. See https://msdn.microsoft.com/en-us/library/03c7a3zb(v=vs.110).aspx...

Add Column to DataTable before exporting to Excel file

vb.net,excel,datatable,type-conversion,dataview

The issue was in my CreateExcelFile() method. I inherited the app I'm modifying and assumed the method dynamically read the data in the DataTable and built the spreadsheet. In reality, it was searching the DataTable for specific values and ignored everything else. 2 lines of code later, I'm done....

Jquery datatable group by two columns with expand and collapse

jquery,datatable,grouping

From documentation, .rowGrouping({ iGroupingColumnIndex1:2 ,bExpandableGrouping: true, // expand/collapse first column bExpandableGrouping2: true}); // expand/collapse second column updated fiddle: jsfiddle.net/RgKPZ/493/, you can set indentations with necessary css....

Convert DataTable into object[ , ] array with LINQ

c#,linq,datatable

You cannot use Linq to create a rectangular array - Linq only operates on single-dimension arrays. You will need to use traditional for loops: object[,] objectArray = new object[dtReportData.Rows.Count, dataTable1.Columns.Count]; for(int row = 0; row < dtReportData.Rows.Count; row++) { for(int col = 0; col < dtReportData.Columns.Count; col++) { objectArray[row, col]...

C# - SqlDataAdapter doesn't fill DataTable no matter what

c#,sql-server,datatable

God damn, I never bothered to check the Rows property of the DataTable, turns out it did work. I thought it didn't because while in debugging mode Visual Studio is very misleading because when you hover over the datatable variable it just shows "{}" which usually would mean that the...

Bootstrap datatable pagination only showing buttons but not working in Grails

twitter-bootstrap,grails,datatable,pagination

You can try the following code. View page.. <table id="example" class="table table-bordered table-hover" cellspacing="0" width="100%"> <thead> <tr> <th>Title</th> <th>Short Description</th> <th>Stream Type</th> <th style="text-align: center;">Total Download</th> <th style="text-align: center;">Active</th> <th style="text-align: center;">Action</th> </tr> </thead> <tbody> <g:each in="${dataReturn}" var="dataSet"...

There is no row in position 1 but in debug mode it is correctly mapped

c#,asp.net,datatable,datarow

You may have a row at position 1, but you may not have a row at position 2. Remember that the rows collection is zero based. So when you do this: TxtItem.Text = dt.Rows[0]["t_item"].ToString(); lbldesc.Text = dt.Rows[1]["t_idsc"].ToString(); You are setting TxtItem.Text to "t_item" of the first row. But you are...

Bulk Exporting Data from Codeignitor to CSV using Database Utility Class

php,database,codeigniter,datatable,codeigniter-2

// top of your controller ini_set('max_execution_time', 0); // Also you can increase memory ini_set('memory_limit','2048M'); Download this helper and place in system/helpers/ and finally create csv like this $this->db->select('*'); $query = $this->db->get('your_table'); $this->load->helper('csv'); query_to_csv($query, TRUE, 'filename.csv'); ...

Best way to remove duplicates from DataTable depending on column values

c#,asp.net,linq,datatable

I think this can be done more efficiently. You copy the DataSet once with DataSet importedDataCopy = importedData.Copy(); and then you copy it again into a dictionary and then you delete the unnecessary data from the dictionary. I would rather just remove the unnecessary information in one pass. What about...

Combobox Datasource assign to Datatable

vb.net,combobox,casting,datatable

I would use TryCast to get the job done. Dim dt As DataTable = TryCast(combobox1.DataSource, DataTable) If dt Is Nothing Then ' It didn't work because it's not a datatable ' Editors: I specifically did not reduce this expression ' to emphasize the need to check for 'Nothing' ' and...

Ajax update of datatable from a modal after filtering

ajax,jsf,primefaces,datatable

It was my mistake to mention the id in place of the widgetVar. This: oncomplete="PF('myTableWidget').filter()" would work fine if the dataTable in question looks like: <p:dataTable id="myTable" widgetVar="myTableWidget"... I was wrongly trying it this way: oncomplete="PF('myTable').filter()" ...

filtering not working from select

jquery,table,datatable,filtering,html-select

You have entered wrong index in fnFilter. Find the below working code, JSFiddle The issue was with on event, you should provide the selector to on function or else use Delegate: It just attaches the event runtime. For more info refer http://api.jquery.com/delegate/ and Need to use $(this) to get the...

How to count the entire number of rows in a datatable

javascript,jquery,datatable

$(document).ready(function() { // Initialize your table var table = $('#jobSearchResultTable').dataTable(); // Get the total rows alert(table.fnGetData().length); } ); Source: jquery datatables row count across pages Another method: table.fnSettings().fnRecordsTotal(); see which one works for you Source: http://datatables.net/forums/discussion/2278/how-to-get-number-of-rows...

Categorizing a hash of arrays into a datatable. rails

ruby-on-rails,ruby,ruby-on-rails-4,datatable

In this case you can just call flatten twice. myhash = {"Level 1" => ["foo", "bar"], "Level 2" => ["foo", "bar", "foobar"]} myhash.flatten.flatten => ["Level 1", "foo", "bar", "Level 2", "foo", "bar", "foobar"] ...

Shortest way to save DataTable to Textfile

c#,datatable,streamwriter

You have your DataTable named as myDataTable, you can add it to DataSet as: var dataSet = new DataSet(); dataSet.AddTable(myDataTable); // Write dataset to xml file or stream dataSet.WriteXml("filename.xml"); And you can also read from xml file or stream: dataSet.ReadXml("filename.xml"); ...

Select and updating data from datatable

c#,asp.net,datatable

As the exception says,Index is out of bounds,You are reading the first element (with index 0) but there are no elements in the collection. It is the same as this: int[] array = new int[0]; int x = array[0];//You will get an exception here Add an if statement to make...

adjust the rows dynamically in paginator of primefaces datatable

primefaces,datatable

1.Define two JSF inputHidden Fields say screenHeight, and screenWidth in your xhtml files 2.Calculate the computedHeight and computedWidth using javascript when page loads and store it into the hidden fields. 3.Automatically the value will be binded to the managedbean varaibles. 4.Write a method to return no of rows based on...

Looping trough rows in DataTable and extracting element in c#

c#,datatable,datarow

You need to cast it in the foreach loop like this: foreach (DataRow row in table.Rows) Note that type definition in a foreach acts as a cast. Now you have a type that allows []. You can also use Linq to make it look cleaner: List<int> product = table.Rows.Cast<DataRow>().Select(row =>...

Avoid onRowClick event when outputLink is clicked inside of RichFaces datatable

javascript,javascript-events,datatable,richfaces

Basically what Event.stop(event) does is the following: \\ stops the event from bubbling up the event chain event.stopPropagation(); \\ prevents the default action the browser makes on that event event.preventDefault(); In your case you want just to prevent bubbling, so a way to go: onclick="event.stopPropagation()" ...

Return DataTable from ORACLE

oracle,datatable,nothing

I am not VB specialist, but this code worked fine, so it may be useful for you: Dim dt = Oracle2table("select * from dual") Console.WriteLine(dt.Rows(0)(0)) Function (I removed exception handling for simplicity): Function Oracle2table(ByVal sql As String) As DataTable Dim conn = New OleDbConnection(connString) Oracle2table = New DataTable conn =...

C# Get String From Data set Exception

c#,string,datatable,dataset

Well, “First_Nameˮ is treated as a variable name and not as a quoted string, as the quotes are not "normal" double quotes, but typographical left/right quotes, so they are threated as unicode signs. Change them to normal double quotes. String Receiver_name = rec_Ds.Tables[0].Rows[0]["First_Name"].ToString() + " " + rec_Ds.Tables[0].Rows[0]["Last_Name"].ToString(); So: Be...

dataTables custom filtering of

if class list contains a class

jquery,filter,datatable,datatables

The logic in your if condition was backwards; you need to return true/false based on if the checked grade is found within the classes of the element. Try this: $.fn.dataTableExt.[afnFiltering][1].push(function (oSettings, aData, iDataIndex) { var myRowClasses = oSettings.aoData[iDataIndex].nTr.className.split(" "); if ($('#ckb-gradeA').is(':checked')) { return myRowClasses.indexOf('gradeA') > -1; } else if ($('#ckb-gradeC').is(':checked'))...

Primefaces datatable combine data in only one row

jsf,primefaces,datatable

You're using the dataTable component in a wrong way. It just displays data in a tabular view and the only thing you're supposed to do, is to supply it with a Collection of model objects and explicitly tell which property from a model instance should be displayed under a certain...

JQuery Datatable Error “Cannot read property 'length' of undefined”

php,jquery,ajax,datatable

According to the DataTables 1.9 documentation, sAjaxDataProp specifies the name of the array inside the returned JSON object that contains the entries. At the same time, DataTables appears to accept entries as arrays, not objects. Your return format should be: {"data": [["[email protected]","06-07-2015 7:55 pm","xx.xx.xx.xxx"],["[email protected]","06-07-2015 5:45 pm","xx.xx.xx.xxx"]]}...

Columns in DataTable Disappearing

c#,asp.net,datatable

You lose your data on postbacks. That's normal. You have to use some of state management mechanisms like ViewState or Session to mention few. You can try this using ViewState: private DataTable purchase_display_data { get { if (ViewState["purchase_display_data"] == null) ViewState["purchase_display_data"] = new DataTable(); return (DataTable)ViewState["purchase_display_data"]; } set { ViewState["purchase_display_data"]...

binding on p:dataTable which is included multiple times causes ID unqiueness exceptions

jsf-2,primefaces,binding,datatable,facelets

You're basically binding physically different <p:dataTable> components to one and same EL variable. If this EL variable is not null (i.e. already set by a previous component in the same view), then JSF will reuse it instead of creating a new one, and override all of its attributes during view...

How Can i Validate datatable's Data before inserting it using SqlBulkCopy

c#,asp.net,sql-server,datatable,sqlbulkcopy

You can query your excel file and compare that using SQL language. See example below: SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\excel-sql-server.xls', [Sheet1$]) Find more options about Distributed queries on this link. You can query the data that you already have on the sql data and compare it with excel...

DataTable does not release memory

c#,memory,memory-management,datatable

Your main problem is the behavior of the Garbage Collector is different depending on if you are debugging or in release mode without a debugger present. When in a debug build or a release build with a debugger present all objects have their lifetimes extended to the entire lifetime of...

Filtering DataTable that contains objects

c#,.net,datatable

Thanks to kanchirks comment I came up with this solution. EnumerableRowCollection erc = dataTable.AsEnumerable().Where(dr => ((Cell)dr[columnIndex]).Value.ToString().ToLower().Contains(filter.ToLower())); ...

DataTable.js implement a filter to hide rows by index

javascript,jquery,datatable,jquery-datatables

table.draw() does not work because it is defined inside the $(document).ready scope. You must have global table variable, then it will be accessible in your displayAdvertRight() function too. I.e var table; $(document).ready(function() { ... table = $('#example').DataTable({ ... }); I get the impression that you have two <select>-boxes, startTime and...

Datatables for mutiple tables on one page having different td count each

javascript,jquery,datatable

Using class cannot be applied because each table has different td's count There is nothing to do when we use datatable for mutiple tables it works only for the tables which have same count of td's and can be applied using the both table's same class Live Demo...

Desired page in pagination with DataTables

datatable,pagination,datatables,jquery-datatables,datatables-1.10

There is Navigation with text input pagination plug-in, see the example below: $(document).ready(function() { $('#example').dataTable({ "pagingType": "input" }); }); <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> </head> <link href="//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script...

Updating Pagination for polling with dataTables object

jquery,datatable

If you are using the legacy dataTables, then there is a plugin which does a standing redraw , meaning, retain the current page. http://datatables.net/plug-ins/api/fnStandingRedraw Import the plugin and use as follows $(document).ready(function() { var table = $('.dataTable').dataTable() table.fnStandingRedraw(); } ); For DataTables 1.10+ onwards, this is in-built in draw(false) method....

Missing Data after insert into my end sql table using Sql Bulk Copy

c#,sql-server-2008,datatable,console-application,sqlbulkcopy

you need to look at the data in Access, and find/fix those bad column values, or handle them in your TSQL after the export. One option to debug - replace temp table with real table, replace datetime datatype with string, do your export, then query the table to find the...

XPages. Hide column in DataTable

datatable,xpages,lotus-notes

I can confirm I get exactly the same behavior out of this. I agree that I would expect the entire column to not render, but that's apparently not its behavior. I've always viewed the xp:dataTable control as a slightly dressed up xp:repeat, but not with as much window dressing as...

jQuery DataTables Column Show/Hide Toggle using Bootstrap Modal

jquery,asp.net-mvc,twitter-bootstrap,datatable

You need to use the same code. Just instead of anchor tags you'll have check-boxes. <input type="checkbox" class="toggle-vis" data-column="0" value="Name"/>Name And your jQuery event selector will change. $('.toggle-vis').on( 'click', function (e) { // Get the column API object var column = table.column( $(this).attr('data-column') ); // Toggle the visibility column.visible( !...

Datatable show/hide sorting/paging

.net,sorting,datatable,jquery-datatables,paging

From the description of the retrieve option (emphasis mine): Retrieve the DataTables object for the given selector. Note that if the table has already been initialised, this parameter will cause DataTables to simply return the object that has already been set up - it will not take account of any...

Change the sequens of columns in datatable with linq

vb.net,linq,datatable,dataset

You can use DataColumn.SetOrdinal() method to reorder columns. Assuming that query is a datatable with columns Name|Age|Job, the following will reorder the columns to Age|Name|Job : query.Columns("Age").SetOrdinal(0) query.Columns("Name").SetOrdinal(1) ...

JSF NumberFormatException with f:setPropertyActionListener

jsf,datatable,el,jsf-2.2,setpropertyactionlistener

You kind of coded your self into a corner with your fancy bean implementation. Take a look at the processing steps for the f:setActionPropertyListener. Your code is choking at step 3: If the value of the "value" expression is not null, call getType() on the "value" and "target" ValueExpressions to...

How to remove datatable from dataset?

c#,asp.net,datatable,dataset

You only need this selectedData.Tables.Remove(dt); But it would be better if you first check that DataSet contains the table which you are trying to remove. Also check if the DataTable can be removed from DataSet as pointed by Gianni B. if(selectedData.Tables.Contains(dt.name) && selectedData.Tables.CanRemove(dt)) selectedData.Tables.Remove(dt); Remove method does not return anything....

Datatables select and search filter

jquery,datatable

You can accomplish this utilizing the Column Filter plugin ('#example').dataTable().columnFilter({ aoColumns: [ { type: "text" }, { type: "select", values: [ 'Adam', 'Bob', 'Casey', 'Dave'] }, { type: "text" } ] This sets up a filter for each column. The first column will be text, second a drop down containing...

Refresh selection model of p:datatable on row deselection

jsf,primefaces,datatable,selection

I finally found the solution. They had extended PrimeFaces implemenation and incompletely implemented some methods. The following thread helped me in solving the problem: p:dataTable selections are lost after paginating a LazyDataModel

Binding a datagrid template column (as datepicker column) to a datatable column

c#,wpf,data-binding,datatable,datagridcolumn

Okay, I figured it out. It turns out that the binding has to be done in the wpf code where the template for the template is created. No binding actually has to occur in the code-behind for the individual column. The table itself does still have to be pointed to...

How can I selectall visible rows in an icefaces ace:datatable?

jsf,datatable,icefaces

So I created a function "doSelectAllRows" which is a copy of "doMultiRowSelectionEvent" but has the following changes: ice.ace.DataTable.prototype.doSelectAllRows = function () { var self = this, tbody = ice.ace.jq(this.jqId).find('.ui-datatable-data'), elemRange = tbody.children(), deselectedId, firstRowSelected; // Sync State // self.readSelections(); ...

How to unhighlight row in dataviewgrid C#

c#,datagridview,datatable

You can use dataGridView1.ClearSelection(); Or dataGridView1.CurrentCell = Nothing; Or dataGridView1.Rows[Index].Selected = false; ...

filtering firstname and lastname using datatable.js

javascript,jquery,table,datatable,filtering

One way is by using custom filtering (>1.10) This piece of code will be executed every time the table is drawn. The method takes the first and second name from the fields and creates a regular expression. The data[0].replace removes the spaces in between first and second names and coverts...

Placing Hyperlinks in DataGrid

c#,html,asp.net,datagrid,datatable

row[3] = "<a href='" + row[3] + "/rev/" + row[1] + "'>" + "test" + "</a>"; I believe the colon after "href" is whats preventing you from clickable links. Change the colon to an "="...

java datatable server side issue

java,jquery,datatable,server-side

my problem is solved few things that i have changed i was using com.google.gson.Gson for json now i am using org.json which solved the issue of \ in my aaData then I used newer version of datatable and added jsonObject.put("DT_RowId", row); to my aaData now my json is as follows...

How to select rows from a DataTable where a Column value is within a List?

asp.net,.net,vb.net,linq,datatable

In the past, I've done this sort of like this: Dim item = From r as DataRow in dtCodes.Rows Where lstCodes.contains(r.Item("Codes")) Select r Does that work?...

With JQuery Datatable, how do you get the search/entries etc to be on the same line

jquery,css,datatable

After some investigation I found that the problem only occurred when I included the file dataTables.bootstrap.js - which makes the datatable use the current bootstrap theme. As DiogoDoreto said this did not have any floats so I added the following to the end of this file and this gave me...