1. How can we set the height of the grid Item... I want to increase the
size of the grid item vertically..

I can able set the size of the grid Item in terms of Width...(i.e;
horizontally)..
I am displaying image in a cell, as the image is bigger, the image is
not completely visible in a Grid.

Please help in this regard.

2. Another requirement is based on the size of the grid(I perform
resizing of grid) and size of the image, it will automatically calculate
the number of grid columns...
Problem is suppose there are 2 columns in the grid.. and after
performing the resizing operation, the calculated number of cells is
5...these 5 columns were appended to the already existing 2 columns...

I want to set the number of columns to zero and then adding the newly
cal no of cols...

Please help me ...]]>2006-12-04T11:54:26-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/571360/#msg_571360
the first row in the grid. If you put an image of the size you want the
row to be in the first row/first cell then you should get the size you
want. Otherwise, you could write a custom cell renderer and that can
determine the size (but thats not easy).

Re 2.) To remove a column use GridColumn#dispose. Surely though you
could do a delta between the number of current columns and the number
you need added.

Swetha wrote:
> Hi All,
>
> I am facing two problems in Nebula Grid,
>
> 1. How can we set the height of the grid Item... I want to increase the
> size of the grid item vertically..
>
> I can able set the size of the grid Item in terms of Width...(i.e;
> horizontally)..
> I am displaying image in a cell, as the image is bigger, the image
> is not completely visible in a Grid.
>
> Please help in this regard.
>
>
> 2. Another requirement is based on the size of the grid(I perform
> resizing of grid) and size of the image, it will automatically calculate
> the number of grid columns...
> Problem is suppose there are 2 columns in the grid.. and after
> performing the resizing operation, the calculated number of cells is
> 5...these 5 columns were appended to the already existing 2 columns...
>
> I want to set the number of columns to zero and then adding the newly
> cal no of cols...
>
> Please help me ...
>
>]]>Chris Gross2006-12-04T15:12:26-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/19444/#msg_19444
the first row in the grid. If you put an image of the size you want the
row to be in the first row/first cell then you should get the size you
want. Otherwise, you could write a custom cell renderer and that can
determine the size (but thats not easy).

Re 2.) To remove a column use GridColumn#dispose. Surely though you
could do a delta between the number of current columns and the number
you need added.

Swetha wrote:
> Hi All,
>
> I am facing two problems in Nebula Grid,
>
> 1. How can we set the height of the grid Item... I want to increase the
> size of the grid item vertically..
>
> I can able set the size of the grid Item in terms of Width...(i.e;
> horizontally)..
> I am displaying image in a cell, as the image is bigger, the image
> is not completely visible in a Grid.
>
> Please help in this regard.
>
>
> 2. Another requirement is based on the size of the grid(I perform
> resizing of grid) and size of the image, it will automatically calculate
> the number of grid columns...
> Problem is suppose there are 2 columns in the grid.. and after
> performing the resizing operation, the calculated number of cells is
> 5...these 5 columns were appended to the already existing 2 columns...
>
> I want to set the number of columns to zero and then adding the newly
> cal no of cols...
>
> Please help me ...
>
>]]>Chris Gross2006-12-04T15:12:26-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/571485/#msg_571485
Thanks for the reply,

For the Reply 2):

I already tried with gridColumn#dispose.... but its not disposing.
Instead whenever I perform resizing operation, number of cols increased as
well as the data is displayed in some random order...not in continuous
cols starting with the first one....

I am placing only the image in the first item first col... still its not
showing complete image...

Do I need to set any option for the grid...?]]>Swetha2006-12-05T04:42:51-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/19625/#msg_19625
Originally posted by: sujji_minnu.yahoo.co.in

Hi Chris,

Thanks for the reply,

For the Reply 2):

I already tried with gridColumn#dispose.... but its not disposing.
Instead whenever I perform resizing operation, number of cols increased as
well as the data is displayed in some random order...not in continuous
cols starting with the first one....

I am placing only the image in the first item first col... still its not
showing complete image...

Do I need to set any option for the grid...?]]>2006-12-05T04:42:51-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/19715/#msg_19715
based on the first column and item but thats before you have a chance to
set the image. I am investigating a simple setItemHeight method. I'll
respond back when I'm finished.

2.) Your loop construct to remove the columns is incorrect.

Swetha wrote:
> Hi Chris,
>
> Thanks for the reply,
>
> For the Reply 2):
>
>
> I already tried with gridColumn#dispose.... but its not disposing.
> Instead whenever I perform resizing operation, number of cols increased
> as well as the data is displayed in some random order...not in
> continuous cols starting with the first one....
>
> The following is the code I am using,
>
> public void reConstructGrid(){
> grid.removeAll();
> for(int i1=0;i1<grid.getColumnCount();i1++){
> grid.getColumn(i1).dispose();
> }
> for(int i=0;i<GlobalVariablesClass.cols;i++){
> GridColumn column=new GridColumn(grid,SWT.NONE);
> column.setResizeable(true);
> column.setWidth(100);
> }
> }
>
>
> And for the reply 1):
>
> I am placing only only one icon...in the grid in the first row and
> first col only....Still its not totally visible..
>
> grid = new Grid(sash_form,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
>
> gridItem = new GridItem(grid, SWT.NONE);
> gridItem.setImage(0, Util.getImageRegistry().get("file"));
>
> I am placing only the image in the first item first col... still its not
> showing complete image...
>
> Do I need to set any option for the grid...?
>
>
>
>
>
>
>
>
>
>
>]]>Chris Gross2006-12-05T22:21:49-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/571556/#msg_571556
based on the first column and item but thats before you have a chance to
set the image. I am investigating a simple setItemHeight method. I'll
respond back when I'm finished.

