public void SetRowCellValueDoesNotWorkOnReadOnlyCell() { var table = new DataTable(); table.Columns.Add("readonlycolumn", typeof(string)); table.Rows.Add(new object[] { "1" }); var tableView = new TableView { Data = table }; //read only cell tableView.ReadOnlyCellFilter += delegate { return true; }; tableView.SetRowCellValue(0, 0, "2"); Assert.AreEqual("1", tableView.GetRowCellValue(0, 0)); }
public void SortTableViewWhenSettingSortOrder() { var person = new List<Person> {new Person {Age = 12, Name = "Aaltje"}, new Person {Age = 11, Name = "Berend"}}; var tableView = new TableView { Data = person }; //first sort descending..the first value should be berend tableView.Columns[0].SortOrder = SortOrder.Descending; Assert.AreEqual("Berend", tableView.GetRowCellValue(0, 0)); //sort ascending..the first value should be aaltje tableView.Columns[0].SortOrder = SortOrder.Ascending; Assert.AreEqual("Aaltje", tableView.GetRowCellValue(0, 0)); }
public void SetRowCellValueDoesNotWorkOnReadOnlyColumns() { var table = new DataTable(); table.Columns.Add("readonlycolumn", typeof(string)); table.Rows.Add(new object[] { "1" }); var tableView = new TableView { Data = table}; //read only first column tableView.Columns[0].ReadOnly = true; tableView.SetRowCellValue(0,0,"2"); Assert.AreEqual("1",tableView.GetRowCellValue(0,0)); }