Raul Juarez

Raul Juarez

  • NA
  • 43
  • 0

Edit GridView Header or hide column

Nov 17 2009 8:21 PM
Hi need some help to Change column header and hide a column in Gridview. This: (grdVendors.Columns[1].HeaderText= "test"; ) doesn't work. Please see the image ( http://www.vengalia.com/HIDEANDRENAMEHEADER.jpg ) to see what DataSource contains.
CODE:
protected void drpSearchBy_SelectedIndexChanged(object sender, EventArgs e)
{
int placesID = Convert.ToInt32(drpSearchBy.SelectedValue.Trim());
VendorCollection places = VendorCollection.GetbyPlaceID(placesID);grdVendors.DataSource = places;
//grdVendors.Columns[1].HeaderText= "test";
grdVendors.DataBind();

}
 
Thanks for any help.
Raul

Answers (9)