您好,登錄后才能下訂單哦!
DataGrid的Header風(fēng)格(按比例顯示列、居中顯示)已講解,但并不能使得DataGrid的內(nèi)容居中顯示。其他暫未用到,列使用DataGridTextColumn顯示文字時(shí),可添加表格元素風(fēng)格,設(shè)置文字居中顯示。
列DataGridTextColumn被選中時(shí),若點(diǎn)擊其他地方,可自定義設(shè)置DataGrid的非活動(dòng)狀態(tài)顏色風(fēng)格。
<!-- DataGridTextColumn 文字居中 -->
<Style x:Key="CenterAlignmentStyle" TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
2、選中時(shí)失去活動(dòng)狀態(tài)顏色設(shè)置
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。