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
close icon

Horizontal scroll bar not seen in GridListControl

I'm using Sync fusion GridListControl and filling in data using object datasource. It automatically shows the vertical scroll bar if row number is more, but no horizontal scroll bar, even though the text is lengthier than the width of grid control.
Please let me know how to enable this. This is urgent.

11 Replies

HA haneefm Syncfusion Team November 7, 2007 03:26 PM UTC

Hi Arun,

Try turning off the FillLastColumn for the GridListControl. FillLastColumn will make the last column fit to the client area of the GridListControl. If it has enough empty space, it will expand to fill the client area. If it has less area, it will try to reduce the last column width and fit into this area.

this.gridListControl.FillLastColumn = false;

And also you might try calling gridListControl.Grid.ResetVolatileData after making these changes in the datasource (and/or after setting the gridListControl.DataSource property).

Can you reproduce the problem in one of our samples, or can you post a sample project showing the problem so we work with the problem here? Or, if you use a debug build of our libraries, you could post the callstack. Maybe that would give some information.

Best regards,
Haneef


AR Arun November 8, 2007 06:29 AM UTC

I tried doing this:
this.gridListControl.FillLastColumn = false; & gridListControl.Grid.ResetVolatileData() but still could not get the horizontal scroll bar. Please find the attached sample application.
One more thing, when i'm setting the datasource property after setting the DisplayMember & ValueMember, the horizontal bar is visible but is of no use because it doesnot scroll the content in grid.


GridListTest.zip


JS Jeba S Syncfusion Team November 10, 2007 09:59 AM UTC

Hi Arun,

Thank you for your update.

You have to set the Grid.HScrollPixel to true and Grid.HScrollBehavior to GridScrollbarMode.Enabled, to display the horizontal scrollbar. Also you have to set GridControlBase.UseOldHiddenScrollLogic to true. This is because we have changed the source code logic after version 4.2. This lets you switch back to old logic for hiding rows or columns in case of any compatiability problems.


private void Form1_Load(object sender, EventArgs e)
{
this.glcSample.Grid.HScrollPixel = true;
glcSample.FillLastColumn = false; GridControlBase.UseOldHiddenScrollLogic = true;
this.glcSample.Grid.HScrollBehavior = GridScrollbarMode.Enabled;
}


Pleas refer the modified sample and let us know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/F69666/main.htm

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.




AR Arun November 12, 2007 10:01 AM UTC

Hi Jeba

Thank you. Now it works fine. Horizontal scroll bar is visible now.

I have one more issue. I hope i need not put it as a new item in the forum.

I want each item in the grid list control to have minimum length of the grid control. For example, if my item is small & i select an item by clicking it, the selection is shown only till the end of the text of the item & not till the edge of the grid.

Please see the attached image(for the present & expected behavior). You can also check this behavior with the same sample project i have sent before.

Regards
Arun



GLC.zip


JS Jeba S Syncfusion Team November 12, 2007 01:37 PM UTC

Hi Arun,

Please refer the below forum thread for details. Here is the link:
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=69768

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.



AR Arun November 13, 2007 12:41 PM UTC

Hi Jeba,
The link you have given is of a different requirement i have put.
What i have asked here is- I want the rows of list to be expanded till the edge of the list. Presently if my row text is small & if i select that row, the selection is only till the end of the text & not till the end of the grid edge.
Please refer the attached screen shots from the above post for the present & desired outputs.

Regards
Arun



AR Arun November 15, 2007 04:57 AM UTC

Hi
Is there any way to do this?

Regards
Arun



HA haneefm Syncfusion Team November 15, 2007 07:22 PM UTC

Hi Arun,

One way you can do this by handling the QueryColWidth event of the grid and set the e.Size to required size. Below are the codes:

this.glcSample.Grid.QueryColWidth += new GridRowColSizeEventHandler(Grid_QueryColWidth);

void Grid_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if (e.Index == 1)
{
GridControl GControl = sender as GridControl;
e.Size = GControl.Width;
e.Handled = true;
}
}

Best regards,
Haneef



AR Arun November 16, 2007 08:53 AM UTC

Hi Haneef
Thank you. This technique fills the complete row. But there is a problem, when the row is longer than width of grid it truncates the row.
In such cases i want the grid to have scroll bar.

I tried setting FillLastColumn=true;
This would make the row complete size as grid width, but it wont allow horizontal scroll bar to come.

Is there any other way by which the rows take full length also & it automatically gives scroll when rows are longer?

This is an urgent requirement, So please help me out soon.

Thanks in advance

Arun



AR Arun November 19, 2007 01:47 PM UTC

Hi
I couldn't find any solution to this.
Any pointers to this will be of great help.

Thanks
Arun



HA haneefm Syncfusion Team November 29, 2007 11:55 PM UTC

Hi Arun,

Please try calling the SetLastColumnOption method to set required FillLastColumn property after setting the DataSource property. Below are the codes:

private void SetLastColumnOption(GridListControl ctrlListControl)
{
this.glcSample.Grid.HScrollPixel = true;
GridControlBase.UseOldHiddenScrollLogic = true;

GridControl _grid = ctrlListControl.Grid as GridControl;
_grid.ColWidths.ResizeToFit(GridRangeInfo.Col(_grid.ColCount));
int width = _grid.ColWidths[_grid.ColCount];
this.glcSample.FillLastColumn = width < _grid.Width;

}

Best regards,
Haneef


Loader.
Live Chat Icon For mobile
Up arrow icon