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 ListAllOrganizationType = obj_OrganizationType.SelectAll();
string OrganizationNameSearch = cmb_OrganizationTypeName.Text.ToString().ToLower();
var ListOrganzaitionType = (List)(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(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.

Francis SusaimichaelRank #466 · 5.4K reputationPosted Jan 24, 2015, 12:36 AM EST
private void BindGridView()
{
List
string OrganizationNameSearch = cmb_OrganizationTypeName.Text.ToString().ToLower();
var ListOrganzaitionType = (List
if (ListOrganzaitionType.Count > 0)
{
gv_OrganizationType.DataSource = new List
// You missed out this line.
gv_OrganizationType.Databind();
}
else
{
MessageBox.Show("No Records Found", "Alert");
}
}
Harsh Jani33 reputationPosted Jan 26, 2015, 6:49 PM EST
This is a windows application, so I cannot use DataBind() method.