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

Resizing row

9 Answers 611 Views
GridView
This is a migrated thread and some comments may be shown as answers.
acola
Top achievements
Rank 1
acola asked on 18 Jul 2007, 05:35 PM
Hello -

I have one of my gridview columns set to wrap text. What I would like to see happen is that when the text wraps in a row, the row resizes itself to show all the text. However, it isn't doing that, so my text in the column that wrapped is all scrunched up. Is there a way to tell the grid to either resize the rows where the text in a column has wrapped, or at least, set each row to be 2 rows high?

9 Answers, 1 is accepted

Sort by
0
Phi
Top achievements
Rank 1
answered on 18 Jul 2007, 11:49 PM
Hi,

I also agree this would be a good idea. Column text wrapping is much more useful if you can see all the text in the cell. Maybe something like AutoRowHeight feature would be useful.

acomes:
You can set double the Row height by listening to the RowFormatting event of the RadGridView.

this.radGridView1.RowFormatting += new Telerik.WinControls.UI.RowFormattingEventHandler(this.radGridView1_RowFormatting);  
 
private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)  
{  
   e.RowElement.RowInfo.Height *= 2;  
 
But is there a way to auto-size the row height?

Cheers
Phi
0
Jack
Telerik team
answered on 19 Jul 2007, 08:30 AM
Hi guys,

Phi, thank you for the workaround, indeed it will get things done. Anne, we will suggest using the work around that Phi has posted.

But the idea of auto resizing columns is definitely good and I have logged it for the next release. Thank you very much for the feature request.

I have added Telerik points to your accounts for the suggestion.

 
All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brandon
Top achievements
Rank 1
answered on 20 Mar 2008, 03:20 PM
Jack,

Could you confirm whether or not the auto row resize feature will be included in the next release?  We would like to use this as well.  If that can't be done, another useful feature would be to show the text that is cut off in a little tooltip after you hover the cell that contains too much text to be viewed at one time.

Thanks,
Brandon
0
Jack
Telerik team
answered on 21 Mar 2008, 01:20 PM
Hi Brandon,

Thank you for this question.

Yes, I confirm that the row auto-sizing feature will be introduced in our upcoming release Q1 2008. We will also consider implementing automatic tooltips as you suggested.

Let me know, if you have other questions.

Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 03 May 2008, 07:00 PM
How does one accomplish the automatic row sizing with multiline and auto-wrapped text in the Q1 2008 release?  I do not see anything obvious on either the RadGridView or GridViewTextBoxColumn.

Thanks.
0
Jack
Telerik team
answered on 07 May 2008, 11:23 AM
Hi Bob,

Thank you for writing.

You should set the AutoSizeRows property of RadGridView to true in order to turn on the automatic row sizing. To enable column wrapping, set the WrapText property of GridViewColumn to true.

Consider the following code sample:

this.radGridView1.AutoSizeRows = true
this.radGridView1.Columns["Description"].WrapText = true
 

I hope this helps. Please let us know whether that lets you achive the desired functionality. Do not hesitate to write me, if you have other questions.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Niloofar
Top achievements
Rank 1
answered on 25 Mar 2015, 01:38 PM
Hi, 
I have changed rows height but after changing height, the height of the editor which is inside cell is not changed as shown in the attached file. is there any way to fit the editor in the cell after changing the row height?

cheers
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Mar 2015, 08:08 AM
Hello Niloofar,

Thank you for writing.

It is necessary to set the RadTextBoxEditor.Multiline property to true in order to stretch the editor and fill the entire row's height:
public Form1()
{
    InitializeComponent();
    this.radGridView1.AutoSizeRows = true;
    this.radGridView1.Columns["Description"].WrapText = true;
    this.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
}
 
private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
    RadTextBoxEditor tbEditor = e.ActiveEditor as  RadTextBoxEditor;
    if (tbEditor != null)
    {
        tbEditor.Multiline = true;
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Niloofar
Top achievements
Rank 1
answered on 30 Mar 2015, 12:38 PM
Thank you for the solution, it works fine!

Cheers,
Tags
GridView
Asked by
acola
Top achievements
Rank 1
Answers by
Phi
Top achievements
Rank 1
Jack
Telerik team
Brandon
Top achievements
Rank 1
Bob
Top achievements
Rank 1
Niloofar
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or