This is a migrated thread and some comments may be shown as answers.

Horizontal scrolling and Resize issue

8 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jyothiprasad
Top achievements
Rank 1
Jyothiprasad asked on 30 Jul 2015, 02:26 PM
I am using Telerik radGrid control in aspx page to show 25 column with first 3 column fixed except first 3 columns the column width is set to 50px. From column 4 onwards the cell contains a drop down control. The grid is dynamically created. The issue is,the column resizes automatically to 10px/20px instead of the defined 50px initial columns are appearing properly, the horizontal scrolling is also not happening in IE 11. I am using Grid version v4.0.30319 of Telerik Web.UI controls. In earlier threads, I found the issue is resolved, but I am facing the issue. Please suggest a solution/work around to resolve the issue.

8 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 04 Aug 2015, 02:06 PM
Hello,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jyothiprasad
Top achievements
Rank 1
answered on 04 Aug 2015, 03:54 PM

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 == "&nbsp;" || 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);
        }
    }

0
Pavlina
Telerik team
answered on 07 Aug 2015, 09:32 AM
Hello,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jyothiprasad
Top achievements
Rank 1
answered on 07 Aug 2015, 11:20 AM

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?

 

0
Pavlina
Telerik team
answered on 12 Aug 2015, 11:17 AM
Hello,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ravi
Top achievements
Rank 1
answered on 04 Oct 2016, 10:39 AM

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.

0
Ravi
Top achievements
Rank 1
answered on 06 Oct 2016, 06:45 AM

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?

0
Pavlina
Telerik team
answered on 06 Oct 2016, 07:31 PM
Hi,

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
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Jyothiprasad
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Jyothiprasad
Top achievements
Rank 1
Ravi
Top achievements
Rank 1
Share this question
or