在网格视图中,需要在包含语句的单元格中使单词"bold". [英] in a grid view need to make a word 'bold' in a cell which contains statement.

查看:60
本文介绍了在网格视图中,需要在包含语句的单元格中使单词"bold".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个句子的网格视图.我可以在网格视图中为所有单元格加粗的句子中的一个单词吗?

下面的代码会将第一列的第一行中的文本设置为"Hello Ryan",并以粗体显示单词"Ryan".您只需将<b>放在要加粗的文本之前,并将</b>放在要加粗的文本的末尾.

GridView1.Rows[0].Cells[0].Text = "Hello <b>Ryan</b>";


I have a grid view which contains several sentences. can I make one word in a sentence bold for all the cells in a grid view

解决方案

Sure, you just need to include the bold tag to the text.

The below code will set the text in the first rows of the first column to "Hello Ryan", having the word "Ryan" in bold. You just need to put <b> in front of the text you want to be bold and you must put </b> at the end of the text that you want to be bold.

GridView1.Rows[0].Cells[0].Text = "Hello <b>Ryan</b>";


这篇关于在网格视图中,需要在包含语句的单元格中使单词"bold".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