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

Change Height in GridListControl

i need to change the Row Hieght in GridListControl and when i use ItemHieght or MinResizeRowSize the Hieht Change again automaticaly. so ......... please how can i change Row height.

3 Replies

AD Administrator Syncfusion Team March 29, 2005 08:14 AM

When the GridListControl is initially setup for the first time it is drawn, the row heights are automaticallt set (and this steps on what you tried to do to initially set the size.) One way around this is to subscribe to the GridListControl''s Paint event. Then in the handler code, unsubscribe to teh event so it is only hit once, and there set the default size.
private void ListBox1_Paint(object sender, PaintEventArgs e)
{
	//unsubcribe to the event so it is only done once
	this.ListBox1.Paint -= new PaintEventHandler(ListBox1_Paint);
	this.ListBox1.Grid.Rows.DefaultSize = 50;
}


AY Ayman April 5, 2005 08:31 AM

I''m tring to do that many times but nothing change. and this my code to change this height AddHandler GridList1.Paint, AddressOf Paint_GridList Private Sub Paint_GridList(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) RemoveHandler glstRemarks.Paint, AddressOf Paint_GridList glstRemarks.Grid.Rows.DefaultSize = 1000 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click --i''m trying to do any one of this but nothing happenend glstRemarks.MinResizeRowSize = 1000 glstRemarks.Grid.Rows.DefaultSize = 1000 glstRemarks.ItemHeight = 1000 end Sub In the finally I need it to be row Auto size. thanks with my best regards


AD Administrator Syncfusion Team April 5, 2005 10:21 AM

Here is a little sample showing the Paint event trick working to initially set the row height in a GridListControl. It also has a button that will change the row height on each click. It was done using version 3.0.1.0. What are you doing differently? http://www.syncfusion.com/Support/user/uploads/GLC_RowHeight_81a4d3fa.zip

Loader.
Live Chat Icon For mobile
Up arrow icon