2.) Your loop construct to remove the columns is incorrect.

Swetha wrote:
> Hi Chris,
>
> Thanks for the reply,
>
> For the Reply 2):
>
>
> I already tried with gridColumn#dispose.... but its not disposing.
> Instead whenever I perform resizing operation, number of cols increased
> as well as the data is displayed in some random order...not in
> continuous cols starting with the first one....
>
> The following is the code I am using,
>
> public void reConstructGrid(){
> grid.removeAll();
> for(int i1=0;i1<grid.getColumnCount();i1++){
> grid.getColumn(i1).dispose();
> }
> for(int i=0;i<GlobalVariablesClass.cols;i++){
> GridColumn column=new GridColumn(grid,SWT.NONE);
> column.setResizeable(true);
> column.setWidth(100);
> }
> }
>
>
> And for the reply 1):
>
> I am placing only only one icon...in the grid in the first row and
> first col only....Still its not totally visible..
>
> grid = new Grid(sash_form,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
>
> gridItem = new GridItem(grid, SWT.NONE);
> gridItem.setImage(0, Util.getImageRegistry().get("file"));
>
> I am placing only the image in the first item first col... still its not
> showing complete image...
>
> Do I need to set any option for the grid...?
>
>
>
>
>
>
>
>
>
>
>]]>Chris Gross2006-12-05T22:21:49-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/19752/#msg_19752
Originally posted by: sujji_minnu.yahoo.co.in

Hi,

Thanks for the response....

2) What is the wrong with the loop for disposing the number of existing
cols...

I am just removing the existing number of cols in the first loop and
then adding the required number of cols in the second loop...

Please throw a light on this... I didn't get what is the wrong with it..

1) When can I expect setItemHeight to be available....Mean while..is
there any other way other than writing our own custom cell renderer...

Once again Thanks lot..]]>2006-12-06T05:05:56-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/571592/#msg_571592
Thanks for the response....

2) What is the wrong with the loop for disposing the number of existing
cols...

I am just removing the existing number of cols in the first loop and
then adding the required number of cols in the second loop...

Please throw a light on this... I didn't get what is the wrong with it..

1) When can I expect setItemHeight to be available....Mean while..is
there any other way other than writing our own custom cell renderer...

Once again Thanks lot..]]>Swetha2006-12-06T05:05:56-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/19790/#msg_19790
> Hi,
>
> Thanks for the response....
>
> 2) What is the wrong with the loop for disposing the number of existing
> cols...
>
> I am just removing the existing number of cols in the first loop and
> then adding the required number of cols in the second loop...
>
> Please throw a light on this... I didn't get what is the wrong with it..
>

You always have to remove the column with the index 0 and not with the
incremented index think short about it and it should be clear why this
needs to be done ;-)

while( grid.getColumnCount() > 0 ) {
grid.getColumn(0).dispose();
}

Doesn't your current code produce NPEs?

Tom]]>Thomas Schindl2006-12-06T09:57:28-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/571625/#msg_571625
> Hi,
>
> Thanks for the response....
>
> 2) What is the wrong with the loop for disposing the number of existing
> cols...
>
> I am just removing the existing number of cols in the first loop and
> then adding the required number of cols in the second loop...
>
> Please throw a light on this... I didn't get what is the wrong with it..
>

You always have to remove the column with the index 0 and not with the
incremented index think short about it and it should be clear why this
needs to be done ;-)

while( grid.getColumnCount() > 0 ) {
grid.getColumn(0).dispose();
}

Doesn't your current code produce NPEs?

Tom]]>Thomas Schindl2006-12-06T09:57:28-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/571652/#msg_571652
> Swetha schrieb:
>> Hi,
>>
>> Thanks for the response....
>>
>> 2) What is the wrong with the loop for disposing the number of existing
>> cols...
>>
>> I am just removing the existing number of cols in the first loop and
>> then adding the required number of cols in the second loop...
>>
>> Please throw a light on this... I didn't get what is the wrong with it..
>>
>
> You always have to remove the column with the index 0 and not with the
> incremented index think short about it and it should be clear why this
> needs to be done ;-)
>
> while( grid.getColumnCount() > 0 ) {
> grid.getColumn(0).dispose();
> }
>
> Doesn't your current code produce NPEs?
>

Wrong your old code was not able to produce Exceptions but it simply
stopped to early as you might have discovered.

Tom]]>Thomas Schindl2006-12-06T11:15:44-00:00Re: Grid item resizehttps://www.eclipse.org/forums/index.php/mv/msg/6422/19834/#msg_19834
> Swetha schrieb:
>> Hi,
>>
>> Thanks for the response....
>>
>> 2) What is the wrong with the loop for disposing the number of existing
>> cols...
>>
>> I am just removing the existing number of cols in the first loop and
>> then adding the required number of cols in the second loop...
>>
>> Please throw a light on this... I didn't get what is the wrong with it..
>>
>
> You always have to remove the column with the index 0 and not with the
> incremented index think short about it and it should be clear why this
> needs to be done ;-)
>
> while( grid.getColumnCount() > 0 ) {
> grid.getColumn(0).dispose();
> }
>
> Doesn't your current code produce NPEs?
>

Wrong your old code was not able to produce Exceptions but it simply
stopped to early as you might have discovered.