Increase Page size

** Hi im new to anvil i tried to add nearly 12 columns in data grid it leads to misalignment. I’m trying to increase the page size help me in that**

Generally when this happens to me I need to either remove columns, make everything smaller, or make the data grid scroll horizontally.

The first two you can easily do, but if you want to make the data grid horizontally you can use this very helpful post from Shaun:

Thanks Robert.
But if there is a possibility to increase the form or page size then it will good.

So you want the data grid to flow off the screen? Or are you after something else?

I want increase the page/ form size, so that the datagrid can occupy the in the whole page itself right i never need of scroll button that is what i’m expecting

Assuming the data grid is the only thing on the page, and you want it to take the whole page, I would use a blank form and add a full-width column panel. Then add the data grid.

If you are loading the form by replacing just the main content then you also want to ensure you add the form by passing the full-width=True argument.

If that still doesn’t make it as big as you want then you will need to figure out what CSS is getting in your way.

2 Likes

I have done all your steps but where I could pass full-width = True

Generally where I miss adding the full width argument is when I add the form from the main form. Here is an example:

# import Form2 to make it available inside the top-level Form
from ..Form2 import Form2

new_panel = Form2()

# The top-level form has a component called
# column_panel. Clear it and put a new Form2() panel there:
self..content_panel.clear()
self.content_panel.add_component(new_panel, full_width=True)

If you still have an issue and are able to share the app you could share a clone link. Alternatively, you could create a minimal example where you face the issue and share the clone link for that.

1 Like