Exemplo n.º 1
0
        public void GetEmployeesAccessWebGridEx()
        {
            WebGridEx grid = new WebGridEx
            {
                DataSourceId  = "Employees",
                ID            = "test",
                RecordsPerRow = 2,
                Width         = Unit.Pixel(1000),
                Height        = Unit.Pixel(1500)
            };

            grid.PagerSettings.PagerType = PagerType.None;
            PlaceHolder helptext = new PlaceHolder();
            Label       label    = new Label {
                Text = "This is an test.."
            };

            helptext.Controls.Add(label);
            grid.HelpText         = helptext;
            grid.ConnectionString = ConnectionAccessOleDb;
            StringBuilder  sb         = new StringBuilder();
            StringWriter   sw         = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);

            grid.RenderControl(gridwriter);
            Assert.Greater(grid.MasterTable.Rows.Count, 1);
            Assert.AreNotSame(sb.ToString().IndexOf("is an test.."), -1);
        }
Exemplo n.º 2
0
 public void GetEmployeesAccessWebGridEx()
 {
     WebGridEx grid = new WebGridEx
     {
         DataSourceId = "Employees",
         ID = "test",
         RecordsPerRow = 2,
         Width = Unit.Pixel(1000),
         Height = Unit.Pixel(1500)
     };
     grid.PagerSettings.PagerType = PagerType.None;
     PlaceHolder helptext = new PlaceHolder();
     Label label = new Label { Text = "This is an test.." };
     helptext.Controls.Add(label);
     grid.HelpText = helptext;
     grid.ConnectionString = ConnectionAccessOleDb;
     StringBuilder sb = new StringBuilder();
     StringWriter sw = new StringWriter(sb);
     HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
     grid.RenderControl(gridwriter);
     Assert.Greater(grid.MasterTable.Rows.Count, 1);
     Assert.AreNotSame(sb.ToString().IndexOf("is an test.."), -1);
 }