Specify design time binding context in a GridTemplateColumn












1















I'm working on a Xamarin.Forms project. In my xaml page, order to avoid "Cannot resolve property 'xxx'" warning, I've set a design-time data context.
In this page I have a SfDataGrid object.



In the following code snippet, the text property of the custom entry is binding to the Quantity field of a Part item. The Parts object is an ObservableCollection<Part>.



<xForms:SfDataGrid ItemsSource="{Binding Parts}" AutoGenerateColumns="false" Margin="0"
ScrollingMode="PixelLine"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<xForms:SfDataGrid.Columns>
<xForms:GridTextColumn MappingName="ProductName" HeaderText="Product"
HeaderTextAlignment="Start" ColumnSizer="Star"
TextAlignment="Start" Padding="5,0,5,0"/>
<!--#region Quantity column -->
<xForms:GridTemplateColumn MappingName="Quantity" HeaderText="Quantity"
HeaderTextAlignment="Center"
ColumnSizer="Auto" Padding="0" >
<xForms:GridTemplateColumn.CellTemplate>
<DataTemplate>
<controls:CustomEntry Text="{Binding Quantity, Mode=TwoWay,
Converter={StaticResource NullableDouble}}"
Keyboard="Numeric" HorizontalTextAlignment="Center"
VerticalOptions="End"/>
</DataTemplate>
</xForms:GridTemplateColumn.CellTemplate>
</xForms:GridTemplateColumn>
<!--#endregion -->
</xForms:SfDataGrid.Columns>
</xForms:SfDataGrid>


