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.
Unfortunately, activation email could not send to your email. Please try again.

Horizontal scroll bar not seen in GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

69666 Nov 7,2007 06:59 AM Nov 29,2007 06:55 PM Windows Forms 11
loading
Tags: GridControl
Arun
Asked On November 7, 2007 06:59 AM

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.

haneefm [Syncfusion]
Replied On November 7, 2007 10:26 AM

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

Arun
Replied On November 8, 2007 01:29 AM

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

Jeba S [Syncfusion]
Replied On November 10, 2007 04:59 AM

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.



Arun
Replied On November 12, 2007 05:01 AM

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

Jeba S [Syncfusion]
Replied On November 12, 2007 08:37 AM

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.


Arun
Replied On November 13, 2007 07:41 AM

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


Arun
Replied On November 14, 2007 11:57 PM

Hi
Is there any way to do this?

Regards
Arun


haneefm [Syncfusion]
Replied On November 15, 2007 02:22 PM

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


Arun
Replied On November 16, 2007 03:53 AM

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


Arun
Replied On November 19, 2007 08:47 AM

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

Thanks
Arun


haneefm [Syncfusion]
Replied On November 29, 2007 06:55 PM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;