select row datagrid and display in another datagrid - datagrid

when i select the first row it doesn't show only the data of the first row, it shows all the data of the table in the second datagrid
main screen
main screen
update screen edit first row
Add the following property to the form in the Init
ADDPROPERTY(Thisform,"returnobj", null )
in the edit button add the code
SELECT (thisform.Grid2.RecordSource) && selects the cursor area of ​​the grid control.
Thisform.ReturnObj = Newobject("Empty")
SCATTER NAME thisform.ReturnObj
Thisform.Release()
In the UNLOAD event of the grid form
RETURN Thisform.ReturnedObj
when only selecting the second row when editing if the data of the second row appears in the second data grid
update screen edit second row
add this code to position the cursor in the first row of the datagrid, when selecting only the first row it appears in the second datagrid but it does not work. Create the property movefirstgrid and its default value will be .F
in the form add to the click event
thisform.movefirstgrid=.T.
thisform.grdprices.setfocus
in the grid add to the setfocus event
if thisform.movefirstgrid
this.activatecell(1,1)
endif
thisform.movefirstgrid=.F.
in the second datagrid only the data of the first row is not show, shows all the data that the table has

Related

looking for plsql code based on oracle apex layout design

I have created a hidden item "P1_DOCUMENTS_COUNT" with default of 1. used plsql too increase it when users clicks the button "add row". Created 10 times the following row of items (# for the row number): P1_DOC_DATE_#, P1_DOC_DESCRIPTION_#, P1_DOC_NAME_#, P1_DOC_CATEGORY_#, P1_DOC_FILE_BROWSER_#. at the beginning - rows 2-9 will be hidden. when P1_DOCUMENTS_COUNT = n, show rows 1,2,...n.
Issue is I have cancel button on each row, I am looking for a solution so that if none of cancel button clicks then 1 by 1 clicking add row it shows all 10 rows but if cancel button gets clicked in the middle then that row should also appear by clicking add row. hope i clear my point.
for more info please check url: Multiple conditions on single button with Dynamic Action in Oracle Apex
Instead of braking your head on it - just change the "cancel" button to a "clear" button and empty the contents of the items without hiding the row.
alternatively - create an array of size 10 and keep the information on what's been clear in it
Create 9 hidden Items with default value of 0 (these are supposed to be hidden at the time when page loads)
Now on each click of Add Row button perform PLSQL code to check whether the Row is showing of 6 Items if not then change the value of hidden item to 1 and those row will be showing.
NOTE:- There are separate DA to show and hide items, 6 Items of row based on the value on hidden items.

In a QTableView how to check if the the whole row was selected (by clicking on the horizontal header)?

I have a QTableView with a model where not all the cell is selectable. I want to execute some code if the user selected the whole row by clicking on the horizontal header and not just by selecting a cell.
I looked around the QTableView selected methods and HorizontalHeader methods like:
horizontalHeader()->selectionModel()->hasSelection()
But that gives true even if only one cell was selected. I don't see how to check if the whole row is selected.
Any idea is appreciated.

Datagrid Flex 3 Single Row Selected

I have one flex datagrid which contains number of rows and column. I want to make selected row editable by clicking on edit button. Is it possible? I have try many samples but on that either entire datagrid is editable or particular row's single column is editable. Is there any way to make selected row editable by clicking on edit button?
You can get the selected row with the grid.selectedIndex property. One thought to you problem:
Add an "editable" property to you items in the datagrid which is false by default
When clicking on the button, set grid.selectedItem.editable = true;
Change the grid's item renderer to a new one, which displays TextInput fields if an item is editable or just plain Label if it's not
You can change the item renderer at runtime like this:
grid.itemRenderer = new ClassFactory(com.myapp.renderers.MyGridItemRenderer);

How can I add rows of data with dynamic images in Flex?

I want to add specific images to a datagrid row, depending on the data displayed on that row. These images need to be functional buttons with click handlers and everything.
For example, if a row displays status of a certain element, like "Editable" then the image displayed in the cell next to it needs to be a green flag, if it isn't Editable then I red flag should appear.
If you just need images and click handlers, there is an option to embed icons inside a datagrid.
Also, for a datagrid ,clicking on any row triggers the click event,the handler to which will give you datagrid.selectedIndex as the index of the row you clicked, which you can then use to get the data in that specific row and according to the data do a specific action you need.
To render icons in datagrid, you might want to check for labelFunction attribute, which allows you to specify a function , each time data in a datagrid row is filled, which yuo can use to determine the icon you would need the datagrid to render and show to the user.

Adding a new row in between rows in a grid view

I have an ASP .net grid view. It has some template columns like a command button, a text box, and a dropdown control. When I click the command button, a new row needs to be inserted below the current row (from where I hit the command button).
If I have rows 1 and 2 and I hit the command button in row1 a new row needs to be inserted between rows 1 and 2
Now in the new row I should be able to select values from dropdown and enter some value in a text box and finally hit my save button. (Which should work fine as I am expecting)
The grid view is bound to some data source say for instance a datatable for now.
Oneway that I could think about is when Command button is clicked, I can add a new row to the datatable in my server side code and rebind the grid. But I am not sure that, from a UI perspective how I can make sure that the new row goes exactly below the row from where I hit the command button.
Any thoughts or comments?
I think a much easier approach will be if you try to add the row in your data source and then bind to the GridView again. This is easy if you have DataSet or a custom entity collection. Since, you are using DataTable this will also work. Handle the click event and find the row that the user clicked. Go back to the dataTable and add an empty row there. This will make sure that the controls inside the GridView are persisted and you don't have to worry about adding DropDown controls etc.
You have to sort the datasource by an virtual index saved in an invisible column. On first databound(perhaps you take a DataView because of ots sorting capability) it will set to the original rowindex. After first hit of the save button you get the datatable again from database and add the additional row with an index after the "selected" row. Then you bind the GridView again with the sorted DataView.
I think you need another invisible column to detect the "temporary" row. If you dont need to edit the "normal" rows then you can use edititemtemplate for this. Otherwise you can make the dropdown and textbox visible and the other controls invisible in GridView.OnRoawDataBound.
There is a code sample that is used for adding a new row in between rows in a grid view.

Resources