Welcome Guest Search | Active Topics | Sign In | Register

Show empty rows in grid and format columns Options
FPATER
Posted: Wednesday, April 1, 2009 12:46:26 PM
Rank: Member
Groups: Member

Joined: 3/11/2009
Posts: 24
I want to show all empty rows on grid. Ex. If I have 3 records on the table and my grid is defined to show 10 rows, I want to show the other 7 rows empty. Also I want that the columns width change based on a percentage value. Total page width=100% -> 1st Column 10%, 2nd column 40%, 3rd Column 20%, 4th Column 30%.
eo_support
Posted: Wednesday, April 1, 2009 1:06:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

To show empty rows, you would simply add empty rows into your data source object before you hand it over to the Grid. For example, the following code will create 2 data rows and 1 empty row:

Code: C#
grid1.DataSource = new object[]{row1, row2, null};
Grid1.DataBind();


Note the thrid array element is null. That will create an empty row in the Grid.

The Grid column will not take percentage width. You will need to calculate that by yourself and then give each column a pixel width.

Thanks!
FPATER
Posted: Wednesday, April 1, 2009 2:27:30 PM
Rank: Member
Groups: Member

Joined: 3/11/2009
Posts: 24
Then what is the grid.pagesize property for?
eo_support
Posted: Wednesday, April 1, 2009 3:39:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

It's the number of items (rows) displayed per page:

http://doc.essentialobjects.com/library/1/eo.web.grid.pagesize.aspx

The value only has effect when there are more items than the set value. For example, if PageSize is set to 10 and you have 15 items, it will be displayed as two pages. It does not automatically fill the last page with empty rows.

Thanks



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.