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

Icon in Header Row

5 Answers 305 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chet Musialowski
Top achievements
Rank 1
Chet Musialowski asked on 20 Dec 2011, 11:53 PM
Hello,

I'd like to put an image in the header row cell above the "current row indicator" column (see attached image).

I was able to do this while running the RadControls for WindForms demo application and using the RadControl Spy tool but need help in accessing the correct element in my code.

Thanks,
Chet

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Dec 2011, 03:13 PM
Hello Chet,

Thank you for writing. 

You can change the desired cell image by using the ViewCellFormatting event of RadGridView. The type of the cell that you want to customize is GridTableHeaderCellElement. Here is a code snippet:
void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    GridTableHeaderCellElement headerCell = e.CellElement as GridTableHeaderCellElement;
    if (headerCell != null)
    {
        headerCell.Image = Resources.img;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local);
    }
}

I hope that you find this information helpful. 
 
All the best,
Stefan
the Telerik team

Q3’11
of RadControls for WinForms is available for download (see what's new). Get it today.
0
Chet Musialowski
Top achievements
Rank 1
answered on 23 Dec 2011, 09:40 PM
Stefan,

That worked great !!!

Thanks,
Chet
0
Stefan
Telerik team
answered on 26 Dec 2011, 03:31 PM
Hello Chet,

I am glad that I could help. Should you have any other questions, do not hesitate to contact us.
 
Kind regards,
Stefan
the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Swaroop
Top achievements
Rank 1
answered on 20 Sep 2012, 06:12 AM
hi i want to display the row numbers on the left hand side as shown in the attachment how can i achieve this.
Thanking You
0
Stefan
Telerik team
answered on 24 Sep 2012, 04:52 PM
Hi Swaroop,

Thank you for writing.

Please refer to the following forum thread where you can find the answer to your question: http://www.telerik.com/community/forums/winforms/gridview/row-number-in-row-header-column.aspx.

In general, please try post questions in forum threads that are related to the initial subject of the thread. This way it will be easier for you, the users, to find the answers to your questions. If you cannot find a suitable thread to post your question, you can always start one.
 
Greetings,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Chet Musialowski
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Chet Musialowski
Top achievements
Rank 1
Swaroop
Top achievements
Rank 1
Share this question
or