We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reg:gridControl Prop

Hi, I want hide one column which present in the gridcontrol. if i set colwidth = 0, i think i can able to get that.But if user resize the colwidth hide thing gone. How do i do that..? same case I want resize property also..... Anna

1 Reply

AD Administrator Syncfusion Team July 22, 2005 08:29 AM

Is your question how can your user be able to resize a column so it is visible if you have set its colwidth = 0? If so, you can set things up so if the user double clicks the border where the hidden column is, the column would reappear. You can use the colssizing event to handle this.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
	if(e.Reason == GridResizeCellsReason.DoubleClick
		&& e.Columns.Right < this.gridControl1.ColCount
		&& this.gridControl1.ColWidths[e.Columns.Right+1] == 0
		)
	{
		this.gridControl1.ColWidths[e.Columns.Right+1] = this.gridControl1.DefaultColWidth;
		e.Cancel = true;
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon