I am having an issue trying to make a RadGrid responsive using CSS. When the browser width is wide, the 6 columns are all visible. When the user shrinks the browser width, at a certain point two of the columns disappear as they should -- but at the same time a new column shows up that doesn't even have a header visible. It's very strange. Any help would be most appreciated. The basic grid is defined in the .aspx as:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Width
=
"99.7%"
AutoGenerateColumns
=
"false"
AllowPaging
=
"false"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
></
telerik:RadGrid
>
The columns to the grid are defined in the code behind as:
GridHyperLinkColumn hypercolumn =
null
;
GridBoundColumn boundcolumn =
null
;
RadGrid1.EnableViewState =
false
;
InitGrid(
ref
RadGrid1);
RadGrid1.NeedDataSource +=
new
Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
RadGrid1.MasterTableView.DataKeyNames =
new
string
[] {
"FAQ"
};
string
templateColumnName =
"Edit"
;
GridTemplateColumn templateColumn =
new
GridTemplateColumn();
templateColumn.ItemTemplate =
new
MyTemplate(templateColumnName);
templateColumn.AllowFiltering =
false
;
templateColumn.HeaderText =
"Edit"
;
RadGrid1.MasterTableView.Columns.Add(templateColumn);
boundcolumn =
new
GridBoundColumn();
this
.RadGrid1.Columns.Add(boundcolumn);
boundcolumn.UniqueName =
"FAQPublic"
;
boundcolumn.DataField =
"FAQPublic"
;
boundcolumn.HeaderText =
"Public?"
;
boundcolumn.HeaderStyle.CssClass =
"mediumgridcol"
;
boundcolumn.ItemStyle.CssClass =
"mediumgridcol"
;
boundcolumn.AllowFiltering =
false
;
boundcolumn.Visible =
true
;
boundcolumn =
null
;
boundcolumn =
new
GridBoundColumn();
this
.RadGrid1.Columns.Add(boundcolumn);
boundcolumn.UniqueName =
"FAQIntranet"
;
boundcolumn.DataField =
"FAQIntranet"
;
boundcolumn.HeaderText =
"Intranet?"
;
boundcolumn.HeaderStyle.CssClass =
"mediumgridcol"
;
boundcolumn.ItemStyle.CssClass =
"mediumgridcol"
;
boundcolumn.AllowFiltering =
false
;
boundcolumn.Visible =
true
;
boundcolumn =
null
;
boundcolumn =
new
GridBoundColumn();
this
.RadGrid1.Columns.Add(boundcolumn);
boundcolumn.UniqueName =
"FAQTopic"
;
boundcolumn.DataField =
"FAQTopic"
;
boundcolumn.FilterControlWidth = Unit.Pixel(50);
boundcolumn.HeaderText =
"Topic"
;
boundcolumn.Visible =
true
;
boundcolumn =
null
;
boundcolumn =
new
GridBoundColumn();
this
.RadGrid1.Columns.Add(boundcolumn);
boundcolumn.UniqueName =
"FAQQuestion"
;
boundcolumn.DataField =
"FAQQuestion"
;
boundcolumn.HeaderText =
"Question"
;
boundcolumn.FilterControlWidth = Unit.Pixel(50);
boundcolumn.Visible =
true
;
boundcolumn =
null
;
templateColumnName =
"Delete"
;
templateColumn =
new
GridTemplateColumn();
templateColumn.ItemTemplate =
new
MyTemplate2(templateColumnName);
templateColumn.AllowFiltering =
false
;
templateColumn.HeaderText =
"Delete"
;
RadGrid1.MasterTableView.Columns.Add(templateColumn);
I have attached two (2) screen captures -- the first when it is wide, the second after the user shrinks the window. Any assistance would be most appreciated. I am running on Windows 10, this project is in Visual Studio 2013.
Thanks in advance.