dataview

Sorting a List<FileInfo> by creation date C#

断了今生、忘了曾经 提交于 2019-12-04 03:08:26
问题 Using this example off MSDN: using System.Collections.Generic; using System.IO; namespace CollectionTest { public class ListSort { static void Main(string[] args) { List<FileInfo> files = new List<FileInfo>(); files.Add(new FileInfo("d(1)")); files.Add(new FileInfo("d")); files.Add(new FileInfo("d(2)")); files.Sort(new CompareFileInfoEntries()); } } public class CompareFileInfoEntries : IComparer<FileInfo> { public int Compare(FileInfo f1, FileInfo f2) { return (string.Compare(f1.Name, f2

List<T> to DataView

杀马特。学长 韩版系。学妹 提交于 2019-12-03 13:00:17
How to convert List to a dataview in .Net. JeffFerguson My suggestion would be to convert the list into a DataTable, and then use the table's default view to build your DataView. First, you must build the data table: // <T> is the type of data in the list. // If you have a List<int>, for example, then call this as follows: // List<int> ListOfInt; // DataTable ListTable = BuildDataTable<int>(ListOfInt); public static DataTable BuildDataTable<T>(IList<T> lst) { //create DataTable Structure DataTable tbl = CreateTable<T>(); Type entType = typeof(T); PropertyDescriptorCollection properties =

Read id3 v2.4 tags with native Chrome Javascript/FileReader/DataView

假装没事ソ 提交于 2019-12-03 07:27:48
问题 Based on the answer of ebidel, one can read id3v1 tags by using jDataView: document.querySelector('input[type="file"]').onchange = function (e) { var reader = new FileReader(); reader.onload = function (e) { var dv = new jDataView(this.result); // "TAG" starts at byte -128 from EOF. // See http://en.wikipedia.org/wiki/ID3 if (dv.getString(3, dv.byteLength - 128) == 'TAG') { var title = dv.getString(30, dv.tell()); var artist = dv.getString(30, dv.tell()); var album = dv.getString(30, dv.tell(

C# DataView RowFilter, null value for DateTime column

落爺英雄遲暮 提交于 2019-12-02 21:34:57
问题 I'm trying to filter on null columns (I only want to show rows where the column is null), but the issue is I can't compare the column to a null, since the column is of DateTime value. I get the following error System.Data.EvaluateException: Cannot perform '=' operation on System.DateTime and System.String. This is my code for the filter CourseID IN (" + courseIds + ") AND Isnull(DateBooked, 'Null Column') = 'Null Column' DateBooked is the column with DateTime value. Everything before the

Read id3 v2.4 tags with native Chrome Javascript/FileReader/DataView

此生再无相见时 提交于 2019-12-02 20:08:50
Based on the answer of ebidel , one can read id3v1 tags by using jDataView : document.querySelector('input[type="file"]').onchange = function (e) { var reader = new FileReader(); reader.onload = function (e) { var dv = new jDataView(this.result); // "TAG" starts at byte -128 from EOF. // See http://en.wikipedia.org/wiki/ID3 if (dv.getString(3, dv.byteLength - 128) == 'TAG') { var title = dv.getString(30, dv.tell()); var artist = dv.getString(30, dv.tell()); var album = dv.getString(30, dv.tell()); var year = dv.getString(4, dv.tell()); } else { // no ID3v1 data found. } }; reader

getting index value 0 from dataview any list itemtap from sencha touch

江枫思渺然 提交于 2019-12-02 12:35:08
问题 I am unable to get index value form the dataview: { xtype: 'list', itemId: 'catList', store: 'CategoryStore', scrollable: false, layout: 'fit', itemHeight: 20, itemTpl: [ '<div>', '<tpl for="data">', '<span >{category_name}</span> ', '</tpl>', '</div>'], listeners: { 'itemtap': function(list, index, target, record, e, eOpts){ console.log(record.get('cat_id')); } } } Edited: If i put data static on store it works fine but it does not work while getting data from server: it works like as

C# DataView RowFilter, null value for DateTime column

霸气de小男生 提交于 2019-12-02 10:25:11
I'm trying to filter on null columns (I only want to show rows where the column is null), but the issue is I can't compare the column to a null, since the column is of DateTime value. I get the following error System.Data.EvaluateException: Cannot perform '=' operation on System.DateTime and System.String. This is my code for the filter CourseID IN (" + courseIds + ") AND Isnull(DateBooked, 'Null Column') = 'Null Column' DateBooked is the column with DateTime value. Everything before the Isnull is functioning correctly. Help please! Doesn't isnull always return a value of the same type as its

getting index value 0 from dataview any list itemtap from sencha touch

 ̄綄美尐妖づ 提交于 2019-12-02 05:40:01
I am unable to get index value form the dataview: { xtype: 'list', itemId: 'catList', store: 'CategoryStore', scrollable: false, layout: 'fit', itemHeight: 20, itemTpl: [ '<div>', '<tpl for="data">', '<span >{category_name}</span> ', '</tpl>', '</div>'], listeners: { 'itemtap': function(list, index, target, record, e, eOpts){ console.log(record.get('cat_id')); } } } Edited: If i put data static on store it works fine but it does not work while getting data from server: it works like as displayed on list: { xtype: 'list', itemId: 'catList', scrollable: false, data: [ { category_name: 'A', cat

Filter an integer using Like in BindingSoure.Filter or DataView.RowFilter

你离开我真会死。 提交于 2019-12-02 03:51:15
问题 I've Trying to filter a DataView which have multiple columns where some is numerical values. Everything works perfectly when typing in a string but once a numerical value gets entered (like checking for courier #) it filters to nothing. How My Data Displays before filter: How My Data Displays after filter: My Code is as followed: private void tbxSearchCourier_KeyUp(object sender, KeyEventArgs e) { string outputInfo = ""; string[] keyWords = tbxSearchCourier.Text.Split(' '); foreach (string

Filter an integer using Like in BindingSoure.Filter or DataView.RowFilter

蹲街弑〆低调 提交于 2019-12-02 02:14:55
I've Trying to filter a DataView which have multiple columns where some is numerical values. Everything works perfectly when typing in a string but once a numerical value gets entered (like checking for courier #) it filters to nothing. How My Data Displays before filter: How My Data Displays after filter: My Code is as followed: private void tbxSearchCourier_KeyUp(object sender, KeyEventArgs e) { string outputInfo = ""; string[] keyWords = tbxSearchCourier.Text.Split(' '); foreach (string word in keyWords) { if (outputInfo.Length == 0) { outputInfo = "('Courier #' LIKE '%" + word + "%' OR