如何将texbox中的数据链接到gridview / table? [英] How to link data from texbox to gridview/table?

查看:54
本文介绍了如何将texbox中的数据链接到gridview / table?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试寻找示例或指南,设置以下功能,如下所述:



我有网络应用程序,我在哪里显示文字描述(例如数据),例如下面的一个:

I am trying to look for example or guide, into setting up the following functionality, as explained below:

I have web application, where I am displaying text description(e.g. of data) such as one below:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Aenean arcu nunc, luctus vitae sodales vitae, tag1 quis sem. 
Integer nisl leo, iaculis vel mi ac, sagittis tag2 nisi. 
Suspendisse volutpat blandit nisi, eget pulvinar sem lobortis quis. 





在描述文本框中,我有一些我希望表示为链接的数据,链接到表格,显示相应的数据单击时的记录(粗体和带下划线的文本),如下所示:



In the description textbox, i have certain data which i would like to be represented as links, which link to table, showing corresponding data records, when clicked on (bold & underlined text), such as shown below:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Aenean arcu nunc, luctus vitae sodales vitae, tag1 quis sem. Integer nisl leo, iaculis vel mi ac, sagittis tag2 nisi. 
Suspendisse volutpat blandit nisi, eget pulvinar sem lobortis quis. 





点击tag1,会显示表格,显示tag1详细信息:



clicked on tag1, would lead to table, showing tag1 details:

Name	Value	SSC
Tag1	45	TL45
Tag1	15	YH56



我想知道,我需要为此任务创建什么样的SQL查询我可以考虑用什么方法或属性来实现这个任务。



请帮助。感谢您的时间和帮助。


I would like to know, what kind of sql queries i need to create for this task and what methods or properties, i could look into for implementing this task.

Please help. Thank you for your time and help.

推荐答案

您应该查看RichTextBox,此控件可以处理链接。



我发现这个项目可能会回答你的一些初步问题。



与RichTextBox中的任意文本链接 [ ^ ]



关于SQL查询你需要,我不知道你不知道你的数据库结构。

基本上你可以使用 DataAdapter填充 DataTable

DataAdapter类 [ ^ ]



如果在数据表中有一个名为Name的列,你可以做类似这样的事情。在链接后面的代码中单击。

You should look into RichTextBox, this control can handle links.

I found this project that probably answers some of your initial questions.

Links with arbitrary text in a RichTextBox[^]

Regarding the SQL query you need, I can't answer that without knowing your database structure.
Basically you could fill a DataTable using a DataAdapter
DataAdapter Class[^]

If you have a column called 'Name' in the datatable you can do something like this is in the code behind the link click.
// Assuming you have a datatable called dtTagInfo that has been created beforehand.
DataRow dr = dataTable.Select(String.Format("Name = '{0}'", tagFromRichTextBox)).FirstOrDefault();
if (dr != null)
{
   // Present the information
}


请参阅此示例,单击按钮时会弹出一个网格视图,您可以将其更改为On Click of Link。我认为这对你有用。



http://aj-learning.com/blog/show-gridview-popup-window-asp-net/ [ ^ ]
See this Example, This has a grid view pop up on click Button, you can change it to On Click of Link. I think this will useful for you.

http://aj-learning.com/blog/show-gridview-popup-window-asp-net/[^]


这篇关于如何将texbox中的数据链接到gridview / table?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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