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. Image for the cookie policy date
close icon

How to remove COLUMN and ROW seperator lines

Is it possible to remove column and Row lines using customlayout?  

4 Replies

EM Emil February 17, 2017 01:37 AM UTC

here is how my datagrid looks like

<sfgrid:SfDataGrid ScrollingMode="PixelLine"
                          x:Name="dataGrid"
                          IsEnabled="True"
                          AutoGenerateColumns="False"
                          AllowSorting="True"
                          AllowDraggingColumn="False"
                          AllowDraggingRow="True"
                          ColumnSizer="Star"
                          RowHeight="80"
                          MaxSwipeOffset="180"
                          AllowSwiping="True"
                          GridTapped="dataGrid_GridTapped"
                          SelectionMode="Single"   ItemsSource="{Binding  OrdersInfo}"
                          SelectedItem="{Binding SelectedItem}">
          <sfgrid:SfDataGrid.HeaderRowHeight>
            <OnPlatform Android="40"
                                  WinPhone="50"
                                  iOS="40"
                                  x:TypeArguments="x:Double" />
          </sfgrid:SfDataGrid.HeaderRowHeight>
          <sfgrid:SfDataGrid.Columns x:TypeArguments="sfgrid:Columns">


            <sfgrid:GridTemplateColumn HeaderFontAttribute="Bold"
                                   HeaderText="Customer Name"
                                   MappingName="FirstName">
              <sfgrid:GridTemplateColumn.HeaderCellTextSize>
                <OnIdiom Phone="12"
                         Tablet="15"
                         x:TypeArguments="x:Double" />
              </sfgrid:GridTemplateColumn.HeaderCellTextSize>
              <sfgrid:GridTemplateColumn.CellTemplate>
                <DataTemplate>
                  <Frame  OutlineColor="Silver" HasShadow="True" Margin="10,5" Padding="1">
                    <Grid ColumnSpacing="5" RowSpacing="5"   HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"  InputTransparent="True">
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="*"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                      </Grid.RowDefinitions>
                      
                      <Label   Margin="5,0" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" LineBreakMode="WordWrap" Text="test3" Style="{StaticResource NameStyle}"/>
                      <Label   Grid.Row="1" Grid.Column="1"  Text="test1" Style="{StaticResource lblStyle}"/>
                      <Label   Grid.Row="1" Grid.Column="2"  Text="test2" Style="{StaticResource lblStyle}"/>
                    </Grid>
                  </Frame>
                </DataTemplate>
              </sfgrid:GridTemplateColumn.CellTemplate>
            </sfgrid:GridTemplateColumn>

          </sfgrid:SfDataGrid.Columns> 

     
        </sfgrid:SfDataGrid>
    


SS Sivaraman Sivagurunathan Syncfusion Team February 17, 2017 12:59 PM UTC

Hi Emil Alipiev,

Thanks for contacting Syncfusion Support.
 

We have checked your query. You can achieve your requirement to hide the borders in SfDataGrid by writing a custom GridStyle class derived from DataGridStyle. You need to override the GetGridLinesVisbility method to remove the column and row separator lines.

 
public class CustomGridStyle : DataGridStyle 
{ 
    public CustomGridStyle() 
    { 
    } 
    public override GridLinesVisibility GetGridLinesVisibility() 
    { 
        return GridLinesVisibility.None; 
    } 
} 

We have prepared a sample based on your requirement and you can download the same from the below link.
 

Sample Link:
http://www.syncfusion.com/downloads/support/forum/128939/ze/Sample_Demo-2018589961 

Regards,
Sivaraman S
 



EM Emil February 18, 2017 02:04 AM UTC

awsome that works fine


AN Ashok N Syncfusion Team February 20, 2017 04:32 AM UTC

Hi Emil , 
 
Thanks for your reply. Please let us know if you require further assistance on this. 
 
Regards, 
Ashok 


Loader.
Live Chat Icon For mobile
Up arrow icon