Declined
Last Updated: 16 Feb 2022 05:23 by ADMIN
alex
Created on: 15 Feb 2022 09:55
Category: GridView
Type: Feature Request
0
New option in TextImageRelation

Hi. it was great to see the option "ImageOnly", for columns of small width, where only the image is placed in the header, and the "HederText" property was set, for the correct display of the grouping field

GridViewDataColumn column;

column.HeaderText = "Счет";

column.HeaderImage = ...; // some img

column.TextImageRelation = TextImageRelation.Overlay;



GridViewDataColumn column;

column.HeaderText = "";

column.HeaderImage = ...; // some img

column.TextImageRelation = TextImageRelation.Overlay;

it’s impossible to choose one thing, either an ugly header, or a grouping without a description

3 comments
alex
Posted on: 15 Feb 2022 16:17
yes, thx. its all i need
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 15 Feb 2022 15:01
Hello, Alex,    

It is possible to achieve image only display style in the header cells via the ViewCellFormatting event. I have prepared a sample code snippet for your reference: 
        public RadForm1()
        {
            InitializeComponent();
            this.radGridView1.ViewCellFormatting += radGridView1_ViewCellFormatting;
            GridViewTextBoxColumn contactNameColumn = this.radGridView1.Columns["ContactName"] as GridViewTextBoxColumn;
            contactNameColumn.HeaderImage = Properties.Resources.AnneDodsworth22;
            this.radGridView1.MasterTemplate.ShowGroupedColumns = true;
        }

        private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        {
            if (e.Row is GridViewTableHeaderRowInfo && e.Column.Name == "ContactName")
            {
                e.CellElement.DrawText = false;
            }
            else
            {
                e.CellElement.ResetValue(LightVisualElement.DrawTextProperty, ValueResetFlags.Local);
            }
        }

Please give it a try and see how it works on your end.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

alex
Posted on: 15 Feb 2022 10:11
forgot to add, it's all in RadGridview