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

sgdategrid inside fragment

<LinearLayout
            p1:orientation="horizontal"
            p1:layout_height="match_parent"
            p1:id="@+id/layoutMainB"
            p1:weightSum="@integer/docsBLinearWeightSum"
            p1:paddingTop="@dimen/docsBLinearPaddingTop"
            p1:layout_width="match_parent">
            <GridLayout
                p1:id="@+id/layoutItemsB"
                style="@style/layoutItemsBStyle"
                p1:layout_height="wrap_content"
                p1:columnCount="4"
                p1:orientation="horizontal"
                p1:useDefaultMargins="false"
                p1:layout_marginRight="@dimen/docsBGridMargin"
                p1:layout_marginLeft="@dimen/docsBGridMargin"
                p1:layout_weight="@integer/docsBGridWeightSum">
                
...Here are Textview and Editext
             </<GridLayout>
...I like to load here as sfdatagrid. 
I tried to put a framelayout and load it from OnViewCreated (and also i tryied from OnCreateView) but the sfdatagrid appears without header columns and it seems not drawing correctly.
I also tried to add it in linear layout by setting new layoutparams with weight =1 and know the sfdatagrid appears correctly but not in the right position.

What im doing wrong? how can i use a sfdategrid inside fragment?

I forgot to mention tha the specific fragment used in viewpager
</<LinearLayout>

3 Replies

AN Ashok N Syncfusion Team September 23, 2016 12:18 PM UTC

Hi Manos,   
   
Thanks for contacting Syncfusion Support.   
   
We have checked your query and we were unable to reproduce issue. SfDataGrid have column header when we load SfDataGrid in framelayout and also SfDataGrid is layout in correct position when we set the LinearLayout.Weight = 1.  We have attached our tested sample in the sample link, please modify the same based on your requirement as it would be more helpful for us to proceed further.       
   
   
Regards,   
Ashok   



MA Manos September 23, 2016 02:27 PM UTC

I tried to load it dynamic inside fragment that hosts in viewpager. not from activity When i tried from activity it s work perfectly.
In example the line "SfDataGrid grid = FindViewById<SfDataGrid>(Resource.Id.main);" raise error about a constructor that its needed with parameters (Context context, global::Android.Util.IAttributeSet attrs) 
Where can i found the latest version?


AN Ashok N Syncfusion Team September 26, 2016 06:17 AM UTC

Hi Manos, 
 
We have prepared the sample by loading our SfDataGrid into ViewPager and SfDataGrid loaded properly. You can download the sample from the below location. 
 
Also you can get the our latest version of Xamarin Nuget (14.2.0.32) from the below link: 
 
Regards, 
Ashok  


Loader.
Live Chat Icon For mobile
Up arrow icon