Search Results

Search found 1403 results on 57 pages for 'yui datatable'.

Page 2/57 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How can we copy the column data of one datatable to another,even if there is different column names

    - by Harikrishna
    I have two datatables. First is DataTable NameAdressPhones = new DataTable(); with Three columns Name,Adress and PhoneNo.But I want only two columns Name and Adress data so I am copy those columns (with data) to the new datatable DataTable NameAdress = new DataTable(); For that I do foreach (DataRow sourcerow in NameAdressPhones.Rows) { DataRow destRow = NameAdress.NewRow(); foreach (string colname in columns) { destRow[colname] = sourcerow[colname]; } NameAdress.Rows.Add(destRow); } Now I clear every time the NameAdressPhones(first) datatable when there are new records in the table.And every time there will be same no of columns but column name will be different like Nm instead of Name,Add instead of Address.Now problem is second datatable have already column names Name and Address and now I want to copy the columns data of Nm and Add to the second datatabel but the column names are different to the second datatable.So even If there is different column names I want to copy Nm column data of first datatable to the column Name of second datatable and column Add data of first datatable to column Address of second datatable.

    Read the article

  • What is the correct date format for a Date column in YUI DataTable ?

    - by giulio
    I have produced a data table. All the columns are sortable. It has a date in one column which I formatted dd/mm/yyyy hh:mm:ss . This is different from the default format as defined in the doco, but I should be able to define my own format for non-american formats. (See below) The DataTable class provides a set of built-in static functions to format certain well-known types of data. In your Column definition, if you set a Column's formatter to YAHOO.widget.DataTable.formatDate, that function will render data of type Date with the default syntax of "MM/DD/YYYY". If you would like to bypass a built-in formatter in favor of your own, you can point a Column's formatter to a custom function that you define. The table is generated from HTML Markup, so the data is held within "" tags. This gives me some more clues about compatible string dates for javascript: In general, the RecordSet expects to hold data in native JavaScript types. For instance, a date is expected to be a JavaScript Date instance, not a string like "4/26/2005" in order to sort properly. Converting data types as data comes into your RecordSet is enabled through the parser property in the fields array of your DataSource's responseSchema I suspect that the I'm missing something in the date format. So what is an acceptable string date for javascript, that Yui dataTable will recognise, given that I want format it as "dd/mm/yyyy hh:mm:ss" ?

    Read the article

  • Why does calling the YUI Datatable showCellEditor not display the editor?

    - by t-boy
    Clicking on the second cell (any row) in the datatable causes the cell editor to display. But, I am trying to display the cell editor from code. The code looks like the following: var firstEl = oDataTable.getFirstTdEl(rowIndex); var secondCell = oDataTable.getNextTdEl(firstEl); oDataTable.showCellEditor(secondCell); When I debug into the datatable.js code (either with a click or from the code above) it follows the same path through the showCellEditor function but the above code will not display the editor. I am using YUI version 2.8.0r4.

    Read the article

  • How do I use SLIDE instead of FADE in a YUI Menu animation?

    - by Avry
    I'm using the following configuration for a menu that is attached to a button: var srchTypeMenuConfig = { shadow: false, effect: { effect: YAHOO.widget.ContainerEffect.FADE, duration: .25 } }; I get a nice fade in and out for my menu when I click on the button; I'd rather have it slide in and out though. I replace YAHOO.widget.ContainerEffect.FADE with YAHOO.widget.ContainerEffect.SLIDE and the menu doesn't appear. Is there a way for me to get YUI to give me the slide effect? Here's what I've done so far: 1) Looked at the examples. 2) Looked at some effects examples from DavGlass' blog. 3) Searched the forums for 'ContainerEffect.SLIDE'. 4) Searched SO for 'ContainerEffect.SLIDE [YUI]'. I haven't found any helpful information. I suspect that I need to add something to my configuration, but I don't understand why fade would work but slide doesn't.

    Read the article

  • C# NullReferenceException when passing DataTable

    - by Timothy
    I've been struggling with a NullReferenceException and hope someone here will be able to point me in the right direction. I'm trying to create and populate a DataTable and then show the results in a DataGridView control. The basic code follows, and Execution stops with a NullReferenceException at the point where I invoke the new UpdateResults_Delegate. Oddly enough, I can trace entries.Rows.Count successfully before I return it from QueryEventEntries, so I can at least show 1) entries is not a null reference, and 2) the DataTable contains rows of data. I know I have to be doing something wrong, but I just don't know what. private delegate void UpdateResults_Delegate(DataTable entries); private void UpdateResults(DataTable entries) { dataGridView.DataSource = entries; } private void button_Click(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(PerformQuery)); t.Start(); } private void PerformQuery() { DateTime start = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, dateTimePicker1.Value.Day, 0, 0, 0); DateTime stop = new DateTime(dateTimePicker2.Value.Year, dateTimePicker2.Value.Month, dateTimePicker2.Value.Day, 0, 0, 0); DataTable entries = QueryEventEntries(start, stop); Invoke(new UpdateResults_Delegate(UpdateResults), entries); } private DataTable QueryEventEntries(DateTime start, DateTime stop) { DataTable entries = new DataTable(); entries.Columns.Add("colEventType", typeof(Int32)); entries.Columns.Add("colTimestamp", typeof(Int32)); entries.Columns.Add("colDetails", typeof(String)); ... conn.Open(); using (SqlDataReader r = cmd.ExecuteReader()) { while (r.Read()) { entries.Rows.Add(result.GetInt32(0), result.GetInt32(1), result.GetString(2)); } } return entries; }

    Read the article

  • C# Bind DataTable to Existing DataGridView Column Definitions

    - by Timothy
    I've been struggling with a NullReferenceException and hope someone here will be able to point me in the right direction. I'm trying to create and populate a DataTable and then show the results in a DataGridView control. The basic code follows, and Execution stops with a NullReferenceException at the point where I invoke the new UpdateResults_Delegate. Oddly enough, I can trace entries.Rows.Count successfully before I return it from QueryEventEntries, so I can at least show 1) entries is not a null reference, and 2) the DataTable contains rows of data. I know I have to be doing something wrong, but I just don't know what. private void UpdateResults(DataTable entries) { dataGridView.DataSource = entries; } private void button_Click(object sender, EventArgs e) { PerformQuery(); } private void PerformQuery() { DateTime start = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, dateTimePicker1.Value.Day, 0, 0, 0); DateTime stop = new DateTime(dateTimePicker2.Value.Year, dateTimePicker2.Value.Month, dateTimePicker2.Value.Day, 0, 0, 0); DataTable entries = QueryEventEntries(start, stop); UpdateResults(entries); } private DataTable QueryEventEntries(DateTime start, DateTime stop) { DataTable entries = new DataTable(); entries.Columns.AddRange(new DataColumn[] { new DataColumn("event_type", typeof(Int32)), new DataColumn("event_time", typeof(DateTime)), new DataColumn("event_detail", typeof(String))}); using (SqlConnection conn = new SqlConnection(DSN)) { using (SqlDataAdapter adapter = new SqlDataAdapter( "SELECT event_type, event_time, event_detail FROM event_log " + "WHERE event_time >= @start AND event_time <= @stop", conn)) { adapter.SelectCommand.Parameters.AddRange(new Object[] { new SqlParameter("@start", start), new SqlParameter("@stop", stop)}); adapter.Fill(entries); } } return entries; } Update I'd like to summarize and provide some additional information I've learned from the discussion here and debugging efforts since I originally posted this question. I am refactoring old code that retrieved records from a database, collected those records as an array, and then later iterated through the array to populate a DataGridView row by row. Threading was originally implemented to compensate and keep the UI responsive during the unnecessary looping. I have since stripped out Thread/Invoke; everything now occurs on the same execution thread (thank you, Sam). I am attempting to replace the slow, unwieldy approach using a DataTable which I can fill with a DataAdapter, and assign to the DataGridView through it's DataSource property (above code updated). I've iterated through the entries DataTable's rows to verify the table contains the expected data before assigning it as the DataGridView's DataSource. foreach (DataRow row in entries.Rows) { System.Diagnostics.Trace.WriteLine( String.Format("{0} {1} {2}", row[0], row[1], row[2])); } One of the column of the DataGridView is a custom DataGridViewColumn to stylize the event_type value. I apologize I didn't mention this before in the original post but I wasn't aware it was important to my problem. I have converted this column temporarily to a standard DataGridViewTextBoxColumn control and am no longer experiencing the Exception. The fields in the DataTable are appended to the list of fields that have been pre-specified in Design view of the DataGridView. The records' values are being populated in these appended fields. When the run time attempts to render the cell a null value is provided (as the value that should be rendered is done so a couple columns over). In light of this, I am re-titling and re-tagging the question. I would still appreciate it if others who have experienced this can instruct me on how to go about binding the DataTable to the existing column definitions of the DataGridView.

    Read the article

  • Comparing YUI and Ext JS

    - by Spike Williams
    I've been using Ext JS as my rich-widget toolkit for a while, but I'm thinking of moving to YUI, partly because of the less restrictive license. The component-oriented model used in YUI seems quite similar to the one that I've enjoyed so much in Ext JS, but I'm interested in how deep those similarities are. So I'm interested in feedback from people who've used both Ext JS and YUI. What is the same, and what is different? What do I lose by moving to YUI, and what do I gain?

    Read the article

  • Is it possible to have yui editor change paragraph style without selecting text?

    - by user126861
    Is it possible to change the behavior of the yui text editor so that when you make markup changes (via the toolbar bar buttons), for example changing from a paragraph to say a heading or to a list, and you dont have any text selected it assumes you mean the current block that the cursor is in So to change a paragraph to a heading rather than selecting the whole line you just place the cursor somewhere in the paragraph and select heading from the styles drop down.

    Read the article

  • ICollectionView.SortDescriptions sort does not work if underlying DataTable has zero rows

    - by BigBlondeViking
    We have a WPF app that has a DataGrid inside a ListView. private DataTable table_; We do a bunch or dynamic column generation ( depending on the report we are showing ) We then do the a query and fill the DataTable row by row, this query may or may not have data.( not the problem, an empty grid is expected ) We set the ListView's ItemsSource to the DefaultView of the DataTable. lv.ItemsSource = table_.DefaultView; We then (looking at the user's pass usage of the app, set the sort on the column) Sort Method below: private void Sort(string sortBy, ListSortDirection direction) { ICollectionView dataView = CollectionViewSource.GetDefaultView(lv.ItemsSource); dataView.SortDescriptions.Clear(); var sd = new SortDescription(sortBy, direction); dataView.SortDescriptions.Add(sd); dataView.Refresh(); } In the Zero DataTable rows scenario, the sort does not "hold"? and if we dynamically add rows they will not be in sorted order. If the DataTable has at-least 1 row when the sort is applied, and we dynamically add rows to the DataTable, the rows com in sorted correctly. I have built a standalone app that replicate this... It is an annoyance and I can add a check to see if the DataTable was empty, and re-apply the sort... Anyone know whats going on here, and am I doing something wrong? FYI: What we based this off if comes from the MSDN as well: http://msdn.microsoft.com/en-us/library/ms745786.aspx

    Read the article

  • Sort on DataView does not work if DataTable has zero rows

    - by BigBlondeViking
    We have a WPF app that has a DataGrid insode a ListView. private DataTable table_; We do a bunch or dynamic column generation ( depending on the report we are showing ) We then do the a query and fill the DataTable row by row, this query may or may not have data.( not the problem, an empty grid is expected ) We set the ListView's ItemsSource to the DefaultView of the DataTable. lv.ItemsSource = table_.DefaultView; We then (looking at the user's pass usage of the app, set the sort on the column) Sort Method below: private void Sort(string sortBy, ListSortDirection direction) { var dataView = CollectionViewSource.GetDefaultView(lv.ItemsSource); dataView.SortDescriptions.Clear(); var sd = new SortDescription(sortBy, direction); dataView.SortDescriptions.Add(sd); dataView.Refresh(); } In the Zero DataTable rows scenario, the sort does not "hold"? and if we dynamically add rows they will not be in sorted order. If the DataTable has at-least 1 row when the sort is applied, and we dynamically add rows to the DataTable, the rows com in sorted correctly. I have built a standalone app that replicate this... It is an annoyance and I can add a check to see if the DataTable was empty, and re-sort... Anyone know whats going on here, and am I doing something wrong? FYI: What we based this off if comes from the MSDN as well: http://msdn.microsoft.com/en-us/library/ms745786.aspx

    Read the article

  • Grails easygrid plugin, Datatable implementation

    - by Robert Morning
    I'm playing with the datatable implementation in the Easygrid plugin and I have to say i love it but I have a question . If i use datatable directly (ie outside of Easygrid) to decorate a table i get a global search box defined above my table . If i use the Easygrid implementation and define my grid in a controller I get filters added for each column but no search box - it is added but then removed somehow either by easygrid itself or some parameter passed to datatable . How can I restore the search box and is this a bug as i would have thought the default implementation of datatable supplied via easygrid should match the default implementation supplied by the vanilla datatable itself? I'm using Grails 2.3.7 and Easygrid 1.6.2 .. Thanks

    Read the article

  • Customized sorting on DataTable in C#?

    - by Steve
    This is a C# Winform question. I have a DataGridView which is bounded to a DataTable. I construct the DataTable myself, which several DataColumn instances. When the DataTable is bound to the DataGridView, by default, every column is sortable by clicking the headers of the DataGridView. But the sorting behavior is something "by default". It seems that it is sorted by string. This is true even if I put this as my code: DataColumn dc = new DataColumn("MyObjectColumn", typeof(MyObject)); And MyObject has overriden ToString() and has implemented the IComparable interface. That means even if I have told the DataTable how to sort the special column with the implementation of IComparable interface, DataGridView still doesn't do it the way I expect. So how can I let DataTable sort data in the way I want? Thanks for the answers.

    Read the article

  • YUI button onclick get value

    - by Simon
    I have a a set of yui buttons generated using the standard yui html. <span class="yui-button yui-checkbox-button" id="analystbutton1"> <span class="first-child"> <button type="button" class="facetbutton" tabindex="0" id="analystbutton1-button"> Joe Bloggs </button> </span> </span> I create the buttons like so, and I then have some javascript to create the button and the listener. var analystCButton1 = new YAHOO.widget.Button("analystbutton1", { type:"checkbox", value:"BLOGGS", checked:false }); analystCButton1.on("click", onFacetClick); Finally I have the onFacetClick function var onFacetClick = function (e) { // e is the event var target = YAHOO.util.Event.getTarget(e); var button = new YAHOO.widget.Button(target); alert(button.get('type')); alert(button.get('id')); alert(button.get('value')); }; When I click on any of my buttons the first two alerts display the type and id (although not what I would expect). I cannot get the value, the alert doesn't fire, but I see no error in FireBug or the error console. alert(button.get('type')); returns push - I would expect checkbox alert(button.get('id')); returns analystbutton1-button

    Read the article

  • Get the BindingSource position based on DataTable row

    - by Ronald
    I have a datatable that contains the rows of a database table. This table has a primary key formed by 2 columns. The components are assigned this way: datatable - bindingsource - datagridview. What I want is to search a specific row (based on the primary key) to select it on the grid. I cant use the bindingsource.Find method because you only can use one column. I have access to the datatable, so I do manually search on the datatable, but how can I get bindingsource row position based on the datatable row? Or there is another way to solve this? Im using Visual Studio 2005, VB.NET.

    Read the article

  • YUI Datatable Not Taking JSON

    - by Pete Herbert Penito
    I am trying to fill a Datatable with a JSON using YUI, I have this JSON: [{"test":"value1", "test2":"value2", "test3":"value3", "topic_id":"123139007E57", "gmt_timestamp":1553994442, "timestamp_diff":-1292784933382, "status":"images\/statusUp.png", "device_id":"568FDE9CC7275FA"}, .. It continues like this with about 20 different devices, and I close it with a ] I just want to print select keys in the datatable so my Column Definitions look like this: var myColumnDefs = [ {key:"test", sortable:true, resizeable:true}, {key:"test2", sortable:true, resizeable:true}, {key:"topic_id", sortable:true, resizeable:true}, {key:"status", sortable:true, resizeable:true}, {key:"device_id", sortable:true, resizeable:true}, ]; var myDataSource = new YAHOO.util.DataSource(bookorders); myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; myDataSource.responseSchema = { fields: ["test","test2","topic_id","status","device_id"] }; var myDataTable = new YAHOO.widget.DataTable("basic", myColumnDefs, myDataSource); It's print Data Error for some reason, what am I doing wrong? Thanks! I have tested the validity of the JSON at JSONLint and it says it is valid.

    Read the article

  • Incorporation of YUI 3 in rails

    - by lorefnon
    I was wondering if any effort has been made towards integration of YUI3 with rails asset pipeline. By integration, I don't just mean a couple of helpers for including the library but rather a complete integration of YUI module loader. I'll elaborate the idea in detail: Currently, developers developing modules using YUI rely on Ant tasks for concatenating the module components and wrapping them up with some associated metadata and generating target files ( and optionally minifying and running jslint). Also, when fetching the modules, the YUI loader calculates the module dependencies and generates a single file comprising of all the dependencies which havent been included already in the page. I was wondering if the whole functionality could be seamlessly integrated into the Asset pipeline of rails.

    Read the article

  • Binding WPF DataGrid to DataTable using TemplateColumns

    - by Chris J
    I have tried everything and got nowhere so I'm hoping someone can give me the aha moment. I simply cannot get the binding to pull the data in the datagrid successfully. I have a DataTable that contains multiple columns with of MyDataType} public class MyData { string nameData {get;set;} boolean showData {get;set;} } MyDataType has 2 properties (A string, a boolean) I have created a test DataTable DataTable GetDummyData() { DataTable dt = new DataTable("Foo"); dt.Columns.Add(new DataColumn("AnotherColumn", typeof(MyData))); dt.Rows.Add(new MyData("Row1C1", true)); dt.Rows.Add(new MyData("Row2C1", false)); dt.AcceptChanges(); return dt; } I have a WPF DataGrid which I want to show my DataTable. But all I want to do is to change how each cell is rendered to show [TextBlock][Button] per cell with values bound to the MyData object and this is where I'm having a tonne of trouble. My XAML looks like this <Window.Resources><ResourceDictionary><DataTemplate x:Key="MyDataTemplate" DataType="MyData"> <StackPanel Orientation="Horizontal" > <Button Background="Green" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,0,0,0" Content="{Binding Path=nameData}"></Button> <TextBlock Background="Green" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding Path=nameData}"></TextBlock> </StackPanel> </DataTemplate></ResourceDictionary></Window.Resources> <Grid> <dg:DataGrid Grid.Row="1" AutoGenerateColumns="True" x:Name="dataGrid1" SelectionMode="Single" CanUserAddRows="False" CanUserSortColumns="true" CanUserDeleteRows="False" AlternatingRowBackground="AliceBlue" AutoGeneratingColumn="dataGrid1_AutoGeneratingColumn" ItemsSource="{Binding}" /> now all I do once loaded is to attempt to bind the DataTable to the WPF DataGrid dt = GetDummyData(); dataGrid1.ItemsSource = dt.DefaultView; The TextBlock and Button show up, but they don't bind, which leaves them blank. Could anyone let me know if they have any idea how to fix this. This should be simple, thats what Microsoft leads us to believe. I have set the Column.CellTemplate during the AutoGenerating event and still get no binding. Please help!!!

    Read the article

  • How to use linkbuttons within yui datatable?

    - by Pandiya Chendur
    I use yui datatable and i have a field which is resumePath which is path to a file in a folder in my application... So how to use linkbutton and show my path on it... { key: "resumepath", label: "Resumepath", width: 250, formatter: YAHOO.widget.DataTable.formatLink } and this doesnt work any suggestion... I want to make this file to downloaded when the user clicks on it..

    Read the article

  • YUI - Pros and Cons

    - by StackOverflowNewbie
    I'm about to begin a new project and plan to use YUI and my JS and CSS framework for the following reasons: Treeview with tri-state checkboxes (seems to be the best implementation I could find) Calandar (seen others, but since #1 is on YUI, I'm glad it also has calendar) CSS framework (was going to use 960, but might as well go 100% Yahoo) I plan to use only 1 JS framework. Does anyone see any problems with my decision?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >