示例#1
0
        void InitializeGrid()
        {
            dataGridConfig = new DataGridConfig();

            foreach (var property in properties)
            {
                var attributes = property.GetCustomAttributes(true);

                foreach (Attribute attribute in attributes)
                {
                    var attributeType = attribute.GetType();

                    if (attributeType == typeof(ReadOnlyPropertyAttribute))
                    {
                        dataGridConfig.AddReadOnlyColumnName(property.Name);
                    }
                    else if (attributeType == typeof(InvisiblePropertyAttribute))
                    {
                        dataGridConfig.AddInvisibleColumnName(property.Name);
                    }
                }
            }
        }
        void InitializeGrid()
        {
            dataGridConfig = new DataGridConfig();

            foreach (var property in properties)
            {
                var attributes = property.GetCustomAttributes(true);

                foreach (Attribute attribute in attributes)
                {
                    var attributeType = attribute.GetType();

                    if (attributeType == typeof(ReadOnlyPropertyAttribute))
                        dataGridConfig.AddReadOnlyColumnName(property.Name);
                    else if (attributeType == typeof(InvisiblePropertyAttribute))
                        dataGridConfig.AddInvisibleColumnName(property.Name);
                }
            }
        }