selectionchanged

show different item on selectionchange on a grid

纵饮孤独 提交于 2019-12-18 09:18:09
问题 i have a grid and a form, i need to show different items on the form each time we select a row on that grid i ve been looking on how to do this, and found Ext.getCmp('myform').hide() // or .show() and listeners: { selectionchange: function () {...} now i dont know which row is selected so i can specify which item to show thanks 回答1: Try to following code in your grid. listeners:{ itemclick:function(view, record, item, index, e ) { var v = record.get('firstName'); .... .... } } firstName will

QAbstractTableModel retrieve custom object on data changed

﹥>﹥吖頭↗ 提交于 2019-12-13 12:23:11
问题 I have recently picked up Qt again, and started refreshing my memory. Creating a custom data model for a table was easy enough. Now I am trying to retrieve the selected data. Take note that I use custom data objects. Example of my custom model: platform.h class Platform { public: Platform(); Platform(QString name); QString getName(); void setName(QString name); private: QString m_name; }; Very simple data structure for testing purposes. I then implemented a QAbstractTableModel, the Data()

JList: previous selected item

丶灬走出姿态 提交于 2019-12-12 13:13:49
问题 I have a JList and register a selection handler (ListSelectionListener). Now I need to now the previous selected item/index. Up to now, I save the last selected item on my own. Is there a better way to do so? In other words: Is there are methode/best practice which I miss all the years?! 回答1: One of my list is single-selection-only. like kleopatra says. The event data does not help here. That is not what Kleopatra said. The event data does help. You just can't assume that the first index

How to get the selected item from the listpicker in windows phone 8?

扶醉桌前 提交于 2019-12-11 10:33:19
问题 I am using this code for create listpicker in windows phone. <StackPanel Height="148" Margin="0,100,0,0"> <toolkit:ListPicker Grid.Row="0" FontFamily="Segoe WP Semibold" Height="176" x:Name="Additional_Time" ItemTemplate="{StaticResource PickerItemTemplate}" FullModeItemTemplate="{StaticResource PickerFullModeItemTemplate}" FullModeHeader="Cities" SelectedIndex="0" CacheMode="BitmapCache" Header="Choose Exit Time" FontSize="30" SelectionChanged="Additional_Time_SelectionChanged"/> <

Listbox SelectionChanged not working with Button in its ItemTemplate

被刻印的时光 ゝ 提交于 2019-12-11 01:56:45
问题 Code below does not work when I select item in listbox, do you happen to know why? <ListBox BorderBrush="Transparent" Background="Transparent" Name="listbox" HorizontalAlignment="Center" VerticalAlignment="Center" ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionChanged="selection_changed"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Button Height="90" Width="150" Template="

Disable event bubbling on selectionchanged event- WPF

巧了我就是萌 提交于 2019-12-11 01:35:19
问题 I have a listbox inside a listview. on Both of them I have selectionchanged event. When I fire child control event parent control fires automatically. I need to stop this behaviour. Any hints? Thanks! <ListView Name="listView1" ItemContainerStyle="{StaticResource RowStyle}" AlternationCount="2" SelectionChanged="listViewTask_SelectionChanged"> <ListView.View> <GridView> <GridViewColumn Width="150"> <GridViewColumnHeader Name="gridViewColumnHeader1" Click="SortClick" Tag="Style" Content="Style

preventing row change in datagrid

≯℡__Kan透↙ 提交于 2019-12-10 12:43:24
问题 I have researched this and am stumped: I have a WPF DataGrid, and using an MVVM model. I want to, under certain circumstances, prevent the ability to change a row in the DataGrid. I have researched this and have tried techniques like the one found here. In practice, this works, however there is an undesirable 'flicker' (it selects the clicked row for a moment then goes back to the previous selection), while this is a close solution I wish there was a more elegant way such as preventing the

How to detect a selection change in my WTL::CListViewCtrl, and not in the parent?

狂风中的少年 提交于 2019-12-09 03:25:39
问题 I have my own WTL derived listcontrol. CPopupList : public CWindowImpl<CPopupList, WTL::CListViewCtrl>, It works fine, except one thing: I want to catch the notification when selection changes. Not in the parent window (like this: How to detect a CListCtrl selection change?) , but in the CPopupList itself, and then do some things. Actually I want a small hint window next to the currently selected item to appear, as an additional info of the current item. Just like VS does during autocomplete,

Silverlight MVVM, stop SelectionChanged triggering in response to ItemsSource reset

孤街醉人 提交于 2019-12-08 12:45:36
I have two ComboBoxes, A & B, each bound to an Observable Collection. Each has a SelectionChanged trigger is attached which is intended to catch when the user changes a selection. The trigger passes the selection to a Command. The collections implement INotifyPropertyChanged in that, in the Setter of each, an NotifyPropertyChanged event is fired. This is needed (in the MVVM approach) to notify the UI (the View) that the ComboBox's contents have changed. The two ComboBoxes are interdependent - changing the selection in A causes B to be repopulated with new items. Now, the problem is that B's

XAML ComboBox SelectionChanged Fires OnLoad

杀马特。学长 韩版系。学妹 提交于 2019-12-05 03:07:00
If I have a ComboBox that has a SelectionChanged event, it fires when I'm loading the control. So at page load I set the SelectedValue and the SelectionChanged event fires which is not what I want to happen. What is the accepted apporach to stopping this? Two obvious solutions to this would be 1) Wait until the Loaded event of the Window/Page/UserControl which contains the ComboBox and hook up SelectionChanged there...eg in the constructor: // set the inital selected index for the combo box here... this.Loaded += (s, args) => { cmbBox.SelectionChanged += new SelectionChangedEventHandler