8 Answers, 1 is accepted
The provided information is not enough to determine the cause for the described problem. Therefore I would ask you to send us the programmatically created grid code so we an review it locally. Also verify that you are using the latest Telerik UI for ASP.NET AJAX version.
Regards,
Pavlina
Telerik
Following is the code for generating the Grid in runtime, and showing it in <div> , using Grid version v4.0.30319
--------------------------------- Generating the grid ---------------------------------
rtgSOPMatrix = new RadGrid();
rtgSOPMatrix.ID = "rtgSOPMatrix";
rtgSOPMatrix.AutoGenerateColumns = false;
rtgSOPMatrix.ShowFooter = false;
rtgSOPMatrix.MasterTableView.CommandItemSettings.ShowExportToPdfButton = true;
rtgSOPMatrix.MasterTableView.CommandItemSettings.ShowRefreshButton = true;
rtgSOPMatrix.ExportSettings.HideStructureColumns = true;
rtgSOPMatrix.ExportSettings.ExportOnlyData = true;
rtgSOPMatrix.ExportSettings.IgnorePaging = true;
rtgSOPMatrix.ExportSettings.OpenInNewWindow = true;
rtgSOPMatrix.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
rtgSOPMatrix.AllowMultiRowEdit = true;
rtgSOPMatrix.ClientIDMode = System.Web.UI.ClientIDMode.Predictable;
rtgSOPMatrix.MasterTableView.TableLayout = GridTableLayout.Auto;
rtgSOPMatrix.MasterTableView.EditMode = GridEditMode.InPlace;
rtgSOPMatrix.AllowPaging = false;
rtgSOPMatrix.AllowSorting = false;
rtgSOPMatrix.SkinID = "Matrix";
rtgSOPMatrix.ClientSettings.Scrolling.FrozenColumnsCount = 2;
rtgSOPMatrix.ClientSettings.Scrolling.AllowScroll = true;
rtgSOPMatrix.ClientSettings.Scrolling.SaveScrollPosition = true;
rtgSOPMatrix.ClientSettings.Scrolling.UseStaticHeaders = true;
//rtgSOPMatrix.ClientSettings.Scrolling.ScrollHeight = 450;
rtgSOPMatrix.ClientSettings.EnableRowHoverStyle = true;
rtgSOPMatrix.ItemDataBound += new GridItemEventHandler(rtgSOPMatrix_ItemDataBound);
rtgSOPMatrix.PreRender += new EventHandler(rtgSOPMatrix_PreRender);
foreach (DataColumn dc in table.Columns)
{
GridBoundColumn bc = new GridBoundColumn();
switch (dc.ColumnName)
{
case "Description":
bc.DataField = dc.ColumnName;
bc.UniqueName = dc.ColumnName;
bc.HeaderText = "Standard Of Performance";
bc.Visible = true;
bc.ReadOnly = false;
bc.HeaderStyle.Width = Unit.Pixel(350);
break;
case "DisplayName":
bc.DataField = dc.ColumnName;
bc.UniqueName = dc.ColumnName;
bc.HeaderText = "SOP Element Group";
bc.Visible = true;
bc.ReadOnly = false;
bc.HeaderStyle.Width = Unit.Pixel(125);
break;
default:
bc.DataField = dc.ColumnName;
bc.UniqueName = dc.ColumnName;
bc.HeaderText = dc.ColumnName;
bc.Visible = false;
break;
}
rtgSOPMatrix.MasterTableView.Columns.Add(bc);
}
int i = 0;
foreach (IndexOfEvidence indev in indexofEvidence)
{
DataColumn dc = new DataColumn('i' + i.ToString(), typeof(int));
GetSOPTable().Columns.Add(dc);
RatingColumn rc = new RatingColumn('i' + i.ToString(), indev.IndexOfEvidenceID.GetValueOrDefault(), indev.Number.GetValueOrDefault());
rc.DataField = 'i' + i.ToString();
rc.UniqueName = 'i' + i.ToString();
rc.HeaderText = indev.Evidence;
rc.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
rc.HeaderStyle.Width = Unit.Pixel(75);
rtgSOPMatrix.MasterTableView.Columns.Add(rc);
foreach (DataRow dr in GetSOPTable().Rows)
{
dr[dc] = GetRating(Convert.ToInt32(dr["SOPQuestionsId"]), Convert.ToInt32(dr["SOPElementGroupId"]), indev.IndexOfEvidenceID);
}
i++;
}
this.GridPlaceHolder.Controls.Add(rtgSOPMatrix);
---------------------------------
private void rtgSOPMatrix_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
{
int totalRowCellsIntheGrid = 11;
int noOfColumnsInTheGrid = e.Item.Cells.Count;
int total = 0;
int idNumber = 0;
string strValues = string.Empty;
int? nullable = null;
bool IsPopupShow = true;
var sopq1 = sop.Where<SOPQuestions>(sopq => sopq.SOPQuestionsID == Convert.ToInt32(e.Item.Cells[6].Text)).Take(1);
foreach (var item in sopq1)
{
if (!string.IsNullOrEmpty(item.Comments))
{
TableCell tc = e.Item.Cells[10] as TableCell;
idNumber++;
Label p = new Label();
p.ID = "Questions" + idNumber.ToString();
p.Text = tc.Text;
tc.Controls.Add(p);
TableCell tc1 = e.Item.Cells[11] as TableCell;
//Show the requirement information as tooltip, if the changes done in requirement, changes need not be reflected
//for closed assessment status
AssesmentWorkflow objCurrentWorkFlow = AssesmentWorkflow.Get(AssesmentID.GetValueOrDefault());
Label p1 = new Label();
p1.ID = "TooltipPanel" + idNumber.ToString();
if (tc1.Text == " " || tc1.Text == null)
{
if (objCurrentWorkFlow.AssesmentStatus > (int?)AssesmentStatus.AssesmentStart)
{ p1.Text = string.Empty; IsPopupShow = false; }
else
{
p1.Text = item.Comments;
}
}
else
{
p1.Text = tc1.Text;
}
if (IsPopupShow)
{
tc.Controls.Add(p1);
System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
img.ID = "Imgae" + idNumber.ToString();
img.ImageUrl = "~/Images/Active.Gif";
img.ImageAlign = ImageAlign.Right;
img.Width = Unit.Pixel(16);
img.Height = Unit.Pixel(16);
tc.Controls.Add(img);
}
}
}
int SOPQuestionId = Convert.ToInt32(e.Item.Cells[6].Text);
int SOPElementGroupId = Convert.ToInt32(e.Item.Cells[5].Text);
bool allowedit = true;
for (int i = 0, j = noOfColumnsInTheGrid - totalRowCellsIntheGrid; j >= 1; i++, j--)
{
RadComboBox radc = e.Item.FindControl("i" + i.ToString()) as RadComboBox;
total += radc != null ? Convert.ToInt32(radc.SelectedValue) : 0;
strValues += radc != null ? radc.ClientID + '@' : string.Empty;
int? indexOfEvidenceID = radc != null && radc.Items.Count > 4 ? Convert.ToInt32(radc.Items[4].Value) : nullable;
int? IndexOfEvidenceNumber = radc != null && radc.Items.Count > 5 ? Convert.ToInt32(radc.Items[5].Value) : nullable;
SOP sop = GetSOP(SOPQuestionId, SOPElementGroupId, indexOfEvidenceID);
if (sop != null)
{
if (sop.PreviousRating != null)
{
radc.Font.Bold = true;
radc.ForeColor = System.Drawing.Color.Red;
}
if (Employee == "true")
{
// Just new evidence then its a mock object just to bypass the if condition
sop = sop == null ? new SOP() { IsSavedByEmployee = false } : sop;
if ((IndexOfEvidenceNumber <= 1000))
{
radc.Enabled = false;
radc.ToolTip = "Index of Evidence is disabled :)";
}
IndexOfEvidence objindexofevidence = IndexOfEvidence.Get(sop.IndexOfEvidence??0);
if (objindexofevidence != null)
{
if (!objindexofevidence.AllowEdit??false)
{
radc.OnClientDropDownOpening = "OnClientDropDownOpening";
radc.AllowCustomText = false;
radc.EnableLoadOnDemand = false;
radc.MarkFirstMatch = false;
radc.ToolTip = "Index of Evidence is disabled :)";
}
}
}
else if (Session["IsVarifier"] != null)
{
if (Session["IsVarifier"].ToString().ToUpper() == "TRUE")
{
radc.OnClientDropDownOpening = "OnClientDropDownOpening";
}
}
}
if (radc != null)
{
radc.Attributes.Add("rowid", e.Item.ClientID);
radc.OnClientSelectedIndexChanged = "calculateCompetency";
}
}
e.Item.Attributes.Add("dropdownCollection", strValues.TrimEnd('@'));
e.Item.BackColor = total >= 3 ? Color.LightGreen : total == 0 ? Color.Empty : Color.Tomato;
}
}
private void rtgSOPMatrix_PreRender(object sender, EventArgs e)
{
for (int i = 10; i < rtgSOPMatrix.MasterTableView.Columns.Count; i++)
{
rtgSOPMatrix.MasterTableView.GetColumn(rtgSOPMatrix.MasterTableView.Columns[i].UniqueName).HeaderStyle.Width = Unit.Pixel(50);
}
}
The provided code looks correct. Could you please download the latest Q2 2015 (2015.2.623) version of Telerik Ui for ASP.NET AJAX and let me know if the same grid issue still persists?
Regards,
Pavlina
Telerik
I replaced with latest version of Telerik UI (Q2 2015 (2015.2.729.35)) the problem still persists. Horizontal scrolling is not happening properly due to this last columns are not visible properly (resizes the controls also). But works fine in Chrome and Firefox. This problem is in IE (11).
Is it a known issue of grid control for IE?
Could you make sure that you are not running the page in IE compatibility mode? These modes can exhibit different behavior and rendering problems, compared to the browser versions they emulate. It is highly recommended to use IE's Edge mode via META tag or HTTP header: http://blogs.msdn.com/b/ie/archive/2010/06/16/ie-s-compatibility-features-for-site-developers.aspx
Regards,
Pavlina
Telerik
We are using Telerik UI latest trial version. We are too facing this issue. In grid first 3 columns fixing works but not all columns are visible when we scroll horizontally. The code is the same as above example.
Please suggest the solution.
Dear Telerik team,
I had posted my query 2 days back
We are using Telerik UI latest trial version. We are too facing this issue. In grid first 3 columns fixing works but not all columns are visible when we scroll horizontally. The code is the same as above example.
Please suggest the solution.
Can I get any solution on this?
I have attached a sample test page where grid is programmatically created, horizontal scrolling with frozen columns are also enabled and grid is working properly. In case the problem on your end still exists isolate the issue in a runnable project and send it to us, so we can investigate the case further.
Regards,
Pavlina
Telerik by Progress