I have a grid which columns are dynamically created on runtime. The grid renders fine, but I cannot resize the grid columns in Internet Explorer 8, because the resize handle icon is not shown. There is no problem in IE 9 or in any other browser.
When I use a static grid (column are defined in the razor view) the column resizing works fine also in IE 8. So the combination of dynamic grid columns and IE 8 causes the bug.
Here is the code I use in my razor View to define the dynamic grid:
Any idea how I can get the resizing handle shown when I move over the columns in IE 8? Updating to IE 9 is not a solution for me, because the customer is forced to use IE 8. Thanks.
When I use a static grid (column are defined in the razor view) the column resizing works fine also in IE 8. So the combination of dynamic grid columns and IE 8 causes the bug.
Here is the code I use in my razor View to define the dynamic grid:
@{
string
controller = ViewContext.GetCurrentController();
string
action = ViewContext.GetCurrentAction();
string
methodName =
"_GetNewGridRows"
+
"_"
+ action;
WFObjectListViewModel objectListViewModel = Model;
}
@(Html.Kendo().Grid(objectListViewModel.ObjectDataList)
.Name(
"Grid_"
+ objectListViewModel.UniqueID)
.Columns(columns =>
{
columns.Bound(c => c.ID)
.Hidden(
true
)
.Title(
"wfID"
);
columns.Bound(c => c.AspSite)
.Hidden(
true
)
.Title(
"aspSite"
);
for
(
int
i = 0; i < objectListViewModel.FolderColumns.Count; i++)
{
var id = i;
var itemAttributesId = id + 2;
if
(objectListViewModel.FolderColumns[i].Type ==
"text"
)
{
string
template =
null
;
if
(Model.FolderColumns[i].ColumnName ==
"subject"
)
{
string
wfID =
"\"#=ItemAttributes["
+ 0 +
"]#\""
;
string
aspSite =
"\"#=ItemAttributes["
+ 1 +
"]#\""
;
string
jsOpenWindow =
"javascript:openWindow("
+ wfID +
", "
+ aspSite +
")"
;
template =
string
.Format(
"<a href='{0}' style='white-space: nowrap;'>{1}</a>"
, jsOpenWindow,
"#=ItemAttributes["
+ itemAttributesId +
"]#"
);
}
else
{
template =
string
.Format(Model.FolderColumns[id].Template,
"#=ItemAttributes["
+ itemAttributesId +
"]#"
);
}
columns.Bound(c => c.ItemAttributes)
.ClientTemplate(
"#=gridClientTemplate(Unread, 'begin')#"
+ template +
"#=gridClientTemplate(Unread, 'end')#"
)
.Title(Model.FolderColumns[id].ColumnDisplayName)
.Hidden(Model.FolderColumns[i].Hidden)
.Column.Member = Model.FolderColumns[id].ColumnUniqueName;
}
else
if
((Model.FolderColumns[id].Type ==
"image"
) || (Model.FolderColumns[id].Type ==
"deadline"
) || (Model.FolderColumns[id].Type ==
"bit"
))
{
int
columnWidth = 22 + (Model.FolderColumns[id].ColumnDisplayName.Length * 5);
columns.Bound(c => c.ItemAttributes)
.ClientTemplate(
"#=gridClientTemplate(Unread, 'begin')#"
+
string
.Format(Model.FolderColumns[id].Template,
"#=ItemAttributes["
+ itemAttributesId +
"]#"
) +
"#=gridClientTemplate(Unread, 'end')#"
)
.Title(Model.FolderColumns[id].ColumnDisplayName)
.Width(columnWidth)
.Hidden(Model.FolderColumns[i].Hidden)
.Column.Member = Model.FolderColumns[id].ColumnUniqueName;
}
}
})
.EnableCustomBinding(
true
)
.DataSource(dataSource => dataSource.Ajax()
.Read(read => read.Action(methodName, controller,
new
{ folderID = Model.FolderID, searchFilterJson = ViewData[
"hiddenSearchFilter_Data"
] }))
.PageSize(Model.EntriesPerPage)
.Total(Model.TotalItems)
)
.Sortable(sorting => sorting.SortMode(GridSortMode.MultipleColumn))
.Selectable()
.Scrollable()
.Resizable(resizing => resizing.Columns(
true
))
.Events(events => events.DataBound(
"onObjectDataListBound_"
+ controller +
"_"
+ action))
.Pageable(pageing => pageing.Enabled(
true
).Refresh(Model.AllowGridRefresh).Input(
true
).Numeric(
false
).PreviousNext(
true
).PageSizes(
new
int
[] {3, 5, 10, 15, 25, 50, 75, 100 }))
)
Any idea how I can get the resizing handle shown when I move over the columns in IE 8? Updating to IE 9 is not a solution for me, because the customer is forced to use IE 8. Thanks.