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

Row Color

Hi, guys! 

Is it possible to change a grid alternating row color using Syncfusion Xamarin.Forms library?


3 Replies

PK Prasanth Karthikeyan Syncfusion Team October 23, 2015 01:33 PM UTC

Hi StanBav,


Thank you for using Syncfusion products.


At present there is no support for AlternativeRowStyle in SfDataGrid, however we consider your requirement as a Feature request. A support incident to track the status of this feature has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 


Please let me know if you have any question.

Regards,
Prasanth



ST StanBav November 3, 2015 01:22 PM UTC

Thanks a lot, Prasanth!

I have some more questions :
Still using your SfDataGrid for Xamarin.Forms. We've faced some problems :
 - overriding DataGridStyle's method GetBordercolor() doesn't act in any result for iOS. Still borders are visible. Is it possible to hide/remove/change color for borders in another way ?
 - Is it possible to show multiline text in header?


PK Prasanth Karthikeyan Syncfusion Team November 5, 2015 07:30 AM UTC

Hi StanBav,

We have analysed your queries. Regarding your query about GetBordercolor() not working for iOS in Xamarin.Forms, we are able to reproduce the reported issue from our side. We have created an issue report on this and fixed it. The fix will be included in our upcoming Volume 3, SP 2 release by the end of November 2015.

Regarding your query about showing multiline text in the header, yes it is possible to show multiline text in the header in SfDataGrid. You can use the HeaderTemplate property in the GridColumn using which you can load a label and set its LineBreakMode property to WordWrap to wrap the text to the next line. You can use the SfDataGrid.HeaderRowHeight property to customize the header row height based on your text. Please refer the below code example.



                                                                              

<sfGrid:SfDataGrid  x:Name="dataGrid"

                    ItemsSource="{Binding OrdersInfo}"

                    HeaderRowHeight="70"

<sfGrid:SfDataGrid.Columns x:TypeArguments="sfgrid:Columns">      

  <sfGrid:GridTextColumn MappingName="PatientName">

    <sfGrid:GridTextColumn.HeaderTemplate>

      <DataTemplate>

        <Label x:Name="PatientName" Text="Demo For Multi line Text in header"

         TextColor="Black" VerticalOptions="Fill" YAlign="Center" Align="Center" LineBreakMode="WordWrap />                                        

       </DataTemplate>

      </sfGrid:GridTextColumn.HeaderTemplate>

    </sfGrid:GridTextColumn>

</sfGrid:SfDataGrid.Columns


</sfGrid:SfDataGrid>
 




We have prepared a sample based on this and you can download the same from the below location.

Sample link: http://www.syncfusion.com/downloads/support/forum/120854/ze/SampleDemo-509548582

Regards,
Prasanth



Loader.
Live Chat Icon For mobile
Up arrow icon