Terminal.Gui.TableView.ColumnStyle.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class TableView.ColumnStyle
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class TableView.ColumnStyle
  11. ">
  12. <meta name="generator" content="docfx 2.59.3.0">
  13. <link rel="shortcut icon" href="../../favicon.ico">
  14. <link rel="stylesheet" href="../../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../../styles/docfx.css">
  16. <link rel="stylesheet" href="../../styles/main.css">
  17. <link href="https://fonts.googleapis.com/css?family=Source Sans Pro" rel="stylesheet">
  18. <link href="https://fonts.googleapis.com/css?family=Source Code Pro" rel="stylesheet">
  19. <meta property="docfx:navrel" content="../../toc.html">
  20. <meta property="docfx:tocrel" content="toc.html">
  21. <meta property="docfx:rel" content="../../">
  22. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  23. <div id="wrapper">
  24. <header>
  25. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  26. <div class="container">
  27. <div class="navbar-header">
  28. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  29. <span class="sr-only">Toggle navigation</span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. </button>
  34. <a class="navbar-brand" href="../../index.html">
  35. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  36. </a>
  37. </div>
  38. <div class="collapse navbar-collapse" id="navbar">
  39. <form class="navbar-form navbar-right" role="search" id="search">
  40. <div class="form-group">
  41. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  42. </div>
  43. </form>
  44. </div>
  45. </div>
  46. </nav>
  47. <div class="subnav navbar navbar-default">
  48. <div class="container hide-when-search" id="breadcrumb">
  49. <ul class="breadcrumb">
  50. <li></li>
  51. </ul>
  52. </div>
  53. </div>
  54. </header>
  55. <div class="container body-content">
  56. <div id="search-results">
  57. <div class="search-list">Search Results for <span></span></div>
  58. <div class="sr-items">
  59. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  60. </div>
  61. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  62. </div>
  63. </div>
  64. <div role="main" class="container body-content hide-when-search">
  65. <div class="sidenav hide-when-search">
  66. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  67. <div class="sidetoggle collapse" id="sidetoggle">
  68. <div id="sidetoc"></div>
  69. </div>
  70. </div>
  71. <div class="article row grid-right">
  72. <div class="col-md-10">
  73. <article class="content wrap" id="_content" data-uid="Terminal.Gui.TableView.ColumnStyle">
  74. <h1 id="Terminal_Gui_TableView_ColumnStyle" data-uid="Terminal.Gui.TableView.ColumnStyle" class="text-break">Class TableView.ColumnStyle
  75. </h1>
  76. <div class="markdown level0 summary">
  77. Describes how to render a given column in a <a class="xref" href="Terminal.Gui.TableView.html">TableView</a> including <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_Alignment">Alignment</a>
  78. and textual representation of cells (e.g. date formats)
  79. <a href="https://migueldeicaza.github.io/gui.cs/articles/tableview.html">See TableView Deep Dive for more information</a>.
  80. </div>
  81. <div class="markdown level0 conceptual"></div>
  82. <div class="inheritance">
  83. <h5>Inheritance</h5>
  84. <div class="level0"><span class="xref">System.Object</span></div>
  85. <div class="level1"><span class="xref">TableView.ColumnStyle</span></div>
  86. </div>
  87. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  88. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  89. <h5 id="Terminal_Gui_TableView_ColumnStyle_syntax">Syntax</h5>
  90. <div class="codewrapper">
  91. <pre><code class="lang-csharp hljs">public class ColumnStyle : Object</code></pre>
  92. </div>
  93. <h3 id="constructors">Constructors
  94. </h3>
  95. <a id="Terminal_Gui_TableView_ColumnStyle__ctor_" data-uid="Terminal.Gui.TableView.ColumnStyle.#ctor*"></a>
  96. <h4 id="Terminal_Gui_TableView_ColumnStyle__ctor" data-uid="Terminal.Gui.TableView.ColumnStyle.#ctor">ColumnStyle()</h4>
  97. <div class="markdown level1 summary"></div>
  98. <div class="markdown level1 conceptual"></div>
  99. <h5 class="decalaration">Declaration</h5>
  100. <div class="codewrapper">
  101. <pre><code class="lang-csharp hljs">public ColumnStyle()</code></pre>
  102. </div>
  103. <h3 id="fields">Fields
  104. </h3>
  105. <h4 id="Terminal_Gui_TableView_ColumnStyle_AlignmentGetter" data-uid="Terminal.Gui.TableView.ColumnStyle.AlignmentGetter">AlignmentGetter</h4>
  106. <div class="markdown level1 summary">
  107. Defines a delegate for returning custom alignment per cell based on cell values. When specified this will override <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_Alignment">Alignment</a>
  108. </div>
  109. <div class="markdown level1 conceptual"></div>
  110. <h5 class="decalaration">Declaration</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public Func&lt;object, TextAlignment&gt; AlignmentGetter</code></pre>
  113. </div>
  114. <h5 class="fieldValue">Field Value</h5>
  115. <table class="table table-bordered table-striped table-condensed">
  116. <thead>
  117. <tr>
  118. <th>Type</th>
  119. <th>Description</th>
  120. </tr>
  121. </thead>
  122. <tbody>
  123. <tr>
  124. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Object</span>, <a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a>&gt;</td>
  125. <td></td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <h4 id="Terminal_Gui_TableView_ColumnStyle_ColorGetter" data-uid="Terminal.Gui.TableView.ColumnStyle.ColorGetter">ColorGetter</h4>
  130. <div class="markdown level1 summary">
  131. Defines a delegate for returning a custom color scheme per cell based on cell values.
  132. Return null for the default
  133. </div>
  134. <div class="markdown level1 conceptual"></div>
  135. <h5 class="decalaration">Declaration</h5>
  136. <div class="codewrapper">
  137. <pre><code class="lang-csharp hljs">public TableView.CellColorGetterDelegate ColorGetter</code></pre>
  138. </div>
  139. <h5 class="fieldValue">Field Value</h5>
  140. <table class="table table-bordered table-striped table-condensed">
  141. <thead>
  142. <tr>
  143. <th>Type</th>
  144. <th>Description</th>
  145. </tr>
  146. </thead>
  147. <tbody>
  148. <tr>
  149. <td><a class="xref" href="Terminal.Gui.TableView.CellColorGetterDelegate.html">TableView.CellColorGetterDelegate</a></td>
  150. <td></td>
  151. </tr>
  152. </tbody>
  153. </table>
  154. <h4 id="Terminal_Gui_TableView_ColumnStyle_RepresentationGetter" data-uid="Terminal.Gui.TableView.ColumnStyle.RepresentationGetter">RepresentationGetter</h4>
  155. <div class="markdown level1 summary">
  156. Defines a delegate for returning custom representations of cell values. If not set then <span class="xref">System.Object.ToString</span> is used. Return values from your delegate may be truncated e.g. based on <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_MaxWidth">MaxWidth</a>
  157. </div>
  158. <div class="markdown level1 conceptual"></div>
  159. <h5 class="decalaration">Declaration</h5>
  160. <div class="codewrapper">
  161. <pre><code class="lang-csharp hljs">public Func&lt;object, string&gt; RepresentationGetter</code></pre>
  162. </div>
  163. <h5 class="fieldValue">Field Value</h5>
  164. <table class="table table-bordered table-striped table-condensed">
  165. <thead>
  166. <tr>
  167. <th>Type</th>
  168. <th>Description</th>
  169. </tr>
  170. </thead>
  171. <tbody>
  172. <tr>
  173. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Object</span>, <span class="xref">System.String</span>&gt;</td>
  174. <td></td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. <h3 id="properties">Properties
  179. </h3>
  180. <a id="Terminal_Gui_TableView_ColumnStyle_Alignment_" data-uid="Terminal.Gui.TableView.ColumnStyle.Alignment*"></a>
  181. <h4 id="Terminal_Gui_TableView_ColumnStyle_Alignment" data-uid="Terminal.Gui.TableView.ColumnStyle.Alignment">Alignment</h4>
  182. <div class="markdown level1 summary">
  183. Defines the default alignment for all values rendered in this column. For custom alignment based on cell contents use <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_AlignmentGetter">AlignmentGetter</a>.
  184. </div>
  185. <div class="markdown level1 conceptual"></div>
  186. <h5 class="decalaration">Declaration</h5>
  187. <div class="codewrapper">
  188. <pre><code class="lang-csharp hljs">public TextAlignment Alignment { get; set; }</code></pre>
  189. </div>
  190. <h5 class="propertyValue">Property Value</h5>
  191. <table class="table table-bordered table-striped table-condensed">
  192. <thead>
  193. <tr>
  194. <th>Type</th>
  195. <th>Description</th>
  196. </tr>
  197. </thead>
  198. <tbody>
  199. <tr>
  200. <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
  201. <td></td>
  202. </tr>
  203. </tbody>
  204. </table>
  205. <a id="Terminal_Gui_TableView_ColumnStyle_Format_" data-uid="Terminal.Gui.TableView.ColumnStyle.Format*"></a>
  206. <h4 id="Terminal_Gui_TableView_ColumnStyle_Format" data-uid="Terminal.Gui.TableView.ColumnStyle.Format">Format</h4>
  207. <div class="markdown level1 summary">
  208. Defines the format for values e.g. &quot;yyyy-MM-dd&quot; for dates
  209. </div>
  210. <div class="markdown level1 conceptual"></div>
  211. <h5 class="decalaration">Declaration</h5>
  212. <div class="codewrapper">
  213. <pre><code class="lang-csharp hljs">public string Format { get; set; }</code></pre>
  214. </div>
  215. <h5 class="propertyValue">Property Value</h5>
  216. <table class="table table-bordered table-striped table-condensed">
  217. <thead>
  218. <tr>
  219. <th>Type</th>
  220. <th>Description</th>
  221. </tr>
  222. </thead>
  223. <tbody>
  224. <tr>
  225. <td><span class="xref">System.String</span></td>
  226. <td></td>
  227. </tr>
  228. </tbody>
  229. </table>
  230. <a id="Terminal_Gui_TableView_ColumnStyle_MaxWidth_" data-uid="Terminal.Gui.TableView.ColumnStyle.MaxWidth*"></a>
  231. <h4 id="Terminal_Gui_TableView_ColumnStyle_MaxWidth" data-uid="Terminal.Gui.TableView.ColumnStyle.MaxWidth">MaxWidth</h4>
  232. <div class="markdown level1 summary">
  233. Set the maximum width of the column in characters. This value will be ignored if more than the tables <a class="xref" href="Terminal.Gui.TableView.html#Terminal_Gui_TableView_MaxCellWidth">MaxCellWidth</a>. Defaults to <a class="xref" href="Terminal.Gui.TableView.html#Terminal_Gui_TableView_DefaultMaxCellWidth">DefaultMaxCellWidth</a>
  234. </div>
  235. <div class="markdown level1 conceptual"></div>
  236. <h5 class="decalaration">Declaration</h5>
  237. <div class="codewrapper">
  238. <pre><code class="lang-csharp hljs">public int MaxWidth { get; set; }</code></pre>
  239. </div>
  240. <h5 class="propertyValue">Property Value</h5>
  241. <table class="table table-bordered table-striped table-condensed">
  242. <thead>
  243. <tr>
  244. <th>Type</th>
  245. <th>Description</th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <tr>
  250. <td><span class="xref">System.Int32</span></td>
  251. <td></td>
  252. </tr>
  253. </tbody>
  254. </table>
  255. <a id="Terminal_Gui_TableView_ColumnStyle_MinAcceptableWidth_" data-uid="Terminal.Gui.TableView.ColumnStyle.MinAcceptableWidth*"></a>
  256. <h4 id="Terminal_Gui_TableView_ColumnStyle_MinAcceptableWidth" data-uid="Terminal.Gui.TableView.ColumnStyle.MinAcceptableWidth">MinAcceptableWidth</h4>
  257. <div class="markdown level1 summary">
  258. Enables flexible sizing of this column based on available screen space to render into.
  259. </div>
  260. <div class="markdown level1 conceptual"></div>
  261. <h5 class="decalaration">Declaration</h5>
  262. <div class="codewrapper">
  263. <pre><code class="lang-csharp hljs">public int MinAcceptableWidth { get; set; }</code></pre>
  264. </div>
  265. <h5 class="propertyValue">Property Value</h5>
  266. <table class="table table-bordered table-striped table-condensed">
  267. <thead>
  268. <tr>
  269. <th>Type</th>
  270. <th>Description</th>
  271. </tr>
  272. </thead>
  273. <tbody>
  274. <tr>
  275. <td><span class="xref">System.Int32</span></td>
  276. <td></td>
  277. </tr>
  278. </tbody>
  279. </table>
  280. <a id="Terminal_Gui_TableView_ColumnStyle_MinWidth_" data-uid="Terminal.Gui.TableView.ColumnStyle.MinWidth*"></a>
  281. <h4 id="Terminal_Gui_TableView_ColumnStyle_MinWidth" data-uid="Terminal.Gui.TableView.ColumnStyle.MinWidth">MinWidth</h4>
  282. <div class="markdown level1 summary">
  283. Set the minimum width of the column in characters. Setting this will ensure that
  284. even when a column has short content/header it still fills a given width of the control.
  285. <p>This value will be ignored if more than the tables <a class="xref" href="Terminal.Gui.TableView.html#Terminal_Gui_TableView_MaxCellWidth">MaxCellWidth</a>
  286. or the <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_MaxWidth">MaxWidth</a>
  287. </p>
  288. <remarks>
  289. For setting a flexible column width (down to a lower limit) use <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_MinAcceptableWidth">MinAcceptableWidth</a>
  290. instead
  291. </remarks>
  292. </div>
  293. <div class="markdown level1 conceptual"></div>
  294. <h5 class="decalaration">Declaration</h5>
  295. <div class="codewrapper">
  296. <pre><code class="lang-csharp hljs">public int MinWidth { get; set; }</code></pre>
  297. </div>
  298. <h5 class="propertyValue">Property Value</h5>
  299. <table class="table table-bordered table-striped table-condensed">
  300. <thead>
  301. <tr>
  302. <th>Type</th>
  303. <th>Description</th>
  304. </tr>
  305. </thead>
  306. <tbody>
  307. <tr>
  308. <td><span class="xref">System.Int32</span></td>
  309. <td></td>
  310. </tr>
  311. </tbody>
  312. </table>
  313. <h3 id="methods">Methods
  314. </h3>
  315. <a id="Terminal_Gui_TableView_ColumnStyle_GetAlignment_" data-uid="Terminal.Gui.TableView.ColumnStyle.GetAlignment*"></a>
  316. <h4 id="Terminal_Gui_TableView_ColumnStyle_GetAlignment_System_Object_" data-uid="Terminal.Gui.TableView.ColumnStyle.GetAlignment(System.Object)">GetAlignment(Object)</h4>
  317. <div class="markdown level1 summary">
  318. Returns the alignment for the cell based on <code data-dev-comment-type="paramref" class="paramref">cellValue</code> and <a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_AlignmentGetter">AlignmentGetter</a>/<a class="xref" href="Terminal.Gui.TableView.ColumnStyle.html#Terminal_Gui_TableView_ColumnStyle_Alignment">Alignment</a>
  319. </div>
  320. <div class="markdown level1 conceptual"></div>
  321. <h5 class="decalaration">Declaration</h5>
  322. <div class="codewrapper">
  323. <pre><code class="lang-csharp hljs">public TextAlignment GetAlignment(object cellValue)</code></pre>
  324. </div>
  325. <h5 class="parameters">Parameters</h5>
  326. <table class="table table-bordered table-striped table-condensed">
  327. <thead>
  328. <tr>
  329. <th>Type</th>
  330. <th>Name</th>
  331. <th>Description</th>
  332. </tr>
  333. </thead>
  334. <tbody>
  335. <tr>
  336. <td><span class="xref">System.Object</span></td>
  337. <td><span class="parametername">cellValue</span></td>
  338. <td></td>
  339. </tr>
  340. </tbody>
  341. </table>
  342. <h5 class="returns">Returns</h5>
  343. <table class="table table-bordered table-striped table-condensed">
  344. <thead>
  345. <tr>
  346. <th>Type</th>
  347. <th>Description</th>
  348. </tr>
  349. </thead>
  350. <tbody>
  351. <tr>
  352. <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
  353. <td></td>
  354. </tr>
  355. </tbody>
  356. </table>
  357. <a id="Terminal_Gui_TableView_ColumnStyle_GetRepresentation_" data-uid="Terminal.Gui.TableView.ColumnStyle.GetRepresentation*"></a>
  358. <h4 id="Terminal_Gui_TableView_ColumnStyle_GetRepresentation_System_Object_" data-uid="Terminal.Gui.TableView.ColumnStyle.GetRepresentation(System.Object)">GetRepresentation(Object)</h4>
  359. <div class="markdown level1 summary">
  360. Returns the full string to render (which may be truncated if too long) that the current style says best represents the given <code data-dev-comment-type="paramref" class="paramref">value</code>
  361. </div>
  362. <div class="markdown level1 conceptual"></div>
  363. <h5 class="decalaration">Declaration</h5>
  364. <div class="codewrapper">
  365. <pre><code class="lang-csharp hljs">public string GetRepresentation(object value)</code></pre>
  366. </div>
  367. <h5 class="parameters">Parameters</h5>
  368. <table class="table table-bordered table-striped table-condensed">
  369. <thead>
  370. <tr>
  371. <th>Type</th>
  372. <th>Name</th>
  373. <th>Description</th>
  374. </tr>
  375. </thead>
  376. <tbody>
  377. <tr>
  378. <td><span class="xref">System.Object</span></td>
  379. <td><span class="parametername">value</span></td>
  380. <td></td>
  381. </tr>
  382. </tbody>
  383. </table>
  384. <h5 class="returns">Returns</h5>
  385. <table class="table table-bordered table-striped table-condensed">
  386. <thead>
  387. <tr>
  388. <th>Type</th>
  389. <th>Description</th>
  390. </tr>
  391. </thead>
  392. <tbody>
  393. <tr>
  394. <td><span class="xref">System.String</span></td>
  395. <td></td>
  396. </tr>
  397. </tbody>
  398. </table>
  399. </article>
  400. </div>
  401. <div class="hidden-sm col-md-2" role="complementary">
  402. <div class="sideaffix">
  403. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  404. <h5>In This Article</h5>
  405. <div></div>
  406. </nav>
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. <footer>
  412. <div class="grad-bottom"></div>
  413. <div class="footer">
  414. <div class="container">
  415. <span class="pull-right">
  416. <a href="#top">Back to top</a>
  417. </span>
  418. <span>Generated by <strong>DocFX</strong></span>
  419. </div>
  420. </div>
  421. </footer>
  422. </div>
  423. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  424. <script type="text/javascript" src="../../styles/docfx.js"></script>
  425. <script type="text/javascript" src="../../styles/main.js"></script>
  426. </body>
  427. </html>