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

GridBoundColumn ItemStyle

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 02 Oct 2013, 03:16 PM
Hi There

I have a problem with GridBoundColumn ItemStyle as it does not behave like GridBoundColumn HeaderStyle. I have made this simple class to provide my own inherited version og GridBoundColumn:

using System.Web.UI.WebControls;
using Telerik.Web.UI;

using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace LWTelerikGrid.Extenders.ColumnExtenders
{
    public class LWBooleanBoundColumn : GridBoundColumn
    {       
        public override TableItemStyle HeaderStyle
        {
            get
            {
                TableItemStyle tableitemstyle = base.HeaderStyle;
                tableitemstyle.HorizontalAlign = HorizontalAlign.Center;
                return tableitemstyle;
            }
        }
 
        public override TableItemStyle ItemStyle
        {
            get
            {
                TableItemStyle tableitemstyle = base.ItemStyle;
                tableitemstyle.HorizontalAlign = HorizontalAlign.Center;
                return tableitemstyle;
            }
        }
 
 
        public override bool AutoPostBackOnFilter
        {
            get
            {
                return true;
            }
        }
    }
}

I use the LWBooleanColumn like this:

<LWColumnExtenders:LWBooleanBoundColumn DataField="LicenseRequired" DataType="System.Boolean"
                                FilterControlAltText="Filter LicenseRequired column" HeaderText="LicenseRequired"
                                SortExpression="LicenseRequired" UniqueName="LicenseRequired">
</LWColumnExtenders:LWBooleanBoundColumn>

When I use the VS 210 debugger, I can see that the HeaderStyle property is activated, but the ItemStyle property is left untouched.

Why is that ?

Thanks in advance for any tips...

Thomas, Copenhagen.

1 Answer, 1 is accepted

Sort by
0
Venelin
Telerik team
answered on 07 Oct 2013, 10:06 AM
Hello Thomas,

Please note that we do not support extending the RadGrid fields and any handling of unexpected behavior is developer's responsibility.

Regards,
Venelin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Share this question
or