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.

Expand columsn while printing griddataboundgrid

Thread ID:

Created:

Updated:

Platform:

Replies:

76546 Sep 12,2008 02:59 AM Sep 19,2008 04:14 AM Windows Forms 8
loading
Tags: GridControl
Sherly Numawaty
Asked On September 12, 2008 02:59 AM

Dear all,

i'm trying to print a griddataboundgrid, and i have some points which i want to do:
1. i want to set the column width to a fix value.for example width column1 set become 50. ( how can i do this thing)
2. I want to make the font size(griddataboundgrid) become bigger.
3. according to the fisrt point, if there is no enough space for value in one column, i wanna make the row become bigger automatically.so the row width can grow according to data.


many thanks


sherly


Nisha Arockiya A [Syncfusion]
Replied On September 12, 2008 09:46 AM

Hi Sherly,

Thanks for your interest in Syncfusion products.

Query 1:
You can set the width of the specific column, say 2, using the following code snippet:

gridDataBoundGrid1.Model.ColWidths(2) = 50;


Query 2:
To increase the font size use PrepareViewStyleInfo property and set the style like the following code.
style.Font.Size="20";

Query 3:
You can use ResizeToFit() functionality to achieve your requirement.

gridDataBoundGrid1.AllowResizeToFit = False

gridDataBoundGrid1.RowHeights.ResizeToFit(GridRangeInfo.Table(),
GridResizeToFitOptions.None)


Please let me know if this helps.

Regards,
Nisha


>Dear all,

i'm trying to print a griddataboundgrid, and i have some points which i want to do:
1. i want to set the column width to a fix value.for example width column1 set become 50. ( how can i do this thing)
2. I want to make the font size(griddataboundgrid) become bigger.
3. according to the fisrt point, if there is no enough space for value in one column, i wanna make the row become bigger automatically.so the row width can grow according to data.


many thanks


sherly




Sherly Numawaty
Replied On September 15, 2008 12:27 AM

thanks Nisha

ok for query 1, but i still have a question. i wanna resize the grid according to the print preview page setup, so the grid doesnt appear on page center only

for query 2, i just wanna change the font on print preview, is there any way that i can try to do this thing. cause when i used PrepareViewStyleInfo, it will change the grid font size since we load the grid.

for query no 3
i cant found RowHeights, fyi i'm using griddataboundgrid

best regards

sherly



Nisha Arockiya A [Syncfusion]
Replied On September 16, 2008 07:53 AM

Hi Sherly,

Please refer to the shipped sample that shows you how to print a grid on a single page. It derives a "GridPrintDocument" class in order to handle the printing of the entire grid on a single page. It does this by drawing the full size grid to a large bitmap and then drawing this bitmap, scaled to fit the output page.

\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Windows\Samples\2.0\Printing\PrintToFit\


You can change the font on print preview using the following code snippet.Please refer to it.

this.gridDataBoundGrid1..TableStyle.Font.Unit = GraphicsUnit.World;


for the RowHeights Question, please refer to the following code snippet.


gridDataBoundGrid1.Model.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);


Please let me know if this helps.

Regards,
Nisha

>thanks Nisha

ok for query 1, but i still have a question. i wanna resize the grid according to the print preview page setup, so the grid doesnt appear on page center only

for query 2, i just wanna change the font on print preview, is there any way that i can try to do this thing. cause when i used PrepareViewStyleInfo, it will change the grid font size since we load the grid.

for query no 3
i cant found RowHeights, fyi i'm using griddataboundgrid

best regards

sherly





Sherly Numawaty
Replied On September 17, 2008 05:51 AM

Hi Nisha
thanks for ur support
i have some question, related to ur answer
i used code below : gridCollectionDetail.Model.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders);

for ex the width for 1 column is 50, but the contain is more than the column width, i wanna expand the column automaticcally, but i cant get what i want. please advice

the second
this code below can changes the font of my grid contain, but i cant setting it become bigger, everything become smaller. is anyway to set by number of the font size??
this.gridDataBoundGrid1..TableStyle.Font.Unit = GraphicsUnit.World;
thanks for ur support

sherly



Nisha Arockiya A [Syncfusion]
Replied On September 18, 2008 07:51 AM

Hi Sherly,

Question 1:

If you wants to auto-resize the ColumnWidths, Please use the following code.

