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

How can I write to any cell or range of cells in the ggc from outside the ggc, for example, from a button click event?

How can I write to any cell or range of cells from out the ggc, for example, from a button click event?

Can the text that I am writing to a cell is greater than the length of the cell, how can I make the cell automatically overflow?

3 Replies

AD Administrator Syncfusion Team February 14, 2007 01:17 AM UTC

Hi James,

The Floatingcells is the terminology that is used for the cells whose content occupies adjacent empty cells. In this manner, the values float on the next cells. The Floatingcells ( \Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\Appearance\FloatingCells\ )browser sample will show you Essential Grid’s support for floating cells and how to initialize it.

Best regards,
Haneef


JB James Blibo February 14, 2007 02:24 AM UTC

This still doesn't answer the question. Besides, the samples is specific to the grid control and NOT the grouping grid control. My question was more about how to write to any cell in the ggc from outside the ggc, say from a button click event for example, than about floating cell.


AD Administrator Syncfusion Team February 14, 2007 11:08 PM UTC

Hi James,

1) How can I write to any cell or range of cells from out the ggc, for example, from a button click event?
>>>>>>
Use the TableModel indexer property to write the cell from button click event. Please try the code snippet.

foreach(GridRangeInfo info in this.gridGroupingControl1.TableModel.SelectedRanges)
{
for(int i = info.Top ;i <= info.Bottom ;i++)
for(int j = info.Left ;j <= info.Right ;j++)
this.gridGroupingControl1.TableModel[i,j].Text ="Yes";

}

2) Floating...
>>>>>>
There is no built-in support for this. But one way you can do this by handling the TableModel.QueryCoveredRange event and set the e.Range to overflow range in a grid. Here is a code snippet

private void TableModel_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
GridTableModel tm = sender as GridTableModel;
if( e.ColIndex + 1 < tm.ColCount && tm[e.RowIndex,e.ColIndex + 1 ].Text == string.Empty )
{
e.Range = GridRangeInfo.Cells(e.RowIndex,e.ColIndex,e.RowIndex,e.ColIndex + 1);
e.Handled = true;
}
}

Here is a sample.
GGCFloatCellANDWrite.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon