如何更改或突出显示gridview单元格内的文本 [英] how to change or highlight text inside a gridview cell

查看:68
本文介绍了如何更改或突出显示gridview单元格内的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何突出显示或更改gridview单元格内文本的颜色?不改变整个单元格的背面或前面的颜色,而只改变单元格内的特定单词。这是为了让搜索结果对用户更加可见。

Does anyone know how to highlight or change the color of text inside a gridview cell? Not change the back or fore colors of the whole cell, but only for a particular word inside the cell. This is to make the search results more visible to the user.

推荐答案

OP自己解决了这个问题。发布它从未答复的列表中弹出。



OP发布以下内容:

已解决..只需将此代码添加到RowDataBound事件如果txtSearchCriteria.Text<> 然后lblRepExamProc.Text = lblRepExamProc.Text.Replace(txtSearchCriteria.Text,< span style =''background-color:Yellow''>& txtSearchCriteria.Text&< / span>)结束如果
OP resolved it himself. Posting it to pop it out of unanswered list.

OP Posted the following:
solved.. just add this code to RowDataBound event If txtSearchCriteria.Text <> "" Then lblRepExamProc.Text = lblRepExamProc.Text.Replace(txtSearchCriteria.Text, "<span style=''background-color:Yellow'' >" & txtSearchCriteria.Text & "</span>") End If


这篇关于如何更改或突出显示gridview单元格内的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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