TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed sa
NA
289
129k
How to change statment to accept (= and like) in same time
Aug 26 2014 7:37 AM
Hi guys i make dynamic filter in datagridview but i face proplem
when i using to search for number as example
555 and inside id three values as 555,5555,55555 it give me three value
but actually there are one value found so that i need to use equal = with like statment in same time
are this possible my code as below:
private
void
searchgrid_TextChanged(
List
<
field
> fields)
System.Data.
DataView
dv = ((System.Data.
DataView
)dataGridView1.DataSource);
//
_textFilters =
""
;
//reset filters
bool
first =
true
;
//to handle the " and "
foreach
(
field
f
in
fields)
{
if
(f.Value.Length > 0)
//only if there is a value to filter for
{
if
(!first) _textFilters +=
" and "
;
_textFilters += f.Field +
" like '%"
+ f.Value +
"%'"
;
first =
false
;
}
}
dv.RowFilter = _textFilters;
this
.label1.Text = _textFilters;
}
Reply
Answers (
2
)
how to insert many rows in datagridview
lan