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
2275
TileLayoutOrder setting
posted

In C#, when I attempt to set TileLayoutOrder, I get an Object reference not set to an instance of an object error message.  I do this in either Window_Initialized or MainTiles_Initialized (MainTiles is the name of my xamTilesControl) and I get the error. 

However if I do it in Window_Loaded or MainTiles_Loaded, I don't get the error, but the value never applies.  The only way I can get this to work is by setting in the xaml file, but I want it in C#.

How do I do this?  I am following the documented example, and, nonetheless, I am getting an error.

Thanks,

Mike

Parents
No Data
Reply
  • 30945
    Verified Answer
    Offline posted

    Hello Mike,

     

    I have been looking into the issue that you have described and it seems that the reason for the exception that you are getting is that the NormalModeSettings object is null in the Initialized event of the XamTilesControl. You can use the following code line in order to set the TileLayoutOrder through the Initialized event:

     

     

    private void xamTilesControl1_Initialized(object sender, EventArgs e)
    {
        xamTilesControl1.NormalModeSettings 
            = new Infragistics.Windows.Tiles.NormalModeSettings
        {
            TileLayoutOrder = Infragistics.Windows.Tiles.TileLayoutOrder.Horizontal
        };
    }
    

     

     

    I have created a sample application that shows the described approach.

     

    If you need any further assistance please do not hesitate to ask.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    TileSettingsInCode.zip
Children