We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Row Height in the Grid Control

Thread ID:

Created:

Updated:

Platform:

Replies:

104074 Jun 19,2012 04:04 PM UTC Jul 5,2012 11:43 AM UTC Silverlight 1
loading
Tags: GridControl
Ravindra Mamidipaka
Asked On June 19, 2012 04:04 PM UTC

Hello All,
  I am using Data Template to display an image in a cell in the Grid.. How do I set the height of the row so the whole image is displayed...

<syncfusion:GridDataControl Grid.Row="0"
                                                x:Name="chemistryGrid"
                                                ItemsSource="{Binding}"
                                                ColumnSizer="Star"
                                                AutoPopulateColumns="False"
                                                AutoPopulateRelations="False"
                                                AllowEdit="False"
                                                AllowDragColumns="True"
                                                VisualStyle="Office14Silver"
                                                ShowAddNewRow="False">
                    <syncfusion:GridDataControl.VisibleColumns>
                        <syncfusion:GridDataVisibleColumn MappingName="Phase" HeaderText="Phase" AllowFilter="True" AllowSort="True"/>
                        <syncfusion:GridDataVisibleColumn MappingName="Header" HeaderText="Cas Number" AllowFilter="True" AllowSort="True"/>
                        <syncfusion:GridDataVisibleColumn MappingName="ImageURL" HeaderText="Structure" AllowFilter="False" AllowSort="False">
                            <syncfusion:GridDataVisibleColumn.CellItemTemplate>
                                <DataTemplate>
                                        <Image Source="{Binding CellBoundValue}" Width="80" Height="80" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </DataTemplate>
                            </syncfusion:GridDataVisibleColumn.CellItemTemplate>
                        </syncfusion:GridDataVisibleColumn>
                        <syncfusion:GridDataVisibleColumn MappingName="CrossTargetsStrings" HeaderText="Cross Targets" AllowFilter="False" AllowSort="False"/>
                    </syncfusion:GridDataControl.VisibleColumns>
                </syncfusion:GridDataControl>


Thanks,
Ravi

Rajasekar [Syncfusion]
Replied On July 5, 2012 11:43 AM UTC

Hi Ravi,

 

You cannot predicate the number of controls and its size inside the DataTemplate cells, so we can’t set the height which fits all the controls in the DataTemplate cell of the particular cell. However, you can change the height of the Grid Rows by using the below code,

 

 this.dataGrid.Model.RowHeights[e.Style.RowIndex] = 100;

 

The above case can be done in the applied the GridDataControl.Loaded event by iterating the underlying collection values or Row/Column Index.

 

Please let us know if you have any queries.

 

Thanks,

Rajasekar


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;