problem with selecting a rows in advanced datagrid using keydown event - flex3

I have advanced datagrid with list of items is displayed.I am using keydown for selecting the rows.But the actual problem is when i am selecting the items after the 2nd item it should move to the 3rd item but instead of that its moving back to the 1st item.I have defined selectionmode property to singlerows even then the result same to be same.can any one give me the soloution.

i have resolved this issue..it was related to binding problem what we had in datgrid.

Related

How to Update the Values of a Dropdown in a Subform when the Main Form Changes

I have two forms:
InterviewMaster and InterviewDetail
InterviewDetail opens up as a subform in InterviewMaster and these two forms are linked through a common field called InterviewID
In InterviewDetail I have a textbox called Questiontype as well as combobox called InterviewDropdown.
The data in the dropdown varies based on the data on in the textbox. To make this happen, I have a next button to move to the next question. Whenever I click on next the following runs:
Dim ctlCombo As Control
Set ctlCombo = Forms!InterviewDetail!cmbInterviewDropdown
ctlCombo.Requery
The Row Source setting for my combobox is set to look up the required answers, again this is based on the value as per the textbox:
SELECT [queryAnswerOptions].[Answer] FROM queryAnswerOptions ORDER BY [Answer];
So the options are determined by my query called queryAnswerOptions
So as I cycle through my questions using my next and previous buttons, the dropdown options are updated based on the value of my textbox. This works perfectly when I open the subform from the navigation pane. However, when I open the main form and click on the next button my dropdown does not have any values. I've tried requerying the subform with no luck. I've also tried opening the subform in full screen from my main form but this also does not work. I also don't want to go that route as it does not work well with the overall flow of my form.
Any assistance will be greatly appreciated.
Problem with the query WHERE criteria parameter is when form is installed as a subform, the form reference no longer works because it must use the subform container control name. I always name container control different from the object it holds, such as ctrDetails.
Option is to put SQL statement directly in combobox RowSource instead of basing combobox RowSource on a dynamic parameterized query object - then it will work whether form is standalone or a subform.
SELECT Answer FROM InterviewAnswers WHERE QuestionID = [txtQuestionID] ORDER BY Answer;

When binding both the Items and SelectedValue to aListBox I seem to get a race condition, how to fix?

For a legacy project, I have a WinForm with a BindingSource1 bound to a strongly typed SQL 2005 DataSet. There is a BindingSource2 bound to the first on a relation.
When selecting a Row in DataGridView, I'd like to present a ListBox with all the child rows with one Item selected based on a value in the selected Row. I bound the DataGridView to BindingSource1, the ListBox' Datasource is BindingSource2, ValueMember and DisplayMember are set to the primary key and a description respectively. I added a Databinding of SelectedValue to the foreign key in BindingSource2.
On Load of the Winform and when the selected row changes by changing the sort order, everything is fine, all related rows show up in the ListBox and the correct item is highlighted.
When I click into the DataGridView, .Net seems to change the SelectedValue of the ListBox and repopulate its items after that. In Effect, when the newly selected item is already in the ListBox it gets highlighted, then the ListBox is filled with the new items and the first one is selected (SelectedValue is reset).
Is there any .EndEdit, .CancelSomething or .UpdateFoo that I am missing? How to ensure the internal sequence of Items.Clear(), (fill), and SelectedValue = x? I am stripping down the problem to a minimal project but if anyone has an idea I'd like to skip that part ; )
Added: All Bindings are set using the Designer of Visual Studio 2008 Pro, the project is VB.Net Framework 2.0 Winform.
I am documenting my workaround to further describe the problem I have. It might help others and possibly lead to a real solution.
Like in "How to bind the "SelectedValue" property of a combobox that gets his elements from a datasource?" the control is filled by DataSource, DisplayMember and ValueMember plus has a DataBinding of its SelectedValue. There seems to be a problem: In ListBox and ComboBox the Position of the DataSource (BindingSource2 in my example) define the current selected Item, binding SelectedValue to another DataSource leads to erratic behaviour.
For my workaoround I bound ListBox.DataSource to a DataView wich is filled / filtered in BindingSource2_ListChanged so the DataSource of the ListBox has no Position to use as SelectedItem / Index / Value. It then uses the DataBinding only and my UI shows the expected Behaviour.

Extjs4:Multiselect Option

In my form,i have a list of employees in a combo box and i need to map some employees to particular department.I need to change the combo-box to List box.Scenario is as follows,
1. List A contains all employees.
2. If i click 'Add' button the selected employees must move to list B
and list A must contain remaining employees
.
I searched for List box but i couldn't find in extjs4.
Is there any example or link for multiselect listbox in ext-js4?
Thanks
There is no built-in ListBox widget in ExtJs4. However, Ext.view.View may become an listbox after some manipulations.
Here is an example of such a tuned View. Demos may be found here, here and here (this one looks like just what you need).
You can create two such listboxes and the "add" button. Then assign handler to button which would remove selected item from the first listbox's store and add it to the second's store.

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.

VB.Net - select whole line in a multicolumn ListView and not only first item

I have a ListView in VB.Net.
I want to use it to display a table of data.
However I want to be able to click on a row and select it.
The component allows me to select a row only by clicking on the first item of each row.
Can I change that?
Is there a better component to display tables? (I've already tried the DataGridView. I don't like it's appearance)
This should simply be a matter of setting FullRowSelect on the control to be True.
Change the FullRowSelect property to True.