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

How to auto display dot dot dot value and full header text?

3 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stanley
Top achievements
Rank 1
Stanley asked on 24 May 2012, 04:08 AM
Please refer the picture from attachment.

Question 1 : How to auto display dot dot dot value when mouse over?
Question 2 : How to auto display full header text when user manually adjust the header size to smaller?

Is possible can be done in telerik?

3 Answers, 1 is accepted

Sort by
0
Smith
Top achievements
Rank 1
answered on 24 May 2012, 07:06 AM
Hi Stanley,

for question#1, you can set WrapText = true

example:
radGridViewTextBoxColumn1.WrapText = true;
0
Stanley
Top achievements
Rank 1
answered on 24 May 2012, 07:23 AM
Hi Smith,

Thank you.
But your suggestion cannot work.
0
Accepted
Boryana
Telerik team
answered on 28 May 2012, 12:35 PM
Hello,

Thank you for writing.

@Stanley: Regarding your first question, have you set any tooltips at all? Here is the code that enables tooltips and sets the displayed text to the Value of the cell:
private void radGridView1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
{
    GridDataCellElement dataCell = sender as GridDataCellElement;            
    if (dataCell != null)
    {
        e.ToolTipText = dataCell.Value.ToString();       
    }
}

There are two options to resolve the second question:

1. As Smith Lo suggested, set the TextWrap property of the column.
2. Subscribe to the ViewCellFormatting event of RadGridView and set the TextWrap property only of the header cells. Here is a sample snippet:
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridHeaderCellElement)
    {
        e.CellElement.TextWrap = true;
    }
}

Attached is a screenshot of the result. 

I hope this helps. Write back if you have further queries.

Regards,
Boryana
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Stanley
Top achievements
Rank 1
Answers by
Smith
Top achievements
Rank 1
Stanley
Top achievements
Rank 1
Boryana
Telerik team
Share this question
or