gridDataBoundGrid1.AllowResizeToFit =Trur;
gridDataBoundGrid1.RowHeights.ResizeToFit(GridRangeInfo.Table(),
GridResizeToFitOptions.None);


If you wants to auto-resize the RowHeights,use the following code snippet as I already mentioned.

gridDataBoundGrid1.AllowResizeToFit = True;
gridDataBoundGrid1.RowHeights.ResizeToFit(GridRangeInfo.Table(),
GridResizeToFitOptions.None);


Question 2:

You can set the size of the Font using the code below.

this.gridDataBoundGrid1.TableStyle.Font.Size = 20;


Please let me know if this helps.

Regards,
Nisha

>Hi Nisha
thanks for ur support
i have some question, related to ur answer
i used code below : gridCollectionDetail.Model.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeHeaders);

for ex the width for 1 column is 50, but the contain is more than the column width, i wanna expand the column automaticcally, but i cant get what i want. please advice

the second
this code below can changes the font of my grid contain, but i cant setting it become bigger, everything become smaller. is anyway to set by number of the font size??
this.gridDataBoundGrid1..TableStyle.Font.Unit = GraphicsUnit.World;
thanks for ur support

sherly





Sherly Numawaty
Replied On September 19, 2008 02:57 AM

Dear Nisha

Many thanks for ur support.

i've try the code u given
but i cant found it work.

please see my attachment pic.
column Internal_ref set become 80 on Model_QueryColWidth

then when i'm going to print i write the code u given :
gridCollectionDetail.AllowResizeToFit = true;
gridCollectionDetail.Model.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);

please take a look at the pic, on the first row on internal_ref column, the contain that we can see is ITTest3, but the real value is ITTest34. what i want to do is, while the contain is larger than the width, the row height should be grow, so we can see the real value.

and the second question is, when i change the font size, i want to change the font size of the header text.

kindly reply

thanks
sherly




sample_a823c252.zip

Nisha Arockiya A [Syncfusion]
Replied On September 19, 2008 04:13 AM

Hi Sherly,

You can have a look at our shipped browser sample on how ResizeToFit works.Please refer to the following location.
\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Windows\Samples\2.0\FeatureSamples\PivotGridSample\

You can set styles to header text using the code snippet:

this.gridDataBoundGrid1.BaseStylesMap("Col0").StyleInfo.Font.Size="20";


Please let me know any other further assistance.
Regards,
Nisha

>Dear Nisha

Many thanks for ur support.

i've try the code u given
but i cant found it work.

please see my attachment pic.
column Internal_ref set become 80 on Model_QueryColWidth

then when i'm going to print i write the code u given :
gridCollectionDetail.AllowResizeToFit = true;
gridCollectionDetail.Model.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);

please take a look at the pic, on the first row on internal_ref column, the contain that we can see is ITTest3, but the real value is ITTest34. what i want to do is, while the contain is larger than the width, the row height should be grow, so we can see the real value.

and the second question is, when i change the font size, i want to change the font size of the header text.

kindly reply

thanks
sherly




sample_a823c252.zip


Nisha Arockiya A [Syncfusion]
Replied On September 19, 2008 04:14 AM

Hi Sherly,

You can have a look at our shipped browser sample on how ResizeToFit works.Please refer to the following location.
\Syncfusion\EssentialStudio\6.3..\Windows\Grid.Windows\Samples\2.0\FeatureSamples\PivotGridSample\

You can set styles to header text using the code snippet:

this.gridDataBoundGrid1.BaseStylesMap("Col0").StyleInfo.Font.Size="20";


Please let me know any other further assistance.
Regards,
Nisha

>Dear Nisha

Many thanks for ur support.

i've try the code u given
but i cant found it work.

please see my attachment pic.
column Internal_ref set become 80 on Model_QueryColWidth

then when i'm going to print i write the code u given :
gridCollectionDetail.AllowResizeToFit = true;
gridCollectionDetail.Model.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);

please take a look at the pic, on the first row on internal_ref column, the contain that we can see is ITTest3, but the real value is ITTest34. what i want to do is, while the contain is larger than the width, the row height should be grow, so we can see the real value.

and the second question is, when i change the font size, i want to change the font size of the header text.

kindly reply

thanks
sherly




sample_a823c252.zip


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.

;