Exemplo n.º 1
0
 /// <summary>
 /// Binds the column template properties.
 /// </summary>
 /// <param name="template">The template.</param>
 /// <param name="node">The node.</param>
 private void BindColumnTemplateProperties(object template, ViewColumnTemplate node)
 {
     // Bind all attributes
     foreach (string key in node.Attributes.Keys)
     {
         ReflectionHelper.BindProperty(template, key, node.Attributes[key]);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Binds the column properties.
 /// </summary>
 /// <param name="column">The column.</param>
 /// <param name="node">The node.</param>
 private void BindColumnProperties(GridColumn column, ViewColumn node)
 {
     // Bind all attributes
     foreach (string key in node.Attributes.Keys)
     {
         if (String.Compare(key, ViewColumn._HeadingTextAttributeName, false) == 0)
         {
             ReflectionHelper.BindProperty(column, key, node.GetLocalizedHeadingString());
         }
         else
         {
             ReflectionHelper.BindProperty(column, key, node.Attributes[key]);
         }
     }
 }
Exemplo n.º 3
0
            /// <summary>
            /// When implemented by a class, defines the <see cref="T:System.Web.UI.Control"/> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
            /// </summary>
            /// <param name="container">The <see cref="T:System.Web.UI.Control"/> object to contain the instances of controls from the inline template.</param>
            public void InstantiateIn(Control container)
            {
                string url = String.Empty;

                if (_columnTemplate.ControlUrl.StartsWith("~"))
                {
                    url = _columnTemplate.ControlUrl;
                }
                else
                {
                    url = String.Format("~/apps/{0}/{1}", _ModuleName, _columnTemplate.ControlUrl);
                }

                Control ctrl = _parent.LoadControl(url);

                // Bind all attributes
                foreach (string key in _columnTemplate.Attributes.Keys)
                {
                    ReflectionHelper.BindProperty(ctrl, key, _columnTemplate.Attributes[key]);
                }

                container.Controls.Add(ctrl);
            }