changing row height

4 posts, 0 answers
  1. andi
    andi avatar
    34 posts
    Member since:
    Jan 2008

    Posted 29 Jan 2008 Link to this post

    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
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 30 Jan 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. santosh
    santosh avatar
    8 posts
    Member since:
    Mar 2008

    Posted 24 Mar 2008 Link to this post

    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

  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 24 Mar 2008 Link to this post

    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
Back to Top