UITableView not scrolling to last row after inserting a new row - ios6

I am trying to insert rows in the TableViewController's tableView Object from other class using
UINavigationController *navigationController = (UINavigationController *)[UIApplication sharedApplication].keyWindow.rootViewController;
ReceiptHomeTableViewController *homeTableViewController= (ReceiptHomeTableViewController*)navigationController.viewControllers[0];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:([[PersistenceService getInstance] count]-1) inSection:0];
[homeTableViewController.tableView insertRowsAtIndexPaths:#[indexPath]
withRowAnimation:UITableViewRowAnimationNone];
I have also tried using
//[homeTableViewController.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
//[homeTableViewController.tableView reloadData];
but the HometableViewContoller only shows the rows that fit in the screen width. I try to scroll to bottom, but it don't go to last row.
Scrolling works perfect if I restart the application and cells are created using ellForRowAtIndexPath: method, but fails to work if I add new rows.
It seems like UI is not updated about the new length of the View when a row is added. Any help?

Due to below 50 reputation, i won't able to give comments. So i like to give suggestion about this question in answer section.
From your question, you must post cellForRowAtIndexPath method. Then only clue will click. And please NSLog your new row objects in the view where the tableCell sub viewed.
After you edit your post, I'll give answer in this post by edit if i got answer or any clue.

I found the problem. I had autolayout turned on by default on tableviewcontroller. turning it off worked for me.
Thanks for the sihhestions

Related

How to programmatically select a row in Ui.grid angularJs?

I have an issue let me put it simple in my plunker example I want to know why is my $scope.revertSelection() function not working.
http://plnkr.co/edit/3KXrUuCsSACuhefmyzxN?p=info
Steps:
Sort right hand grid by Name(descending order)
Select 3-4 rows randomly
Click 'Copy' button all selected rows are copied into $scope.retainSelection
Sort right hand grid by Name(Ascending order)
Click 'Revert' button (this is not working)
I am expecting all the rows previously selected in step 2) to be selected back which is not happening :-( please help me with the issue.
I googled but could not find any docs of gridApi.selection to look for other methods to fulfill my requirement.
Note: I am using Ui.grid not ng-grid
I should use...
$scope.gridApi.grid.modifyRows($scope.gridOptions.data);
$scope.gridApi.selection.selectRow($scope.gridOptions.data[i]);
...instead of...
$scope.gridApi.selection.selectRow(i);
My friend gave link to docs.

Angular ui-grid. Error in example?

I want to use ui-grid with treeView, but in example:
http://ui-grid.info/docs/#/tutorial/215_treeView
it working wrong.
if i click on "+" icon and then click "-" icon - last row going out from grid.
How repear this, or replace to other grid with tree (hierarhical grid with several column and row selections)? Thanks!
I think this may be the alignment issue that was fixed this morning, which occurs when you have filters. The treeView appears to be working correctly today.
If you have an issue that is different than that, could you provide a bit more detail - your description is somewhat unclear on exactly what it is that is wrong.

How to hide the entire Ext.selection.CheckboxModel in ExtJS grid

I need to hide the entire column of the check box (Ext.selection.CheckboxModel). I found out to get the columns of the grid to hide, but the columns does not give the checkbox column.
grid.headerCt.items.getAt(0).hide()
This worked for me in 4.2.2. I used a combination of the other answer by Saki and a little traversing through the DOM because the "getAt0).hide()" solution did not work for me either:
grid.headerCt.items.items[0].hidden = true;

How to retrive the selected grid rows inside a panel in controller in extjs

how can i retrive the selected rows from grid inside the panel in controller i tried using itemId but i am getting the null array. I attaching the screenshot of grid. Also i pasting the constoller selection method
Ext.widget('adminRoleView').down('#adminRoleView').getSelectionModel().getSelection();
"adminRoleView" is the alias of the panel and "adminRoleView" is the itemId of the grid which is inside the panel. Also i am new to technology so i dont know whether this wrong or right.
you can use this :
var rows = Ext.getCmp('YOUR_GRID_ID').getSelectionModel().getSelections();
its return all the selected rows.
i got the solution by giving
this.up("panel").down("itemID").getSelectionModel().getSelection();
i think Ext.ComponentMgr is good than above method... :)
Ext.getCmp('adminRoleView').getStore().getSelectionModel().getSelection();

How do I refresh Winforms DataGridView?

I have two DataGridViews in a tab and the DataSource of the second grid is based on the row selection in first grid. The problem is I cannot get the grid to refresh after some values have been inserted or updated in the prior tabs. It works fine if I click on the row but it is not working if I select the row programmatically (i.e. first row). I have tried the following but it failed to refresh.
daProgram.ClearBeforeFill = true
daProgram.fill(dsProgram)
bsProgram.ResetBindings(true) -- binding source also tried false
dgvProgram.DataSource=bsProgram -- rebinding the control
I also tried:
dgvProgram.DataSource=nothing
and
dgvProgram.DataBindings.clear()
Nothing works :-(
I would really appreciate if anyone could help me out in this.
Are you binding your data properly?
http://www.theserverside.net/discussions/thread.tss?thread_id=31014
http://bytes.com/groups/net-c/256204-refresh-databindings-winform
I have read a few things about this, and too found ResetBindings not to work.
If you're using Table Adapters, just call the fill method (the method that auto gets added in to your Form Load event).
I've read things that say you shouldn't call Fill. I see no reason why not. It simply re-queries the data, which is exactly what a refresh should do.
Me.YourTableAdapter.Fill(Me.YourDataSet.YourDataTable)
Try This
dgvProgram.DataSource=null;

Resources