G
gerry
The PagerSettings.Visible property is not being handled properly by the
GridView control.
The value assigned to this property is not applied until after a postback.
Simplest test :
.aspx containing a single gridview - enable paging and give enough data
to page.
add checkbox with auto postback enable
add button with auto postback enable
in the GridView1_PreRender method add the following :
GridView1.HeaderRow.Enabled =
GridView1.PagerSettings.Visible =
CheckBox1.Checked;
note that the header should be enabled when the pager is visible and the
header should be disabled whetn the pager is hidden.
When you 1st view the page the header is disabled ( correct ) and the pager
is visible ( incorrect )
click the button and now the the header is disabled ( correct )and the pager
is hidden ( correct )
click the button as many times as you like , things remain as they shoud be.
Click the checkbox - now the header is enabled ( correct ) and the pager is
still hidden ( incorrect )
click the button and now the the header is enabled ( correct ) and the pager
is visible (correct )
click the button as many times as you like , things remain as they shoud be.
repeated clicking of the checkbox results in the header and pager being in
opposite 'phase'.
Having written my share of custom web controls, it is pretty obvious what
the problem is.
Has this been fixed with SP1 ? I am currently trying to install the update
but after about 6 hours I am not having much success.
Gerry
GridView control.
The value assigned to this property is not applied until after a postback.
Simplest test :
.aspx containing a single gridview - enable paging and give enough data
to page.
add checkbox with auto postback enable
add button with auto postback enable
in the GridView1_PreRender method add the following :
GridView1.HeaderRow.Enabled =
GridView1.PagerSettings.Visible =
CheckBox1.Checked;
note that the header should be enabled when the pager is visible and the
header should be disabled whetn the pager is hidden.
When you 1st view the page the header is disabled ( correct ) and the pager
is visible ( incorrect )
click the button and now the the header is disabled ( correct )and the pager
is hidden ( correct )
click the button as many times as you like , things remain as they shoud be.
Click the checkbox - now the header is enabled ( correct ) and the pager is
still hidden ( incorrect )
click the button and now the the header is enabled ( correct ) and the pager
is visible (correct )
click the button as many times as you like , things remain as they shoud be.
repeated clicking of the checkbox results in the header and pager being in
opposite 'phase'.
Having written my share of custom web controls, it is pretty obvious what
the problem is.
Has this been fixed with SP1 ? I am currently trying to install the update
but after about 6 hours I am not having much success.
Gerry