如何从gridview到文本框获取价值? [英] How do I take value from a gridview to a textbox?
本文介绍了如何从gridview到文本框获取价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在下面的代码中,我有一个gridview在弹出窗口中显示...当我选择一行时,我希望第一列显示在textbox1中..我该怎么做?
In my code below I have a gridview that shows in a popup window...when i seleect a row I want i want the first column to show up in textbox1 ..how do i do that?
<asp:ModalPopupExtender ID="mpe" runat="server" BehaviorID="popup1" PopupControlID="pnlPopup" TargetControlID="btnloccode"
OkControlID="btnOK" CancelControlID="btnCancel" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none">
<div class="header">
List Selection
</div>
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" align="left">
<ContentTemplate>
<asp:Panel runat="server" ID="pnl1" Style="max-height: 300px; overflow-y: scroll;">
<asp:GridView ID="LocationGridView" HeaderStyle-BackColor="#0066CC" HeaderStyle-ForeColor="White"
runat="server" AutoGenerateColumns="false" DataSourceID="SQLlistsel" OnDataBound="OnDataBound" Width="580">
<Columns>
<asp:BoundField DataField="LOCATIONID" HeaderText="Id" ItemStyle-Width="10">
<ItemStyle Width="10px"/>
</asp:BoundField>
<asp:BoundField DataField="LOCNM" HeaderText="Name" ItemStyle-Width="100" >
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="STATUS" HeaderText="Status" ItemStyle-Width="100" >
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<HeaderStyle BackColor="#0066CC" ForeColor="White" />
</asp:GridView>
</asp:Panel>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="Scripts/quicksearch.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('.search_textbox').each(function (i) {
$(this).quicksearch("[id*=LocationGridView] tr:not(:has(th))", {
'testQuery': function (query, txt, row) {
return $(row).children(":eq(" + i + ")").text().toLowerCase().indexOf(query[0].toLowerCase()) != -1;
}
});
});
});
</script>
推荐答案
(function(){
(function () {
('.search_textbox').each(function(i){
('.search_textbox').each(function (i) {
(this).quicksearch("[id * = LocationGridView] tr:not(:has(th))",{ 'testQuery':函数(查询,txt,行){ 返回
(this).quicksearch("[id*=LocationGridView] tr:not(:has(th))", { 'testQuery': function (query, txt, row) { return
这篇关于如何从gridview到文本框获取价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文