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

changing row height

3 Answers 726 Views
GridView
This is a migrated thread and some comments may be shown as answers.
andi
Top achievements
Rank 1
andi asked on 29 Jan 2008, 03:51 PM
hi again,

how can i change the row height of the grid? is there a way to do this programmatically or maybe on clientsite?

thanks, andreas

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 30 Jan 2008, 08:48 AM
Hello Andy,

The row height in RadGridView can be set only manually. You can do this by modifying any existing theme through the Visual Style Builder or through code. The following code snippet demonstrates how to change the height of the header row and how to specify the height of all other rows:

DirectCast(Me.RadGridView1.GridElement, Telerik.WinControls.UI.GridTableElement).RowHeight = 55 
DirectCast(Me.RadGridView1.GridElement, Telerik.WinControls.UI.GridTableElement).TableHeaderHeight = 40 
 

It is possible also to change the height of a specific row. Consider the code snippet below:

AddHandler RadGridView1.RowFormatting, AddressOf RowFormatting 
Private Sub RowFormatting(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.RowFormattingEventArgs) 
    e.RowElement.RowInfo.Height = 30 
End Sub 
 

Don't hesitate to contact us if you have other questions.

All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
santosh
Top achievements
Rank 2
answered on 24 Mar 2008, 08:28 AM

Hi Telerik,
 
  my applicaiton throw excpetion   

   "An unhandled exception of type 'System.Reflection.' occurred in mscorlib.dll

   Additional information: Exception has been thrown by the target of an invocation."

  when  try to update row height in RadGridView in  RowFormatting handler.

     private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            e.RowElement.RowInfo.Height = 30;
        }
 

 is there other option to change the row height for RadGridview in design or in code?
 

   i am using
     1. Rad beta verison for winForms.
     2. .Net 2005
  

thanks,
Santosh kumar

0
Jack
Telerik team
answered on 24 Mar 2008, 12:24 PM
Hello santosh,

Thank you for reporting this issue.

To set the row height you can use the RowHeight property of the GridTableElement. Refer to the following code sample:

((GridTableElement)this.radGridView1.GridElement).RowHeight = 30; 

We could not reproduce the issue reported by you. We are not quite sure, if it is related directly with RadGridView, because RadGridView doesn't use reflection. Please open a support ticket and send us your application to help us investigate the causes further.

Do not hesitate to contact me, if you have other questions.

Regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
andi
Top achievements
Rank 1
Answers by
Jack
Telerik team
santosh
Top achievements
Rank 2
Share this question
or