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
Unable to bind DataGridView
Jan 27 2015 12:33 AM
Hi,
I am creating a Windows Application. I am unable to Bind DataGridView. I am using the following code to bind DataGrid. The code does not show any error but every time I try to bind DataGrid, it does not display any value.
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");
}
}
Kindly let me know what is the error in the above code.
Thank you.
Reply
Answers (
5
)
Timer Control.
User controls in windows application.