c# - Hide a gridView row in asp.net -
i creating gridview
allows adding new rows adding controls necessary insert footertemplate
, when objectdatasource
has no records, add dummy row footertemplate
displayed when there data.
how can hide dummy row? have tried setting e.row.visible = false
on rowdatabound
row still visible.
you handle gridview's databound event , hide dummy row. (don't forget assign event property in aspx code):
protected void gridview1_databound(object sender, eventargs e) { if (gridview1.rows.count == 1) gridview1.rows[0].visible = false; }
Comments
Post a Comment