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
475
Cell Template
posted

Hi,

Suppose I have a XAMGrid with two columns: Type and Value, is there a way to assign a different template for each value depending on the type?

Example:

https://ibb.co/enGVLk

Currently, the columns are being created programatically and are always 'TextColumn' like this:

foreach (var columnInfo in _currentViewmodel.BrowserSettings.ColumnsInfo)
{

     var templateColumn = new TextColumn
    {
           Key = "NodeColumns[" + columnInfo.NodePropertyName + "].Value",
           MinimumWidth = columnInfo.Width,
           Width = new ColumnWidth(columnInfo.MaxWidth,false),
           HeaderText = columnInfo.Name,
    };


    BrowserPaneGrid.BrowserPaneXamGrid.Columns.Add(templateColumn);
}

Would need a way to do it by 'Cell' and not per 'Column' basis.

Thanks,

Erika

Parents
  • 2155
    Verified Answer
    Offline posted

    Hello Erika,

    In order to show a different template on each row, I suggest you create a DataTemplate that uses DataTrigger to switch its content and assign it to TemplateColumn's ItemTemplate.

    I have attached the demo sample.

    Please let me know if I may be of further assistance.

    Thank you,
    Mihoko Kamiishi

    CASE-183859.zip
Reply Children