Ejemplo n.º 1
0
        private void QyeryCellInfo(object sender, GridQueryCellInfoEventArgs e)
        {
            var CurrentNod = this.AssociatedObject.InternalGrid.GetNodeAtRowIndex(e.Cell.RowIndex);
            var curCell    = this.AssociatedObject.InternalGrid.CurrentCell;

            if (CurrentNod != null)
            {
                if (CurrentNod.Item is ITreeNode)
                {
                    if ((CurrentNod.Item as ITreeNode).IsGroup)
                    {
                        e.Style.Font = new GridFontInfo {
                            FontWeight = System.Windows.FontWeights.SemiBold
                        };
                        if (e.Cell.ColumnIndex == 1)
                        {
                            e.Style.Foreground  = Brushes.Black;
                            e.Style.ShowTooltip = true;
                        }
                    }
                }
                if (CurrentNod.Item is MenuRight)
                {
                    if (e.Cell.ColumnIndex > 2 && this.AssociatedObject.Columns.Count >= e.Cell.ColumnIndex)
                    {
                        FormMenu fm  = (CurrentNod.Item as MenuRight).AppMenu;
                        byte     val = (byte)fm.GetType().GetProperty(this.AssociatedObject.Columns[e.Cell.ColumnIndex - 1].MappingName).GetValue(fm);
                        if (val == 0)
                        {
                            e.Style.CellItemTemplate = e.Style.CellEditTemplate = this.AssociatedObject.FindResource("EmptyTemplate") as DataTemplate;
                        }
                    }
                }
            }
        }