J
JohnE
I have a gridview with paging and a pagesize of 10. Users are able to able
to set a higher pagesize value from the ddl outside the gridview. The items
in the ddl were placed there thru the Items collection property. I used 10,
20, 30 ... to
100. The Items has text and value as the same (ie 10/10, 20/20, and so on
to 100). Below is the code that is used and it all works. Now the users are
looking to have 'All' as part of the items in addition to the numbers. That
way they can select 'All' and show a one page gridview which is one big long
list of rows. In the code below, if the first line is removed then the user
gets their wish. My question is if what is in the ddl are numbers converting
to ints, how is the 'All' looked at when the text and value are All/All in
the Items collection? What is the best approach to have the numbers and
'All' as an available selection?
Thanks.
protected void ddlNumberPerPage_SelectedIndexChanged(object sender,
EventArgs e)
{
GridView1.PageSize = Convert.ToInt32(ddlNumberPerPage.SelectedValue);
GridView1.DataSource = bindgrid();
GridView1.DataBind();
}
to set a higher pagesize value from the ddl outside the gridview. The items
in the ddl were placed there thru the Items collection property. I used 10,
20, 30 ... to
100. The Items has text and value as the same (ie 10/10, 20/20, and so on
to 100). Below is the code that is used and it all works. Now the users are
looking to have 'All' as part of the items in addition to the numbers. That
way they can select 'All' and show a one page gridview which is one big long
list of rows. In the code below, if the first line is removed then the user
gets their wish. My question is if what is in the ddl are numbers converting
to ints, how is the 'All' looked at when the text and value are All/All in
the Items collection? What is the best approach to have the numbers and
'All' as an available selection?
Thanks.
protected void ddlNumberPerPage_SelectedIndexChanged(object sender,
EventArgs e)
{
GridView1.PageSize = Convert.ToInt32(ddlNumberPerPage.SelectedValue);
GridView1.DataSource = bindgrid();
GridView1.DataBind();
}