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

Post Deleted?

5 Answers 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sean McConnell
Top achievements
Rank 1
Sean McConnell asked on 11 Mar 2008, 07:41 PM
...

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 Mar 2008, 02:56 PM
Hi Randall Kohltfarber,

Your post was not deleted, but it was moved into our support ticketing system. You can find the it in your Client.Net accout >> My Support Tickets. This will allow you to attach a sample application in order to help us to address any potential issue.

If you have additional questions, do not hesitate to contact me.

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sean McConnell
Top achievements
Rank 1
answered on 12 Mar 2008, 03:42 PM

Hello, thanks for the repsonse - sorry we are not too familiar with the support ticketing system so it was a surpise for us to see the item removed =)

I need to add that we are using the grouping functionality of the gridview, and changing the rowheight during the row_formatting event - each datarow does have the same height though.

Also this issue appears when the grid has just 1 or 2 too many rows, so it looks like something is slightly off in the calculation of the total row heights.

0
Accepted
Jack
Telerik team
answered on 12 Mar 2008, 05:31 PM
Hello Randall Kohltfarber,

There are three properties that control the height of the rows in RadGridView. These are the RowHeight, the GroupHeaderHeight and the TableHeaderHeight properties. You can access these properties through the GridElement property of the RadGridView. Refer to the following code snippet:

((GridTableElement)this.radGridView1.GridElement).TableHeaderHeight = 50; 

When processing the RowFormatting event and changing the row's height, you should use the Height property of the RowInfo. This is because the RadGridView uses virtualization of its elements and the rows are reused. The GridViewRowInfo contains the row's state. Take a look at the sample below:

void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e) 
    if ((int)e.RowElement.RowInfo.Cells[0].Value > 5 && 
        (int)e.RowElement.RowInfo.Cells[0].Value < 10) 
    { 
        e.RowElement.RowInfo.Height = 50; 
    } 

We could not reproduce issues related to row height calculation. Please, could you open a support ticket and send us a sample application that demonstrates this issue.

Do not hesitate to write me, if you need further assistance.

Regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sean McConnell
Top achievements
Rank 1
answered on 13 Mar 2008, 04:00 PM
Thanks for the help, we found that explicitly setting the RowHeight of the GridElement fixed the issue where scrollbars are not appearing - we had previously been setting the rowheight during the RowFormatting event.

We did notice a second issue - when setting the GroupHeaderHeight the header DOES change height, but the text within it does not use the 'middleleft' alignment set via the Theme, instead it seems to default to 'topleft'.

I am continuing to investigate our themefile to see if another property  is overriding this.

Thanks again.
0
Jack
Telerik team
answered on 13 Mar 2008, 04:59 PM
Hello Randall Kohltfarber,

In order to change the text alignment of the header cells, you should change the TextAlignment property of the GridHeaderCellElement.

It can be also set through code. I suggest using the HeaderTextAlignment property of the GridViewColumn class. Refer to the following code:

this.radGridView1.Columns[1].HeaderTextAlignment = ContentAlignment.MiddleLeft;  
 

I hope this helps. If there are other issues with your theme, I will be glad to help you.

Greetings,
Jack
the Telerik team

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