Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
How to make xamdatagrid`s all cell equally by one settings?
posted

<igDP:Field  Name="two">
          <igDP:Field.Settings>
           <igDP:FieldSettings CellValuePresenterStyle="{StaticResource MaintenanceIndicatorStyle}"
/>
          </igDP:Field.Settings>
         </igDP:Field>

         <igDP:Field  Name="three">
          <igDP:Field.Settings>
           <igDP:FieldSettings CellValuePresenterStyle="{StaticResource MaintenanceIndicatorStyle}"
/>
          </igDP:Field.Settings>
         </igDP:Field>

         <igDP:Field  Name="four">
          <igDP:Field.Settings>
           <igDP:FieldSettings CellValuePresenterStyle="{StaticResource MaintenanceIndicatorStyle}"
/>
          </igDP:Field.Settings>
         </igDP:Field>

 

above, field was set respectively. How to make xamdatagrid`s all cell equally by one settings? and in code behind can be setting?

  • 2125
    posted

    Hi,

     

    I  suggest  you the following (as prerequisites):

     

    1.       Go to  http://es.infragistics.com/dotnet/netadvantage/wpfdownloads.aspx page  ;

     

    2.    Download and  install  the  NetAdvantage for WPF 2008 Vol. 1  product ;

      

    There are so many  properties on the  FieldSettings class that it would be very  inconvenient  for you  to have to set  them all on every  Field object.  Let me offer  you  two possible solutions.

     

    Solution  1 If  an individual  Field object has no explicit value for a property on its Field settings, the value for that property resolves to  the  FieldSettings  on the  Field Layout.

    All Fields related to a particular type of data record  can therefore share the same Fields settings at the level  of their Field Layout.

     

    Look in  NetAdvantage for WPF xamFeatureBrowser ->xamDataGrid->Layout and Behavior-> FieldSettings Overrides sample

     

    In the FieldSettings  Overrides  sample  focus on the part below . I have made  some changes  to correspond to your  XAML  snippet:

                <igDP:FieldLayout Key="Category">

            <igDP:FieldLayout.FieldSettings>

            <igDP:FieldSettings CellValuePresenterStyle=

                 "{StaticResource  MaintenanceIndicatorStyle}"/>                        

            </igDP:FieldLayout.FieldSettings> 

     <igDP:FieldLayout.Fields>

       <igDP:Field Name="two"/>

       <igDP:Field Name="three"/>

       <igDP:Field Name="four"/>

     </igDP:FieldLayout.Fields>

     

           </igDP:FieldLayout> 

         

          Solution 2 -  Simply create a new Style which targets the CellValuePresenter control and use the ControlTemplate to gain

               the   complete control over the visual aspect of the cells. Look in  NetAdvantage for WPF xamFeatureBrowser ->

                   xamDataGrid->Themes and Custom Styles->  Custom CellValuePresenter  Style – Advanced  sample   

               to  see the implementation of the   solution .

     

                Best  Regards,                            Yanko