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

Auto expand not working in 1680 x 1050

3 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajz
Top achievements
Rank 1
Rajz asked on 01 Aug 2011, 04:06 AM
Whenever we change the display resolution and refresh the screen the grid seemlessly fits the entire screen. But if the resolution is changed to 1680 x 1050 it is not happening!

Any workaround possible?!

Thank you

Regards
Raj

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Aug 2011, 04:07 PM
Hello Raj,

I tried to reproduce this problem locally but unfortunately to no avail. Please see my code below and let me know what is missing.

Default.aspx
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true">
</telerik:RadGrid>

Default.aspx.cs
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    RadGrid1.NeedDataSource += (s, a) => { RadGrid1.DataSource = Enumerable.Range(0, 100); };
}

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Rajz
Top achievements
Rank 1
answered on 12 Aug 2011, 07:41 AM

Getting this error message in ItemDatabound method:

DataBinding: 'System.Int32' does not contain a property with the name 'WorkTaskID'.

ItemDatabound
try

        {

            if (e.Item is GridHeaderItem)

            {

                GridHeaderItem item = e.Item as GridHeaderItem;

                CheckBox chkHeaderSelect = (CheckBox)item.FindControl("chkHeaderSelect");

                if (chkHeaderSelect != null)

                {

                    chkHeaderSelect.Attributes.Add("OnClick", "SelectAll(" + chkHeaderSelect.ClientID + ");");

                }

            }

            if (e.Item is GridDataItem)

            {

                GridDataItem dataBoundItem = e.Item as GridDataItem;

                if (dataBoundItem["TaskStatus"].Text == "Rejected")

                {

                    dataBoundItem.BackColor = System.Drawing.Color.IndianRed;

                    dataBoundItem.ForeColor = System.Drawing.Color.White;

                    dataBoundItem.Font.Bold = true;

                }

                else if ((dataBoundItem["TaskStatus"].Text == "&nbsp;")

                    && (dataBoundItem["AllocatedDate"].Text != "&nbsp;")

                    && (dataBoundItem["IssuedDate"].Text == "&nbsp;"))

                {

                    dataBoundItem.BackColor = System.Drawing.Color.LightSkyBlue;

                    dataBoundItem.Font.Bold = true;

                }

                else if ((dataBoundItem["TaskStatus"].Text == "&nbsp;")

                    && (dataBoundItem["CompanyName"].Text != "&nbsp;")

                    && (dataBoundItem["AllocatedDate"].Text != "&nbsp;")

                    && (dataBoundItem["IssuedDate"].Text != "&nbsp;"))

                {

                    dataBoundItem.BackColor = System.Drawing.Color.LightGreen;

                    dataBoundItem.Font.Bold = true;

                }

                else if ((dataBoundItem["TaskStatus"].Text == "&nbsp;")

                    && (dataBoundItem["AllocatedDate"].Text == "&nbsp;")

                    && (dataBoundItem["IssuedDate"].Text == "&nbsp;")

                    && (dataBoundItem["RepeatFlag"].Text == "Y"))

                {

                    dataBoundItem.BackColor = System.Drawing.Color.LemonChiffon;

                    dataBoundItem.Font.Bold = true;

                }

                //Repeat of RM_PS

                if (dataBoundItem["IsPSJob"].Text == "True")

                {

                    dataBoundItem.BackColor = System.Drawing.Color.LightSeaGreen;

                    dataBoundItem.ForeColor = System.Drawing.Color.White;

                    dataBoundItem.Font.Bold = true;

                }

                if (dataBoundItem["CusAddress"] != null && dataBoundItem["CusAddress"].Text.Length > 15)

                {

                    dataBoundItem["CusAddress"].ToolTip = dataBoundItem["CusAddress"].Text;

                    dataBoundItem["CusAddress"].Text = dataBoundItem["CusAddress"].Text.Substring(0, 15) + "...";

                }

                if (dataBoundItem["VerifiedAddress"] != null && dataBoundItem["VerifiedAddress"].Text.Length > 15)

                {

                    dataBoundItem["VerifiedAddress"].ToolTip = dataBoundItem["VerifiedAddress"].Text;

                    dataBoundItem["VerifiedAddress"].Text = dataBoundItem["VerifiedAddress"].Text.Substring(0, 15) + "...";

                }

                if (dataBoundItem["CusName"] != null && dataBoundItem["CusName"].Text.Length > 15)

                {

                    dataBoundItem["CusName"].ToolTip = dataBoundItem["CusName"].Text;

                    dataBoundItem["CusName"].Text = dataBoundItem["CusName"].Text.Substring(0, 15) + "...";

                }

                ImageButton btnView = (ImageButton)dataBoundItem.FindControl("btnView");

                string repeatPriorityID = dataBoundItem.GetDataKeyValue("RepeatPriorityID") != null ? dataBoundItem.GetDataKeyValue("RepeatPriorityID").ToString() : string.Empty;

                if (!string.IsNullOrEmpty(repeatPriorityID))

                {

                    if (btnView != null)

                    {

                        if (repeatPriorityID.Equals("1"))

                        {

                            btnView.ImageUrl = "../Images/RedView.JPG";

                        }

                        else if (repeatPriorityID.Equals("2"))

                        {

                            btnView.ImageUrl = "../Images/YellowView.JPG";

                        }

                    }

                }

                #region  RB1C0 (If job was reported before 1PM of the current day)

                string reportedDateTime = dataBoundItem.GetDataKeyValue("ReportedDateTime") != null ? dataBoundItem.GetDataKeyValue("ReportedDateTime").ToString() : string.Empty;

                DateTime currentDate = Utilities.GetDateTime(DateTime.Now.ToString(Constant.DateFormat.DDMMYYYY) + " 13:00:00.000");

                if (!string.IsNullOrEmpty(reportedDateTime))

                {

                    DateTime? ReportedDateTime = Utilities.GetNullableDateTime(reportedDateTime);

                    if (ReportedDateTime < currentDate)

                    {

                        if (btnView != null)

                        {

                            if (!string.IsNullOrEmpty(repeatPriorityID))

                            {

                                if (repeatPriorityID.Equals("1"))

                                {

                                    //RB1C0 and 7 days repeats

                                    btnView.ImageUrl = "../Images/RedViewRB1C0.JPG";

                                }

                                else if (repeatPriorityID.Equals("2"))

                                {

                                    //RB1C0 and 7 - 30 days repeats

                                    btnView.ImageUrl = "../Images/YellowViewRB1C0.JPG";

                                }

                            }

                            else

                            {

                                //RB1C0 but no repeats

                                btnView.ImageUrl = "../Images/ViewRB1C0.JPG";

                            }

                        }

                    }

                }

                #endregion

            }

        }

        catch (Exception exception)

        {

            Utility.ShowErrorMessage(this.Page, exception.Message);

        }

   

0
Daniel
Telerik team
answered on 17 Aug 2011, 09:55 PM
Hello Raj,

I'm not sure what should I do with the provided code-snippets and what is the relation between the initial problem and the posted excerpts.
Can you please isolate the problem in a simple, runnable project and then submit it via the support ticket system so that we can debug it locally?
Isolating a problem in a sample project

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Rajz
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Rajz
Top achievements
Rank 1
Share this question
or