Currently I am developing small app to practise new librarie but I am facing interesting issue. In the moment I search in my Pandasframe and I movetoSelection everything is perfect except my row header indexes disappear. I already tried many way but non of them solved it.
Search method:
def open_input_dialog_event(self):
if self.loaded_df is None:
tkinter.messagebox.showinfo("Search", "No data loaded. Please load data first.")
return
dialog = customtkinter.CTkInputDialog(text="Enter a search query:", title="Search")
search_query = dialog.get_input().strip()
if not search_query:
tkinter.messagebox.showinfo("Search", "Please enter a search query.")
return
# Check if the search query is in the currently displayed data
matched_rows = [
row_index
for row_index, row in enumerate(self.pt.model.df.itertuples(index=False), start=1)
if any(search_query.lower() in str(val).lower() for val in row)
]
if not matched_rows:
tkinter.messagebox.showinfo("Search", "No matching records found.")
return
# Move to the first matched row (you can customize this behavior)
self.pt.movetoSelection(row=matched_rows[0]-1)
# Ensure the widget is updated and displayed
self.pt.show()
# Force a redraw/update of the widget
self.pt.show()
self.pt.redraw()
````your text`
[Before search](https://i.stack.imgur.com/BKRd5.png)
[After search](https://i.stack.imgur.com/PrG6P.png)
[All code](https://pastebin.com/Ar8adUVU)
I tried hiding, showing indexes according to documentation, reloading all widget and reseting indexes. MY expectation was that after I search and find some term row indexes will be visible after moving to row fith found term.