Hi,
I have a GridListControl which is customized as a listbox. I have other normal windows list boxex also. But items height is more in GridListControl when compared to other list boxes. I tried changing the rowheight and font size etc. But no use..
Any input plz..
Rgds
Rajani Kanth
AD
Administrator
Syncfusion Team
January 27, 2006 03:59 AM UTC
Badri,
you need to set gridListControl.ItemHeight to change the height of rows in the GridListControl.
Stefan
>Hi,
>
>I have a GridListControl which is customized as a listbox. I have other normal windows list boxex also. But items height is more in GridListControl when compared to other list boxes. I tried changing the rowheight and font size etc. But no use..
>
>Any input plz..
>
>Rgds
>Rajani Kanth
>
>
BR
Badri Rajani Kanth
January 30, 2006 10:20 AM UTC
Hi,
If we do that and select an item, you will see the item lower portion as missing..It will not give the user exact look of listbox. Because in list box, items have narrow gap. Whereas in GridListControl, this gap is more and item seems to have a border (as it is a row). Because of which ItemsHeight does not work alone.
Rgds
Rajani Kanth
>Badri,
>
>you need to set gridListControl.ItemHeight to change the height of rows in the GridListControl.
>
>Stefan
>
>>Hi,
>>
>>I have a GridListControl which is customized as a listbox. I have other normal windows list boxex also. But items height is more in GridListControl when compared to other list boxes. I tried changing the rowheight and font size etc. But no use..
>>
>>Any input plz..
>>
>>Rgds
>>Rajani Kanth
>>
>>
ST
stanleyj
Syncfusion Team
January 30, 2006 12:09 PM UTC
Hi Badri,
I am not sure about the border you mean. Please try this code to see if that helps.
this.gridListControl1.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo);
GridCurrentCell cc;
private void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
cc = this.gridListControl1.Grid.CurrentCell;
if(cc.HasCurrentCellAt(e.RowIndex))
{
e.Style.Borders.Top = new GridBorder(GridBorderStyle.Standard);
e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.Standard);
e.Style.Borders.Left = new GridBorder(GridBorderStyle.Standard);
e.Style.Borders.Right = new GridBorder(GridBorderStyle.Standard);
}
}
To resize rows individually try this code below
this.gridListControl1.Grid.Model.RowHeights[3] = 20;
Best regards,
Stanley