hello i need to be able to hide text overflow on a grid with non fixed layout.
this can be achieved by inserting <div> inside each table cell with text overflow hidden.
is it possible to gain access to cell element on the server in order to enclose the text within a div?
heres my quick solution..
void AddOverflowToCells(RowsCollection rows) {
if (rows == null || rows.Count < 0) return;
foreach (UltraGridRow row in rows) {
foreach (UltraGridCell cell in row.Cells)
cell.Text = string.Format( @"<div style=overflow:hidden;width:{0}>{1}</div>",cell.Column.Width, cell.Text);
AddOverflowToCells(row.Rows);
}
Does the following also help? This code would be in InitializeLayout.
using Infragistics.WebUI.UltraWebGrid;...e.Layout.RowStyleDefault.TextOverflow = TextOverflow.Clip;e.Layout.RowStyleDefault.Wrap = false;
You might instead need to set either or both the TextOverflow and Wrap properties on the CellStyle properties of each column.
You might also need to set the grid's TableLayout property to Fixed to keep it from resizing your rows and columns. If setting TableLayout to Fixed isn't an option, then the solution you've mentioned may be the best solution, being the easiest and most efficient way to get the result you're after.
ok,
so my fix is also no good,
because it breaks the column.footer.sum functionality. as well as outlookgroupby mask where i apply [sum:filed]
apparently the grid applies calculations to the actual table and not underlying data????? :(
By changing the Text property of your cells, you're also changing the cells' Value. Summaries and group-by functionality both depend on the cell's value. So, this result would be expected.
the UltraGridCell has a Value property, AND Text property.
i verified, that changing the Text property also changes the Value property, and vice versa.
grrrr..
is that by design? why have 2 properties if they are synchronized like that....
rbuch said:there has to be a way i can add some marktup to the cell w/out changing the underlying value??
Using a templated cell has its own costs. Templates in ASP.NET entail a performance hit, which will be magnified if the template is instantiated a number of times (such as a large number of cells). You will also lose the ability to edit the cell's HTML in a way that automatically updates the cell's value, unless you write JavaScript to reconnect the cell's HTML to its value.
rbuch said:it looks like column summing happens at RENDER time??
rbuch said:i verified, that changing the Text property also changes the Value property, and vice versa ... is that by design?