R
ryan.mclean
Hello everyone, I'm in a bind, and I hope somebody can point me in the
right direction.
I have a gridview that is bound when it is not a postback. When the
grid is bound, I remove the contents of a cell based on criteria
e.g.
Protected Sub gvOffSiteHoursRequests_RowDataBound(ByVal sender As
Object, _
ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles gvOffSiteHoursRequests.RowDataBound
if (str = "example) then
e.Row.Cells(0).Controls.Clear()
end if
This works great EXCEPT when another control on the same page has a
postback, the controls are un-cleared, the grid is possibly reloaded
from viewstate and does not fire my RowDataBound event because the
event was not called. This could be remedied by binding the grid every
time there is a postback, but this would mess up the editing etc.
I hope that makes sense. Please let me know if you have any ideas.
Thank you and have a great day,
Ryan
right direction.
I have a gridview that is bound when it is not a postback. When the
grid is bound, I remove the contents of a cell based on criteria
e.g.
Protected Sub gvOffSiteHoursRequests_RowDataBound(ByVal sender As
Object, _
ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles gvOffSiteHoursRequests.RowDataBound
if (str = "example) then
e.Row.Cells(0).Controls.Clear()
end if
This works great EXCEPT when another control on the same page has a
postback, the controls are un-cleared, the grid is possibly reloaded
from viewstate and does not fire my RowDataBound event because the
event was not called. This could be remedied by binding the grid every
time there is a postback, but this would mess up the editing etc.
I hope that makes sense. Please let me know if you have any ideas.
Thank you and have a great day,
Ryan