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
Violeta Popa
NA
137
161.2k
filter datagridview
Apr 7 2013 6:10 AM
Hello :) I have a column in my datagridview named perioada(datatype: string) which has values of this form: 10/3/2012-10/2/2013.
Then, I have two datetimepikers and I want to filter my dgv like this:
if perioada's values are 10/3/2012-
10/2/2013
11/3/2012-
11/2-2013
...
if dtp1's value is: 11/2/2012
and dtp2's value is: 11/3/2013
i want the dgv to show only the records where the second date(the bolded) is between 11/2/2012 and 11/3/2013. Hope it makes sense what i've explained.And i did sth like that:
politaGridView.DataSource = dataSet.Tables["obtine"].DefaultView;
int i = politaGridView.CurrentRow.Index;
string temp = politaGridView.Rows[i].Cells[6].Value.ToString();
string[] array = temp.Split('-');
DateTime date = DateTime.Parse(array[1]);
if (date >= dateTimePicker1.Value && date <= dateTimePicker2.Value)
{
//do what?
}
Reply
Answers (
1
)
The button on which user clicks
How to show data in gridview in asp.net.