Hi
I have a radgrid declared on my page:
Within the grid control we also have a button that auto resizes the columns. What we are trying to achieve is set 1 of these particular columns to a fixed width. We have achieved this however, we cant remove the white-space property from the cell so when the content goes beyond our fixed width the text is automatically carried over into the next line of the cell i.e. a line break.
below code for creating a default column server side:
We have tried to access the column through script like so:
This returns the attached screenshot error.
Any suggestions would be greatly appreciated.
Regards,
Jonathan
I have a radgrid declared on my page:
<radG:RadGrid ID="grd" Skin="orange" Style="padding-left: 0px" runat="server" EnableAJAXLoadingTemplate="false" AllowCustomPaging="true" enableasyncrequests="false" AllowPaging="false" PageSize="10" AllowSorting="true" AutoGenerateColumns="false" showheaderswhennorecords="true" AllowMultiRowSelection="true" CssClass="GenericDataGrid" applystylesonclient="false" OnNeedDataSource="cRadGrid1_NeedDataSource" OnItemDataBound="cRadGrid1_ItemDataBound" OnDataBinding="cRadGrid1_DataBinding" OnDataBound="cRadGrid1_DataBound" OnSortCommand="cRadGrid1_SortCommand" >
Within the grid control we also have a button that auto resizes the columns. What we are trying to achieve is set 1 of these particular columns to a fixed width. We have achieved this however, we cant remove the white-space property from the cell so when the content goes beyond our fixed width the text is automatically carried over into the next line of the cell i.e. a line break.
below code for creating a default column server side:
// create column if (!ColumnExists(column, key)) { grd.MasterTableView.Columns.Add(boundColumn); boundColumn.DataField = GetDataField(column); boundColumn.HeaderText = GetHeaderText(column); boundColumn.UniqueName = key; boundColumn.SortExpression = GetDataField(column); boundColumn.DataFormatString = @"<div id=a title='{0}'>{0}</div>"; if (column == ColumnListBaseEnum.DescriptionOrTitle.ToString()) { col.HeaderStyle.Width = Unit.Pixel(438); boundColumn.Resizable = true; col.HeaderStyle.Wrap = false; col.ItemStyle.Wrap = false; } }
We have tried to access the column through script like so:
var gridCellStyle = gridRow.cells[i].children[0].getAttribute('currentStyle'); gridCellStyle.whiteSpace = '';
This returns the attached screenshot error.
Any suggestions would be greatly appreciated.
Regards,
Jonathan