Esempio n. 1
0
        private void ProviderDataBind(HtmlTable tblProviders, object item, Dictionary <ItemCollectionAttribute, PropertyInfo> properties, bool showCheckers)
        {
            List <HtmlTableCell> rowCells = new List <HtmlTableCell>();

            foreach (var attr in properties.Keys)
            {
                object obj   = properties[attr].GetValue(item, null);
                string value = HttpContext.Current.Server.HtmlEncode(obj != null ? obj.ToString() : String.Empty);
                if (attr.IsId)
                {
                    if (showCheckers)
                    {
                        // Checkbox for every item, presented in the table
                        rowCells.Add(CheckItemCell(value));
                    }
                }
                else
                {
                    LayoutFactory.DrawContent(value, attr, rowCells);
                }
            }
            HtmlTableRow tblRow = new HtmlTableRow();

            rowCells.ForEach(cell => tblRow.Cells.Add(cell));
            tblProviders.Rows.Add(tblRow);
        }