我试图在textchanged事件下将文本框作为Rowfilter放置!
下面的代码用于GRID以获取相应的Reg_Number 或 Customer_Name在文本框中输入的代码!
wat的令人惊讶的事实是,这段代码直接采用了第二个论证
(即)
((DataTable)radGridView1.DataSource).DefaultView.RowFilter = "Reg_Number like '%" + radTextBoxControl1.Text + "%'";
试图改变线路,但不管我做了什么,它都会忽略第一个并取得第二个
我试图把AND放在一条线上,但是不行,请告诉我frnzz!
private void radTextBoxControl1_TextChanged(object sender, EventArgs e)
{
try
{
((DataTable)radGridView1.DataSource).DefaultView.RowFilter =
"Customer_Name like '%" + radTextBoxControl1.Text + "%'";
((DataTable)radGridView1.DataSource).DefaultView.RowFilter =
"Reg_Number like '%" + radTextBoxControl1.Text + "%'";
}
catch (Exception) { }
}
Run Code Online (Sandbox Code Playgroud) 基本上,我希望用户单击表格并编辑文本.
这是我跟随的Js小提琴:
http://jsfiddle.net/ddd3nick/ExA3j/22/
您可以在下面看到我放在一起的代码.我跟着一个JS小提琴,想到在我的页面中使用它.
当我双击单元格时没有任何反应,我不知道为什么不工作.
请帮助找到遗漏的东西!
<!DOCTYPE html>
<html>
<head>
<title>Table</title>
<script type="text/javascript">
$(function () {
$("td").dblclick(function () {
var OriginalContent = $(this).text();
$(this).addClass("cellEditing");
$(this).html("<input type='text' value='" + OriginalContent + "' />");
$(this).children().first().focus();
$(this).children().first().keypress(function (e) {
if (e.which == 13) {
var newContent = $(this).val();
$(this).parent().text(newContent);
$(this).parent().removeClass("cellEditing");
}
});
$(this).children().first().blur(function(){
$(this).parent().text(OriginalContent);
$(this).parent().removeClass("cellEditing");
});
$(this).find('input').dblclick(function(e){
e.stopPropagation();
});
});
});
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<table class="editableTable">
<thead>
<tr>
<th>Code</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>001</td>
<td>Shahid</td>
<td>shahid@ssiddique.info</td>
<td>012-234-2432</td> …Run Code Online (Sandbox Code Playgroud)