w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Binding Events to dataGrid MVVM
An awesome explanation is posted here on how get datagridrow double click event handled. http://brentedwards.net/2012/03/11/wpf-datagridrow-double-click-with-mvvm/

Categories : C#

Prevent Flex DataGrid mix events
At least I could solve my issue. I did not know that I could get the columnIndex when clicked the DataGrid and base on this, I could prevent that GridClick event run and in case the columnIndex were 0 it means that one of the two images were clicked.

Categories : Actionscript

How to expose Usercontrol Datagrid Events?
as far as I know, it's not possible directly expose the events, unless you "forward the event out" (handle the event inside and raise it out). but why not let developers just explicitly add the event handlers? for example AddHandler commonCtrolInstrance.DataGrid.Click, AddressOf ClickEventHandlerMethod and in order to let others to use it as a normal grid, at the property you created for DataGrid in CommonControl, do remember to put the attribute <System.ComponentModel.Browsable(True)> another option is to directly create your custom common control by inheriting from DataGrid

Categories : Dotnet

Not able to handle Filter and sort in a datagrid as separate events
You should override onBrowserEvent, identify the source of the click (whether it is your text input or your header (which is there instead of a "sort" button if I get you right). I assume you have two different clickable elements for each action, of course. The following code snippet just figure out if the cell's content was clicked or if the click happened on container (the cell itself). If the click happens on the input, do the filtering stuff. If it happens on the cell, do the sorting stuff. @Override public void onBrowserEvent(Context context, Element parent, T value, NativeEvent event, ValueUpdater<T> valueUpdater) { // Handle the click event. super.onBrowserEvent(context, parent, value, event, valueUpdater); if (CLICK.equals(event.getType())) { // Ignore c

Categories : Gwt

DataGrid edition 'EditItem' is not allowed for this view` when bound to a WPF DataGrid
I tried this and the problem is that you have initialized your Level2 collection as Hashset<>. IEditableCollectionView.EditItem() throws this error while trying to update item in Hashset<>. I initialized the collection as List<> and it was working fine. I am not sure why it is not able to update item in hashset, need to look deeper into it. But changing the Hashset<> to List<> will fix this error. Hope it helps Thanks

Categories : C#

Silverlight Datagrid scrolling, DataGrid fires RowLoading event
The RowLoading event is fired because rows are virtualized. With virtualization, rows are created (and loaded) only when they are visible on screen. So every time you scroll down or up a new row is created, loaded and the RowLoading event fired. To disable the virtualization you can try to set this property: VirtualizingStackPanel.VirtualizationMode="Standard" Be aware that this can slow down the performance of your grid if you have a lot of rows.

Categories : Database

Binding ComboBoxColumn to collection from DataGrid's ItemsSource in WPF DataGrid
MSDN: DataGridComboboxColumns says: To populate the drop-down list, first set the ItemsSource property for the ComboBox by using one of the following options: A static resource. For more information, see StaticResource Markup Extension. An x:Static code entity. For more information, see x:Static Markup Extension. An inline collection of ComboBoxItem types. So basically to just bind to data object`s collection property it`s better to use DataGridTemplateColumn: <DataGridTemplateColumn Header="Log"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding log}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> This type of c

Categories : Wpf

Validating A WPF Datagrid Against Data From Another Datagrid
From Microsoft official WPF course materials: ValidationRules are only to be used as simple validations (For instance Required fields, numeric formats, etc). If you need advanced / complex Business Rules validation, you should either implement IDataErrorInfo or create your own validation mechanism (that's what I did and it works like a charm)

Categories : C#

Copy selected row from datagrid at the end of datagrid
For Datagridview Databound you have to commit additional record to datasource (table) So, you have to do "INSERT INTO mytable ( fields here ... ) VALUES ( values here ..)" then to refresh your datagridview .. dt2.datasource = mytable ADDED : For your code ... try change like this insert_cmd.Parameters.AddWithValue("@Name", .item("Name")) insert_cmd.Parameters.AddWithValue("@Age", .item("Age"))

Categories : Sql Server

Master-Detail: On row click in master (DataGrid), display details (DataGrid)
If you searched online, you would have found a number of answers. For example, please take a look at the following articles: WPF Master Details MVVM Application Implementing a simple Master-Detail scenario for WPF in MVVM MVVM - Master Detail

Categories : Wpf

Copying data from a datagrid view to a new form with a new datagrid view VB
"Error 1 Reference to a non-shared member requires an object reference." As this message says: You need a instance of form2 - object of type form2created with New sub, which you created inside of BTN_Next_Click. But local variable frm_PI_01 can be used only inside of that function. With name of class form2 you can used only Shared member or functions/subs MSDN Shared members in VB My opinion if you need transfer some information/variables from form to another then in your case(when you transfer data only once when creating form) use a parameters in form constructors. Add another parameter to you form3 constructor. For example reference of your datagridview(this is may be not good practice referenced controls to another form, better create some variable with needed data and reference th

Categories : Vb.Net

Delphi tIdTCPClient with timer events and other multi-threaded client side events
TIdIOHandler has Write() and Read...() overloads for sending/receiving TStream data: procedure Write(AStream: TStream; ASize: TIdStreamSize = 0; AWriteByteCount: Boolean = False); overload; virtual; procedure ReadStream(AStream: TStream; AByteCount: TIdStreamSize = -1; AReadUntilDisconnect: Boolean = False); virtual; You do not need to copy the TMemoryStream contents to an intermediate TIdBytes before sending it, or receive it as TIdBytes before copying it back to the TStream. In fact, there is nothing in in the code you have shown that needs to use TIdBytes directly at all: procedure DoCommand(MyIdTCPClient: TIdTCPClient; var DATA: TMemoryStream); var CommsVerTest: String; begin //Write Data MyIdTCPClient.IOHandler.Write(DATA, 0, True); //Read back 6 bytes CommsVerTest s

Categories : Multithreading

Will changing an events Time-Zone affect other people on shared events?
Yes the timezone of an event will sync. If an event happens at 9 Mountain time, the event will be displayed as occurring at 9 to anyone whos devices general setiings is set to mountain time. If their device is eastern time, the event will appear to occur at 7. If you change the time zone of the event to Eastern, devices in mountain time will now see the event occurring at 11, and eastern time devices will see the event occurring at 9. So, changing the time zone does not change the time it occurs in its own time zone, but it will change it relative to where you moved it from. You can do 2 things after asking the user when the event occurs: 1) you can assume the event occurs in the users devices current time zone. 2) you can ask them where the event occurs and set the events time zone to t

Categories : IOS

Socket.io emitting and broadcasting events but wont "hear" events from the server
You are mixing up your client and server logic. This code (from your template): socket.on('addUser', function (data) { console.log("ADDING NEW USER:"); req.session.user = data; console.log(data); $("#usernames").append('<p>'+data+'</p>'); }); Is executing on the client side where there is not req object available. By default, socket.io and express sessions don't play together - you need to add some additional logic to your app. There are several projects that aim to make this easier such as: express.io session.socket.io

Categories : Node Js

iOS: Handle remote-control events and then relay the events to music apps
Make sure you call the following methods to begin receiving the events. [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; Then in your application delegate you need to listen for the events. -(void)remoteControlReceivedWithEvent:(UIEvent *)event{ if (event.type == UIEventTypeRemoteControl){ switch (event.subtype) { case UIEventSubtypeRemoteControlTogglePlayPause: break; default: break; } } }

Categories : IOS

Highcharts: how to handle touch events via plotOptions.series.events
Yeah, something like this is not supported, I advice you to create idea here. The only workaround which comes to my mind is use Element.on function to add custom events to elements which exists on a chart. For example: http://jsfiddle.net/3bQne/269/ chart: { renderTo: 'container', events: { load: function(){ var chart = this, path = chart.series[0].tracker; path.on('click', function() { alert("click");; }); } } }

Categories : Javascript

How can embed datagrid in datagrid
I don't think it's possible. You can indeed manually replace a cell with the HTML of another grid (your "child" grid), but Dojo maintains its data in a store. Your store won't be "aware" of any changes you make in the DOM nodes of your grid, and inserting a DataGrid in a store isn't possible either since the DataGrid maps its columns to properties of the data objects.

Categories : Database

Binding datagrid in datagrid
You have problem with DataContext here. In RowDetailsTemplate you trying to binding to a property in main view model, but DataContext of RowDetailsTemplate is the row item. If you want to binding to property in your main view model you should use RelativeSource binding. Try this: <DataGrid ItemsSource="{Binding Path=Files}" SelectedItem="{Binding Path=DataContext.CurentFile, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" AutoGenerateColumns="False" > ...

Categories : Wpf

How to add a new row in sql from datagrid and update sql row from same datagrid?
This article on codeproject does a nice (thorough) job of demonstrating what you are asking. It also comes with some demo code. http://www.codeproject.com/Articles/37430/Datagrid-Editing-Updating-Cancel-Selecting-Rows

Categories : SQL

Backbonejs Events for all collection items or Events per ItemView
If I understand you correctly, option 2 seems the most sane. You will be referring to this.model as opposed to digging through the collection to find the model associated with the clicked view.

Categories : Javascript

Adding new events without removing existing events in FullCalendar
It's hard to say without seeing the fetchEvents() function, but it may be that fetchAndRenderEvents() is calling a collection.reset. Assuming the events are stored in a collection, calling collection.set will do exactly that, but then you have to have your view set up to listen for add and remove events on the collection to keep the view in sync.

Categories : Javascript

FullCalendar: How to re-add events that were part of original events array?
I don't have an answer to "Why" but I can show you a work around if you copy the event object into another object it will work (using the new object) e2 = $.extend({}, e); http://jsfiddle.net/BNmrQ/5/

Categories : Jquery

KeyEventDispatcher - how to separate action key events from Unicode events
OK, that was really easy after all. If I only knew there's a KeyEvent.isActionKey() earlier... Didn't test all possible cases yet, but it seems to behave just as I expected.

Categories : Java

No events being shown when retrieving events using google calendar
As it's an array you need to use print_r instead of echo. Try replacing: echo $events; with print"<pre>".print_r($events, true)."</pre>";

Categories : PHP

Laravel 4 model events the same as regular events
You can handle model events via some helper functions or using model observers. But yes, behind the scenes, these events are fired Laravel's event dispatcher, so technically you could bind functions to those events via the Event facade, too.

Categories : Laravel

C# do some work after all events are raised (or combine events)
If I understand the question correctly, you increment a counter when you start your A tasks and when each task is completed, you decrement the counter in the event handler. Also in the event handler, you check to see (after decrementing the counter) if the counter is zero. If so, you do task B. I suggest you look at Tasks (aka "Task Parallel Library (TPL)"), which allows you to do something like this: Task.WhenAll( new Task[] { Task.Run(()=> { //... do work A1... }, Task.Run(()=> { //... do work A2... }, Task.Run(()=> { //... do work A3... }}) .ContinueWith(()=> {//... do work B... }); Update: Based on the mention of WPF animations in your comment below, Task.Run may NOT be a good fit here. If I remember correctly, you get a Completed event, and don't ha

Categories : C#

Events calendar- show the events in popup
You have added textview for each event, you should have added listview, instead and populated it with your events. Anyways for displaying it as popup you can use dialog and display a listview inside. At first I would create a list layout... something like: list_layout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:divider="#b5b5b5" android:dividerHeight="1dp" /> </LinearLayout> Then a simple TextView like: single_item_lay

Categories : Android

Events inside events at jQuery
A solution would be to use jQuery's one() method. one() - Attach a handler to an event for the elements. The handler is executed at most once per element. In this case, it would be: $('#link').one('click', function(){ alert("Clicked"); //fired multiple times $(this).parent().hide(); }); jsFiddle example here.

Categories : Javascript

Convert table of individual events-distances into a summary table of events
Add GROUP BY: SELECT last_name, first_name, count(if(event = 'A', 1, NULL) AND if(distance = 10, 1, NULL)) AS A10, count(if(event = 'A', 1, NULL) AND if(distance = 15, 1, NULL)) AS A15, count(if(event = 'B', 1, NULL) AND if(distance = 10, 1, NULL)) AS B10, count(if(event = 'B', 1, NULL) AND if(distance = 15, 1, NULL)) AS B15 FROM sample s GROUP BY last_name, first_name ORDER BY last_name, first_name;

Categories : Mysql

what is the difference between js events and DOM events?
Dom Events: This event perform on the DOM component to perform certain action over it like (events/properties,etc) Js Events: This events will perform action over the content of the DOM object like (validation(condition),expression,methods over the Dom object,etc)

Categories : Javascript

Checkbox with DataGrid WPF
For an MVVM Solution you could try this: <StackPanel> <DataGrid ItemsSource="{Binding Path=TestItems}" AutoGenerateColumns="False" Name="MyDataGrid" CanUserAddRows="False"> <DataGrid.Columns> <DataGridCheckBoxColumn Binding="{Binding IsSelected}" Width="50" > <DataGridCheckBoxColumn.HeaderTemplate> <DataTemplate x:Name="dtAllChkBx"> <CheckBox Name="cbxAll" Content="All" IsChecked="{Binding Path=DataContext.AllSelected,RelativeSource={RelativeSource AncestorType=DataGrid}}"/> </DataTemplate> </DataGridCheckBoxColumn.HeaderTemplate> </DataGridCheckBoxColumn> <DataGridTe

Categories : Wpf

How to have a DataGrid with two ButtonColumns in it?
Instead of OnSelectedIndexChanged="GradesDataGridSelectedCallback" Use OnItemCommand ="GradesDataGridSelectedCallback" And define your GradesDataGridSelectedCallback as Protected void GradesDataGridSelectedCallback(Object source , DataGridCommandEventArgs e) End Sub Checking e.CommandName would give you indication of which button is clicked.

Categories : C#

Triggers in datagrid
I'm not very experienced with DataGrid, so this might not be the best option, but I think you can achieve what you're after by styling the Row, rather than the individual Columns: <DataGrid <!-- Your settings here -->> <!-- Your column definitions here --> <DataGrid.RowStyle> <Style TargetType="DataGridRow"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Errorcode}" Value="0"> <Setter Property="Background" Value="LightGreen" /> <!-- Other Setters --> </DataTrigger> <DataTrigger Binding="{Binding Path=Filename}" Value="File not created"> <

Categories : C#

Add, Edit DataGrid in WPF
if you have created a database or a list, u can retrieve data and print on the datagrid.. database db = new database (); //database employees emp = new employees (); //list or table in db var result1 = (from t in db.employees select t).ToList(); datagrid1.Itemssource=result1; it prints the data on datagrid

Categories : C#

WPF MVVM DataGrid/Map
Use ObservableCollection for your data source but don't bind to that because that will bind to the default view of your collection, bind both controls to ICollectionView that you control so as you change your collection view in code both controls will update without the need to write any code to sync them... So in your case, when you filter the data, your view that is using TwoWay binding will change and since the map is bound to same view the changes in view will be immediately visible in the map as well...

Categories : Wpf

DataGrid Does not seem to allow editing
Ok, I just made an example that it is working. First I have my DataGrid definition: <asp:DataGrid ID="Grid" runat="server" DataKeyField="DatasetField1" AutoGenerateColumns="False" GridLines="None" OnCancelCommand="Grid_CancelCommand" OnEditCommand="Grid_EditCommand" OnUpdateCommand="Grid_UpdateCommand"> <Columns> <asp:BoundColumn HeaderText="Column1" DataField="DatasetField1"></asp:BoundColumn> <asp:BoundColumn HeaderText="Column2" DataField="DatasetField2"></asp:BoundColumn> <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" HeaderText="Edit"></asp:EditCommandColumn> </Columns> Second I must bind my data grid: public BindData() { .... Grid.DataSource = [MyDataSet With DatasetFi

Categories : C#

Cannot set DataGrid row header value
You should use HeaderText property of Columns collection instead: dataGridView_replaceTable.Columns[0].HeaderText="ROW HEADER 1"; You could also do this when you add your columns by using Caption property: public void addCol() { DataColumn column; column = new DataColumn(string colName); column.DataType = System.Type.GetType("System.String"); column.ColumnName = colName; column.Caption = "My header" // ASSIGN HEADERS HERE column.ReadOnly = false; replaceTableValues.Columns.Add(column); }

Categories : C#

Can't refresh datagrid
If you see the old value with that type of data binding, it means you don't update the initial source, but only the temporary one (in your case t_KlantenViewSource). Calling Refresh method on the data added by FindResource cause app to reload it from pre-compiled resource, which won't change in this case. In other words, the problem is you use pre-compiled resource On the same time, you fill the dataset with actual data, but your dataset is in memory, view source - inside application file. You can try: binding ItemsSource of the entire datagrid or separate column to the TableAdapter dataset change resource compiling behaviour to Content, thus the app will reload it from external file each time you call Refresh method. ADDITION: You can find a solution for your case, just to save ti

Categories : C#

Opening PDF from a DataGrid
Process.Start("filename") will open a file using the default application on that machine. In most cases, the above approach is correct. It is not dependent on a particular application or particular version of the application being pre-installed on the target machine. The advantage is loose coupling between your application and the PDF viewer. If you really need to, you can use Process.Start() to launch a particular program, many of which will accept a filename as a command line parameter, like so: Process.Start("IExplore.exe", "C:myPathmyFile.htm") (This example taken from the linked MSDN documentation) You can find a list of Adobe Reader's command line arguments here: Adobe Reader Command Line Reference Update: The above link is old (focuses on version 7). You can find version 8 d

Categories : Vb.Net

Vi move through DataGrid
If I understand the issue correctly - you have a focus and selection per row. You want to move focus via k/j keys and to toggle selection via x key. I like to use behaviors in these situations - it requires reference to System.Windows.Interactivity.dll from blen SDK but it also makes for a cleaner and modular code. [edit: this is a quick POC that I did. It will probably require some more null reference protection and handling of fringe/edge cases] The behavior is: using System; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Input; using System.Windows.Interactivity; namespace GridNavigationTest { public class GridNavigationBehavior : Behavior<DataGrid> { #region Overrides of Behavior ///

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.