Delete/Add row - GetRow/currentrow returns invalid row

Ok - I'm at a loss... we have Powerbuilder 8.01. 9056 AND 8.0.3 9704 (each 
with their corresponding version of the PFC).

In 8.0.1 we are having issues with rowfocuschanged/changing after we delete 
rows from a datawindow.  For some reason, if we have say, two rows (and the 
second row has focus) and, the user selects that row and we delete both 
(which is a requirement based on the data) - now there are no rows - which 
is correct.  However, when we go to add another row, currentrow/getrow both 
return 2 not 1 which is causing invalid column references all over the 
place.

This same code works fine in 8.0.3.  So, now the obvious thing to do would 
be to simply upgrade (which I'm all for) however, my company requires a 
full regression test before upgrading....

I'm wondering if anyone else has encountered this and, if so, is there a 
way to code around it to make it work or - am I basically screwed??

Any/all help is appreciated!
0
William_Shiers
6/18/2003 7:35:08 PM
sybase.powerbuilder.general 62418 articles. 18 followers. Follow

3 Replies
678 Views

Similar Articles

[PageSpeed] 33

Got a solution - basically - All i did to fix it was assign an invalid 
dataobject to the datawindow after the delete where no rows exist and then 
reassign the correct one - problem solved.....

No idea why it was happening though.
0
William_Shiers
6/18/2003 7:49:43 PM
Actually - that works fine if there are no rows left - I'm stuck if I have 
rows left in the datawindow that are supposed to stay - then what??
0
William_Shiers
6/18/2003 7:55:47 PM
Can you not check that the ROW argument is > 0 and <= this.rowcount() before
you go and do something?  Indeed, I think the arguments to rowfocuschanged are
a DWO, and a row number.  You need to code up to check that the DWO is
indeed pointing to a column, and furthermore, that the ROW is a valid number
of an existing row.  The event could be fired when the user clicks in the
heading
band or something (though it probably isn't supposed to).  Then using GETROW
is also problematic because that's the current row in the DW, not necessarily
the
row the focus was changed to, which is passed as argument to the event.

Try using ROW and checking the DWO for being a column in the detail band of
the DW.  May have to do some describes or something to be sure.  Also it's
possible the DWO itself is invalid, that is, doesn't point to any particular
part of the
DW such that you cannot even get its name through dot notation!!!

William_Shiers wrote:

> Ok - I'm at a loss... we have Powerbuilder 8.01. 9056 AND 8.0.3 9704 (each
> with their corresponding version of the PFC).
>
> In 8.0.1 we are having issues with rowfocuschanged/changing after we delete
> rows from a datawindow.  For some reason, if we have say, two rows (and the
> second row has focus) and, the user selects that row and we delete both
> (which is a requirement based on the data) - now there are no rows - which
> is correct.  However, when we go to add another row, currentrow/getrow both
> return 2 not 1 which is causing invalid column references all over the
> place.
>
> This same code works fine in 8.0.3.  So, now the obvious thing to do would
> be to simply upgrade (which I'm all for) however, my company requires a
> full regression test before upgrading....
>
> I'm wondering if anyone else has encountered this and, if so, is there a
> way to code around it to make it work or - am I basically screwed??
>
> Any/all help is appreciated!

0
woz
6/18/2003 8:13:46 PM
Reply:

Similar Artilces:

foreach in DataTable.Rows returns deleted row?
What are the circumstances under which you will be returned a data row with a row state of "Deleted" when iterating the rows collection of a data table?I'm getting a DeletedRowInaccessibleException in my application.  However when I try to recreate the scenario in a test app the deleted row is skip in the foreach loop.What are the rules for this? -Thx  You should not get that! Did you made any modifications? What do you do previous to that? CheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question! It's someth...

How to add a footer row to a table after deleting all footer rows
I'm sure this is a very easy thing to do, but I can't figure out how to do it. I have a table, and I deleted all the footer rows.  Now I would like to add one footer row.  How do I do that? If I right-click on the detail row and select Insert Row Below, it is, of course, another detail row. I'm stumped -- thanks for any help you can give!Cynthia Do you have groups in your table?  You should be able to right click on any table row and toggle the corresponding menu item to show the table header, details or footer.  It is in the right click menu includ...

Add row to table with table.row.add()
Everytime I click on a button I want to add a tableRow to a table like this:        TextBox TB = new TextBox();                TableCell Cell = new TableCell();        Cell.Controls.Add(TB);        TableRow Row = new TableRow();        Row.Cells.Add(Cell);        table.Rows.Add(Row);It works the first time, but when I click the button again the last r...

Delete Row Method (getting the primarykey of row being deleted)
Hello friends,I'd like to retrieve the primary key of the row being deleted so i can use it as a parameter in my stored procedure: Here's how far i have come with my code. I need help with line 6.Thanks in advance :)  1 Protected Sub DependentsObjectDataSource_Deleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles DependentsObjectDataSource.Deleting2 3 'get value of deleting depednent id4 'Delete (Unenroll) all benefits dependent enrolled in before attempting to delete dependen...

Returning n rows, setting start row, total number of rows
Hi, I'm try to find out how ado.net can perform some of the things i am able to do in ado. Here is the scenario: I will be searching a table that may have 1000's of rows. I want to be able to dictate how many rows (page size) to return and what the starting row number is and be able to find out how many total rows would be returned by the query. Using old ado recordsets I was able to get the recordset and get the count or all the rows (.recordcount - ormaybe it was .rowcount) and then jump to the starting position (.absoluteposition). How can I do the equivalent in .net? From loo...

Delete row removes all rows
When datawindow row 1 is clicked and selected then a pfc_deleterow is issued all dw rows are deleted. dw_1 update spec is "update", not delete then insert. Only one key column on the table which is a serial column. ll_rtn = dw_1.event pfc_DeleteRow() ll_rtn count does indicate that all rows were deleted. If any other row is selected then only the selected row is deleted. When the window is 1st opened and row one is displayed but not selected, only row 1 is deleted. Is this the expected behavior? PB 7.02 8046, NT 4.0, and the corresponding version of SQLAnywhere (whate...

First Row, Next Row, Prior Row, Last Row
I have a SQL Anywhere 7.0 Database, have a table Product_detail which contains Column Name Datatype width Null Default batch_id char(10) No None prod_id Integer No None employee_id Integer No None quantity Integer No None price Numeric (14, 2) No None Its primary key is batch_id I have a Freeform Datawindow with this table I want to provide the first row, next row, prior row and last row Ho...

Repeater display row w/ data when Row.count = 0 (i.e. add a row)
Hi, OK, working w/ nested repeaters - outer repeater will always have data but inner repeater may or may not have data - i.e: Record 1 (outer repeater) - Record 1a (inner repeater) - Record 1b - Record 1c Record 2 - no data Record 3 - Record 3a - Record 3b ... What I need to do is for each loop of the inner repeater where there is no data, force the inner repeater to display a single row that will be populated with previously-obtained data. This is a monthly report of active and inactive aircraft and while most will always have records in th...

GridView.Rows.Count after deleting rows
How do I get the count of GridView's data rows that is displaying?If I use GridView.Rows.Count, after deleting a row, it won't change - as same as before deleting, and nor do GridView.DataKeys.Count.  My blog (zh-CN)Be and awear of who you are. Most likely, you'll have to re-bind the data after the deletion. If so, go ahead and retrieve your count during the DataBound event, then you'll know you're retrieving an accurate count.Thanks, EdMicrosoft MVP - ASP/ASP.NET Yes, that's the easiest way to do this.I finally chose another way: in DataBound event, record the count, and in&nb...

Select a Row in DataGrid and Delete this Row
My goal is to put the Rows from one (left) GridView into the secend (right) GridVIew.For this I would like to use Drag and Drop becauce this would do just that but I can find only D&D features in e.g. Dojo. Is it possible in ASP.NET, too?Because I didn't find the D&D solution for ASP.NET I created two GridViews with a SELECT Label for choosing a Row. Then I chosen the SelectedIndexChanged event but when I want to delete the selected row then an error occurs that this isn't possible. Does anyone knows how I can solve my problem? Thank you!  Hello!!Plz see following lin...

How to delete Datagrid row if that row is not selected
Hi, I faced a problem. I have a simple datagrid. It allows user to select a particular row of data say row 5. It works completely fine but if user wants to delete row 7 when row 5 is selected, the datagrid will delete 5 (which is the selected row) instead of 7. How to go about this issue? Thanks! Regards, FrancisSGDOTNET.ORG Can't you just select row 7 and delete it?Thanks!Bernie At first, DataGrid deletes nothing. It sends out only commands that your code has to handle. You have to use DeleteCommand event of datagrid. In this event you have to take the row index from event...

Deleted row information cannot be accessed through the row.
I'm getting an exception with the message "Deleted row information cannot be accessed through the row". I have processing the records through the data table. In some situation i have deleted the rows in the datatable and inserting the new rows. These situation i have get the above specified error. Regards, Vijay Hi Vijay, this error occours when u try to access the row which u have already deleted. So, try to check if the row exists or not and then retrieve the information. I hope this will help u..Please mark as Answer if it helps u. Thanks!Parth PatelTechsture Technol...

Deleteing rows in Row level Locking
When deleting rows on tables that use row level locking (ASE 11.92) the number of rows effected is not returned. Is there a way to obtained the number of rows marked as delete. This was needed to help verify an automated process of cleaning up our daily mess in one application. thank you, gfessen glen.fessenden@globalcrossing.com wrote... > When deleting rows on tables that use row level locking (ASE 11.92) the > number of rows effected is not returned. Is there a way to obtained the > number of rows marked as delete. This was needed to help verify an automated > p...

How to add new rows in the form of rows
Hi, I can able to insert,delete and update record in gridview but cannot able to insert any new rows in the gird. In windows application we can insert new records(using DataGridView) into the database but not in web page. How to insert the records in gridview like control. Please tell me how to insert records in database in the form of rows. I mean i want to enter 20 records at one time.   Thanks.   Regards ArshadPlease Mark as Answer if the post is helpful to you. hi, Have you set the property AllowUserToAddRows=True; for the datagridview?????  If you are us...

How to add values to DataGrid row by row
How do I add values to a DataGrid row by row without using a DataSource? Is this possible? Or should I just use a table? my code works like this: BoundColumn Col1 Add Col1 to DataGrid1 for every str in stringarray { Add New Row DataGrid1 with Col1 = str } Thanks. may be following URLwill help you http://www.123aspx.com/ReadReviews.aspx?res=359 Arvind Well, DataGrid was found not to make you do it the old way as in ASP 3.0. You can still get a datasource like datatable and then loop in it and display all the data row by row, is this what you want ? ...

Web resources about - Delete/Add row - GetRow/currentrow returns invalid row - sybase.powerbuilder.general

Writing a SQLite wrapper component for universal Windows apps
... if (stepResult == SQLITE_ROW) { const int columnCount = sqlite3_column_count(statement); ExecuteResultRow ^currentRow = ref new ExecuteResultRow(); ...

Radio Prague - Send article by email - Loan Sarka? Business interests of the Prime Minister's wife take ...
Mobile version rozhlas . cz Český rozhlas Český rozhlas 7-Radio Praha Broadcast in English Broadcast Archive Current Affairs Loan Sarka? Business ...

Resources last updated: 1/15/2016 4:55:07 AM