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
Harsh Jani
NA
34
53.9k
Error while Binding DataGrid
Jan 24 2015 4:48 AM
Hi,
The DataGridView control is not displaying text. I am not getting any error, but I think I am not able to bind DataGrid properly. I have used the following code:
private void BindGridView()
{
List<OrganizationType> ListAllOrganizationType = obj_OrganizationType.SelectAll();
string OrganizationNameSearch = cmb_OrganizationTypeName.Text.ToString().ToLower();
var ListOrganzaitionType = (List<OrganizationType>)(from OrgType in ListAllOrganizationType where (OrganizationNameSearch == string.Empty ? true : (OrgType.TypeName.ToLower().Contains(OrganizationNameSearch))) select OrgType).ToList();
if (ListOrganzaitionType.Count > 0)
{
gv_OrganizationType.DataSource = new List<OrganizationType>(ListOrganzaitionType);
}
else
{
MessageBox.Show("No Records Found", "Alert");
}
}
SelectAll() is a method which fetches the list or Organization from the database.
Kindly let me know what is the error in this code.
Thank you.
Reply
Answers (
2
)
Navigation using Generic List
Timer Control.