The warning is displayed under the Quantity word in Text={Binding Quantity, Mode...



What should I do to avoid the warning for the binding used in the cell templates?



Should I add a BindingContext="{d:DesignInstance models:Part}", or d:DataContext="{d:DesignInstance models:Part}" on each field ?










share|improve this question



























    1















    I'm working on a Xamarin.Forms project. In my xaml page, order to avoid "Cannot resolve property 'xxx'" warning, I've set a design-time data context.
    In this page I have a SfDataGrid object.



    In the following code snippet, the text property of the custom entry is binding to the Quantity field of a Part item. The Parts object is an ObservableCollection<Part>.



    <xForms:SfDataGrid ItemsSource="{Binding Parts}" AutoGenerateColumns="false" Margin="0"
    ScrollingMode="PixelLine"
    HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
    <xForms:SfDataGrid.Columns>
    <xForms:GridTextColumn MappingName="ProductName" HeaderText="Product"
    HeaderTextAlignment="Start" ColumnSizer="Star"
    TextAlignment="Start" Padding="5,0,5,0"/>
    <!--#region Quantity column -->
    <xForms:GridTemplateColumn MappingName="Quantity" HeaderText="Quantity"
    HeaderTextAlignment="Center"
    ColumnSizer="Auto" Padding="0" >
    <xForms:GridTemplateColumn.CellTemplate>
    <DataTemplate>
    <controls:CustomEntry Text="{Binding Quantity, Mode=TwoWay,
    Converter={StaticResource NullableDouble}}"
    Keyboard="Numeric" HorizontalTextAlignment="Center"
    VerticalOptions="End"/>
    </DataTemplate>
    </xForms:GridTemplateColumn.CellTemplate>
    </xForms:GridTemplateColumn>
    <!--#endregion -->
    </xForms:SfDataGrid.Columns>
    </xForms:SfDataGrid>


    The warning is displayed under the Quantity word in Text={Binding Quantity, Mode...



    What should I do to avoid the warning for the binding used in the cell templates?



    Should I add a BindingContext="{d:DesignInstance models:Part}", or d:DataContext="{d:DesignInstance models:Part}" on each field ?










    share|improve this question

























      1












      1








      1








      I'm working on a Xamarin.Forms project. In my xaml page, order to avoid "Cannot resolve property 'xxx'" warning, I've set a design-time data context.
      In this page I have a SfDataGrid object.



      In the following code snippet, the text property of the custom entry is binding to the Quantity field of a Part item. The Parts object is an ObservableCollection<Part>.



      <xForms:SfDataGrid ItemsSource="{Binding Parts}" AutoGenerateColumns="false" Margin="0"
      ScrollingMode="PixelLine"
      HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
      <xForms:SfDataGrid.Columns>
      <xForms:GridTextColumn MappingName="ProductName" HeaderText="Product"
      HeaderTextAlignment="Start" ColumnSizer="Star"
      TextAlignment="Start" Padding="5,0,5,0"/>
      <!--#region Quantity column -->
      <xForms:GridTemplateColumn MappingName="Quantity" HeaderText="Quantity"
      HeaderTextAlignment="Center"
      ColumnSizer="Auto" Padding="0" >
      <xForms:GridTemplateColumn.CellTemplate>
      <DataTemplate>
      <controls:CustomEntry Text="{Binding Quantity, Mode=TwoWay,
      Converter={StaticResource NullableDouble}}"
      Keyboard="Numeric" HorizontalTextAlignment="Center"
      VerticalOptions="End"/>
      </DataTemplate>
      </xForms:GridTemplateColumn.CellTemplate>
      </xForms:GridTemplateColumn>
      <!--#endregion -->
      </xForms:SfDataGrid.Columns>
      </xForms:SfDataGrid>


      The warning is displayed under the Quantity word in Text={Binding Quantity, Mode...



      What should I do to avoid the warning for the binding used in the cell templates?



      Should I add a BindingContext="{d:DesignInstance models:Part}", or d:DataContext="{d:DesignInstance models:Part}" on each field ?










      share|improve this question














      I'm working on a Xamarin.Forms project. In my xaml page, order to avoid "Cannot resolve property 'xxx'" warning, I've set a design-time data context.
      In this page I have a SfDataGrid object.



      In the following code snippet, the text property of the custom entry is binding to the Quantity field of a Part item. The Parts object is an ObservableCollection<Part>.



      <xForms:SfDataGrid ItemsSource="{Binding Parts}" AutoGenerateColumns="false" Margin="0"
      ScrollingMode="PixelLine"
      HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
      <xForms:SfDataGrid.Columns>
      <xForms:GridTextColumn MappingName="ProductName" HeaderText="Product"
      HeaderTextAlignment="Start" ColumnSizer="Star"
      TextAlignment="Start" Padding="5,0,5,0"/>
      <!--#region Quantity column -->
      <xForms:GridTemplateColumn MappingName="Quantity" HeaderText="Quantity"
      HeaderTextAlignment="Center"
      ColumnSizer="Auto" Padding="0" >
      <xForms:GridTemplateColumn.CellTemplate>
      <DataTemplate>
      <controls:CustomEntry Text="{Binding Quantity, Mode=TwoWay,
      Converter={StaticResource NullableDouble}}"
      Keyboard="Numeric" HorizontalTextAlignment="Center"
      VerticalOptions="End"/>
      </DataTemplate>
      </xForms:GridTemplateColumn.CellTemplate>
      </xForms:GridTemplateColumn>
      <!--#endregion -->
      </xForms:SfDataGrid.Columns>
      </xForms:SfDataGrid>


      The warning is displayed under the Quantity word in Text={Binding Quantity, Mode...



      What should I do to avoid the warning for the binding used in the cell templates?



      Should I add a BindingContext="{d:DesignInstance models:Part}", or d:DataContext="{d:DesignInstance models:Part}" on each field ?







      xamarin.forms syncfusion






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 13:17









      Crusty ApplesnifferCrusty Applesniffer

      347




      347
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Hi Crusty Applesniffer,



          Thanks for using Syncfusion Product.



          We have checked your query with following details.
          By using SfDataGrid have created the GridTemplateClolumn and added CustomEntry as DataTemplate in XAML page




          • Text property of this custom entry is binding to the double type
            property named as OrderId

          • We have set this Text property binding

          • Mode as TwoWay, And we have written the converter for this property.

          • And we have added the Xaml
            Complilation([XamlCompilation(XamlCompilationOptions.Compile)]) Tag in .cs of the XAML
            class file.


          But unfortunately, We are unable to reproduce the “Cannot resolve property 'xxx'" warning” from our side, So Kindly provide More details in order to reproduce the issue.




          • Have you enabled any Style Cop or FxCop rule set in your application
            ? If yes, Mention those rule set details.

          • Type of property you have used to bind the Custom Entry Text Property.

          • SfDataGrid product version that you are currently using.

          • If possible kindly provide us the Issue replicating sample or modify the attached sample to replicate the issue.
            We have prepared the sample as per your requirement, Do check and let us know Is there anything needs to add more to reproduce “Cannot resolve property 'xxx'" warning” issue.


          Sample Link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid-1806700714



          Regards,
          Vigneshkumar R






          share|improve this answer
























          • You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

            – Crusty Applesniffer
            Nov 16 '18 at 13:11













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320377%2fspecify-design-time-binding-context-in-a-gridtemplatecolumn%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Hi Crusty Applesniffer,



          Thanks for using Syncfusion Product.



          We have checked your query with following details.
          By using SfDataGrid have created the GridTemplateClolumn and added CustomEntry as DataTemplate in XAML page




          • Text property of this custom entry is binding to the double type
            property named as OrderId

          • We have set this Text property binding

          • Mode as TwoWay, And we have written the converter for this property.

          • And we have added the Xaml
            Complilation([XamlCompilation(XamlCompilationOptions.Compile)]) Tag in .cs of the XAML
            class file.


          But unfortunately, We are unable to reproduce the “Cannot resolve property 'xxx'" warning” from our side, So Kindly provide More details in order to reproduce the issue.




          • Have you enabled any Style Cop or FxCop rule set in your application
            ? If yes, Mention those rule set details.

          • Type of property you have used to bind the Custom Entry Text Property.

          • SfDataGrid product version that you are currently using.

          • If possible kindly provide us the Issue replicating sample or modify the attached sample to replicate the issue.
            We have prepared the sample as per your requirement, Do check and let us know Is there anything needs to add more to reproduce “Cannot resolve property 'xxx'" warning” issue.


          Sample Link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid-1806700714



          Regards,
          Vigneshkumar R






          share|improve this answer
























          • You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

            – Crusty Applesniffer
            Nov 16 '18 at 13:11


















          0














          Hi Crusty Applesniffer,



          Thanks for using Syncfusion Product.



          We have checked your query with following details.
          By using SfDataGrid have created the GridTemplateClolumn and added CustomEntry as DataTemplate in XAML page




          • Text property of this custom entry is binding to the double type
            property named as OrderId

          • We have set this Text property binding

          • Mode as TwoWay, And we have written the converter for this property.

          • And we have added the Xaml
            Complilation([XamlCompilation(XamlCompilationOptions.Compile)]) Tag in .cs of the XAML
            class file.


          But unfortunately, We are unable to reproduce the “Cannot resolve property 'xxx'" warning” from our side, So Kindly provide More details in order to reproduce the issue.




          • Have you enabled any Style Cop or FxCop rule set in your application
            ? If yes, Mention those rule set details.

          • Type of property you have used to bind the Custom Entry Text Property.

          • SfDataGrid product version that you are currently using.

          • If possible kindly provide us the Issue replicating sample or modify the attached sample to replicate the issue.
            We have prepared the sample as per your requirement, Do check and let us know Is there anything needs to add more to reproduce “Cannot resolve property 'xxx'" warning” issue.


          Sample Link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid-1806700714



          Regards,
          Vigneshkumar R






          share|improve this answer
























          • You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

            – Crusty Applesniffer
            Nov 16 '18 at 13:11
















          0












          0








          0







          Hi Crusty Applesniffer,



          Thanks for using Syncfusion Product.



          We have checked your query with following details.
          By using SfDataGrid have created the GridTemplateClolumn and added CustomEntry as DataTemplate in XAML page




          • Text property of this custom entry is binding to the double type
            property named as OrderId

          • We have set this Text property binding

          • Mode as TwoWay, And we have written the converter for this property.

          • And we have added the Xaml
            Complilation([XamlCompilation(XamlCompilationOptions.Compile)]) Tag in .cs of the XAML
            class file.


          But unfortunately, We are unable to reproduce the “Cannot resolve property 'xxx'" warning” from our side, So Kindly provide More details in order to reproduce the issue.




          • Have you enabled any Style Cop or FxCop rule set in your application
            ? If yes, Mention those rule set details.

          • Type of property you have used to bind the Custom Entry Text Property.

          • SfDataGrid product version that you are currently using.

          • If possible kindly provide us the Issue replicating sample or modify the attached sample to replicate the issue.
            We have prepared the sample as per your requirement, Do check and let us know Is there anything needs to add more to reproduce “Cannot resolve property 'xxx'" warning” issue.


          Sample Link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid-1806700714



          Regards,
          Vigneshkumar R






          share|improve this answer













          Hi Crusty Applesniffer,



          Thanks for using Syncfusion Product.



          We have checked your query with following details.
          By using SfDataGrid have created the GridTemplateClolumn and added CustomEntry as DataTemplate in XAML page




          • Text property of this custom entry is binding to the double type
            property named as OrderId

          • We have set this Text property binding

          • Mode as TwoWay, And we have written the converter for this property.

          • And we have added the Xaml
            Complilation([XamlCompilation(XamlCompilationOptions.Compile)]) Tag in .cs of the XAML
            class file.


          But unfortunately, We are unable to reproduce the “Cannot resolve property 'xxx'" warning” from our side, So Kindly provide More details in order to reproduce the issue.




          • Have you enabled any Style Cop or FxCop rule set in your application
            ? If yes, Mention those rule set details.

          • Type of property you have used to bind the Custom Entry Text Property.

          • SfDataGrid product version that you are currently using.

          • If possible kindly provide us the Issue replicating sample or modify the attached sample to replicate the issue.
            We have prepared the sample as per your requirement, Do check and let us know Is there anything needs to add more to reproduce “Cannot resolve property 'xxx'" warning” issue.


          Sample Link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid-1806700714



          Regards,
          Vigneshkumar R







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 16 '18 at 11:47









          Vignesh kumarVignesh kumar

          583




          583













          • You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

            – Crusty Applesniffer
            Nov 16 '18 at 13:11





















          • You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

            – Crusty Applesniffer
            Nov 16 '18 at 13:11



















          You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

          – Crusty Applesniffer
          Nov 16 '18 at 13:11







          You were right, "Cannot resolve property" was notified by Resharper (from JetBrain). I'll see this with JetBrain support. Thank you

          – Crusty Applesniffer
          Nov 16 '18 at 13:11






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320377%2fspecify-design-time-binding-context-in-a-gridtemplatecolumn%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Error while running script in elastic search , gateway timeout

          Adding quotations to stringified JSON object values