@@ -8208,6 +8208,37 @@ public void IsMarkupString_Ok()
82088208 Assert . Equal ( "<div class=\" table-cell\" ><div>Address - Test</div></div>" , cells [ 1 ] . InnerHtml ) ;
82098209 }
82108210
8211+ [ Fact ]
8212+ public void IgnoreWhenExport_Ok ( )
8213+ {
8214+ var items = new Foo [ ] { new ( ) { Name = "Name" , Address = "Address" } } ;
8215+ var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
8216+ {
8217+ pb . AddChildContent < Table < Foo > > ( pb =>
8218+ {
8219+ pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
8220+ pb . Add ( a => a . Items , items ) ;
8221+ pb . Add ( a => a . TableColumns , foo => builder =>
8222+ {
8223+ builder . OpenComponent < TableColumn < Foo , string > > ( 0 ) ;
8224+ builder . AddAttribute ( 1 , "Field" , "Name" ) ;
8225+ builder . AddAttribute ( 2 , "FieldExpression" , Utility . GenerateValueExpression ( foo , "Name" , typeof ( string ) ) ) ;
8226+ builder . CloseComponent ( ) ;
8227+
8228+ builder . OpenComponent < TableColumn < Foo , string > > ( 0 ) ;
8229+ builder . AddAttribute ( 1 , "Field" , "Address" ) ;
8230+ builder . AddAttribute ( 2 , "FieldExpression" , Utility . GenerateValueExpression ( foo , "Address" , typeof ( string ) ) ) ;
8231+ builder . AddAttribute ( 3 , "IgnoreWhenExport" , true ) ;
8232+ builder . CloseComponent ( ) ;
8233+ } ) ;
8234+ } ) ;
8235+ } ) ;
8236+
8237+ var table = cut . FindComponent < Table < Foo > > ( ) ;
8238+ var columns = table . Instance . GetVisibleColumns ( ) ;
8239+ Assert . Single ( columns ) ;
8240+ }
8241+
82118242 [ Fact ]
82128243 public void OnSelectedRows_Ok ( )
82138244 {
0 commit comments