示例#1
0
        public void TestGridSortHeaderRenderer()
        {
            var settings = new QueryStringSortSettings();
            var renderer = new QueryStringSortColumnHeaderRenderer(settings);

            var column = new GridColumn<TestModel, string>(c => c.Title, new TestGrid(Enumerable.Empty<TestModel>()));

            var htmlstring = renderer.Render(column);
            Assert.IsNotNull(htmlstring);
            var html = htmlstring.ToHtmlString();
            Assert.IsTrue(!html.Contains("<a"));
            Assert.IsTrue(html.Contains("<span"));

            column.Sortable(true);

            htmlstring = renderer.Render(column);
            Assert.IsNotNull(htmlstring);
            html = htmlstring.ToHtmlString();

            Assert.IsTrue(!string.IsNullOrWhiteSpace(html));
            Assert.IsTrue(html.Contains("<a"));

            Assert.IsTrue(html.Contains("class=\"grid-header-title\""));
        }
 public QueryStringSortColumnHeaderRenderer(QueryStringSortSettings settings)
 {
     _settings = settings;
 }
 public QueryStringSortColumnHeaderRenderer(QueryStringSortSettings settings)
 {
     _settings = settings;
 }
 public QueryStringGridSettingsProvider()
 {
     _sortSettings = new QueryStringSortSettings();
     //add additional header renderer for filterable columns:
     _filterSettings = new QueryStringFilterSettings();
 }