Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Joe #1
Truncate text in column
Does anyone know a way to truncate the text in a column such that the text
doesn't wrap to a second line? With winform you can MeasureString using the
Font, but I can't find a way to use that with asp.net.
One thought occurred to me - turn off "wrap text within cells", but that
makes the grid as a whole widen out. Perhaps I can set the width of the
column back to it's proper value after the data loads up?
Thanks!
Joe Guest
-
Two-column text inside one-column text box?
Hello everybody, I'm working on a small size book with a one-column text box threaded through the whole thing. There are some short lists that I'd... -
PHP Truncate Text
Can anyone please tell me how to truncate dynamic PHP text - is there aan extension available that does this ?? Thanks............ -
hyperlink column text. Where is it??
Does anyone have any idea how to get the text out of a hyperlink column in a web datagrid? It's a hyperlink column, not a template column so... -
Image in header column (not replacing column header text)
I have a sortable (asc/desc) datagrid and would like to add a small arrow icon (down/up) next to the column header text to improve the UI. Is this... -
Q: Get Text from Hyperlink Column
Hi, I have a column in my DataGrid which is a Hyperlink Column. Everything work find except when I try to get the text of the column using... -
Elton Wang #2
Truncate text in column
Hi Joe,
You can truncate the text in a column from
DataGrid_ItemDataBound event. The sample code as follows:
DataRowView drv = (DataRowView)e.Item.DataItem;
TableCell cell = (TableCell)e.Item.Controls[columnIndex];
cell.Text = drv[columnIndex].Tostring().Substring(0,
length);
Hope it's helpful to you.
Elton Wang
[email]elton_wang@hotmail.com[/email]
such that the text>-----Original Message-----
>Does anyone know a way to truncate the text in a columnMeasureString using the>doesn't wrap to a second line? With winform you cancells", but that>Font, but I can't find a way to use that with asp.net.
>
>One thought occurred to me - turn off "wrap text withinthe width of the>makes the grid as a whole widen out. Perhaps I can set>column back to it's proper value after the data loads up?
>
>Thanks!
>
>
>
>.
>Elton Wang Guest



Reply With Quote

