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

Scrollable Cell

I need to make a cell scrollable, I am using the following code to achieve this

private void mmpGrid_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = this.mmpGrid.TableControl.CurrentCell;
if(showPreview)
{
for(int count=0;count {
if(e.TableControl.TableDescriptor.Columns[count].MappingName=="psummary" )
{
e.Inner.Style.Enabled =true;
e.Inner.Style.AllowEnter = true;
e.Inner.Style.WrapText = true;
e.Inner.Style.VerticalScrollbar = true;
e.Inner.Style.TextColor =Color.Red ;

e.Inner.Cancel =true;

}
}
}

}



But it works downward only, if I click from top to bottom cells it works properly , if I change the order of clicks it is not showing scroll in the cells except the first cell. Please let me know the solution


5 Replies

AD Administrator Syncfusion Team August 11, 2006 06:49 AM UTC

Hi Sivaiah,

By setting the style.wraptext = true and the style.VerticalScrollbar = true in the QueryCellStyleInfo event handler, a vertical scrollbar will appear as you edit the cell. You need to have sufficient row height, to see the text getting wrapped in the cell.
Try the attached sample, that works fine in displaying the vertical scrollbar properly when the cell content is one more than one line tall.

Here is a sample
http://www.syncfusion.com/Support/user/uploads/GGC_ScrollableCell_8b5e188a.zip

Let me know if you need any further assistance.
Thanks for using Syncfusion Products.

Regards,
Rajagopal


SB Sivaiah Boppana August 11, 2006 10:04 AM UTC


Hi Rajagopal
I tried this as well ,it is working when I click in the order 1st row, 2nd row, 3rd row….

If i go back to 1st row after 3rd row scroll bar is not showing on the 1st row. I think you got it.
Thanks
siva

>I need to make a cell scrollable, I am using the following code to achieve this

private void mmpGrid_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = this.mmpGrid.TableControl.CurrentCell;
if(showPreview)
{
for(int count=0;count {
if(e.TableControl.TableDescriptor.Columns[count].MappingName=="psummary" )
{
e.Inner.Style.Enabled =true;
e.Inner.Style.AllowEnter = true;
e.Inner.Style.WrapText = true;
e.Inner.Style.VerticalScrollbar = true;
e.Inner.Style.TextColor =Color.Red ;

e.Inner.Cancel =true;

}
}
}

}



But it works downward only, if I click from top to bottom cells it works properly , if I change the order of clicks it is not showing scroll in the cells except the first cell. Please let me know the solution



AD Administrator Syncfusion Team August 11, 2006 11:33 AM UTC

Hi Sivaiah,

Please modify the code as below in the TableControlCurrentCellChanged event, to get this working properly.
//
GridCurrentCell cc = e.TableControl.CurrentCell;
this.gridGroupingControl1.TableModel.RowHeights.ResizeToFit( GridRangeInfo.Row(cc.RowIndex) );
//

Thanks,
Rajagopal


SB Sivaiah Boppana August 16, 2006 11:23 AM UTC


Hi Rajagopal
My grid is read only , so TableControlCurrentCellChanged event never fired.
Thanks
Sivaiah

>Hi Sivaiah,

Please modify the code as below in the TableControlCurrentCellChanged event, to get this working properly.
//
GridCurrentCell cc = e.TableControl.CurrentCell;
this.gridGroupingControl1.TableModel.RowHeights.ResizeToFit( GridRangeInfo.Row(cc.RowIndex) );
//

Thanks,
Rajagopal


AD Administrator Syncfusion Team August 17, 2006 10:12 AM UTC

Hi Sivaiah,

I have created the sample as per your requirement. Please refer to the attached sample and let me know if you are trying something different.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GGC_ScrollableCell_217027e1.zip

Let me know if this helps.
Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon