Is there anyway I can insert row to a particular row? Means, for example, I have:
Item A
Item B
Item C
Item D
Now I have a new Item E that I want to be in row 2,
Item A
Item E
Item B
Item C
Item D
Do InsertRow has a parameter to do that?
Is there anyway I can insert row to a particular row? Means, for example, I have:
Item A
Item B
Item C
Item D
Now I have a new Item E that I want to be in row 2,
Item A
Item E
Item B
Item C
Item D
Do InsertRow has a parameter to do that?
There is no way to do what you want in a simple insertRow call. You need to maintain your data set in a table, insert the new row in the appropriate place in the table and then drop the data in the tableView and then load your table into the tableView again. Since this happens pretty quickly it is usually ok visually. In other words you only see a brief flicker and the new row gets shown in the inserted position.
@primozcerar’s upcoming grid component does allow in place row inserts and is so much more user friendly. Once it is released I can imagine many of you using it for things like this. All the best.
I end up dig into tableView widget, and able to do it.
This is the brief logic:
There is no way to do what you want in a simple insertRow call. You need to maintain your data set in a table, insert the new row in the appropriate place in the table and then drop the data in the tableView and then load your table into the tableView again. Since this happens pretty quickly it is usually ok visually. In other words you only see a brief flicker and the new row gets shown in the inserted position.
@primozcerar’s upcoming grid component does allow in place row inserts and is so much more user friendly. Once it is released I can imagine many of you using it for things like this. All the best.
I end up dig into tableView widget, and able to do it.
This is the brief logic: