Hello, I`m making a program using Windows forms and I already built some codes, like this
1. Write a site url in Text Box then click Start Button, matched data showed in DataGridViews.
2. I have a 6 DataGridViews. In First DataGridView, matched data showed(step 1)
and then, other 5 DataGridviews will showed like cascade refer First DataGridView`s row`s
value(webApplicationName)
code is below
And Now I want to add this
1. Add Combobox and Add some conditions, for example, [Show all] and [See Over 100GB DB]
2. If I choose [See Over 100GB DB] option, in that DataGridView showed only matched rows.
3. It means, I want to filter Datagridview using Combobox Selection and Datasource is already
binded, so I want to do not change DataSource....
I try to find combobox and DataGridView, but usually related on Combobox in DataGridView....
And how can I get get first DataGridViews`s value(webApplicationName)
Please somebody help me.. I don`t have any idea...
Thanks
What I have tried:
private void mtbtnStart_Click(object sender, EventArgs e)
{
string webApplicationName = string.Empty;
string siteID = string.Empty;
mtlblError.Text = "No record returned.";
Migration_Status_DAC dac = new Migration_Status_DAC();
DataSet ds = new DataSet();
ds = dac.SelectWebApplicationStatus(mtextUrl.Text);
DataTable dt = ds.Tables[0];
if (ds != null && dt != null && dt.Rows.Count > 0)
{
webApplicationName = dt.Rows[0]["AppName"].ToString();
mgrdWebApplication.DataSource = dt;
ds = dac.SelectContentDatabaseStatus(webApplicationName);
DataTable dtContent = ds.Tables[0];
if (ds != null && dtContent != null && dtContent.Rows.Count > 0)
{
mtlblError.Visible = false;
mgrdContentDatabase.DataSource = dtContent;
ds = dac.SelectSiteCollectionStatus(webApplicationName);
DataTable dtSiteCol = ds.Tables[0];
if (ds != null && dtSiteCol != null && dtSiteCol.Rows.Count > 0)
{
mgrdSiteCollections.DataSource = dtSiteCol;
ds = dac.SelectSitesStatus(webApplicationName);
DataTable dtSites = ds.Tables[0];
if (ds != null && dtSites != null && dtSites.Rows.Count > 0)
{
siteID = dtSites.Rows[0]["SiteID"].ToString();
mgrdSites.DataSource = dtSites;
ds = dac.SelectListsStatus(siteID);
DataTable dtLists = ds.Tables[0];
if (ds != null && dtLists != null && dtLists.Rows.Count > 0)
{
mgrdLists.DataSource = dtLists;
}
ds = dac.SelectDocumentLibraryStatus(siteID);
DataTable dtDocLib = ds.Tables[0];
if (ds != null && dtDocLib != null && dtDocLib.Rows.Count > 0)
{
mgridDocumentLibrary.DataSource = dtDocLib;
}
}
else
{
mtlblError.Visible = true;
}
}
else
{
mtlblError.Visible = true;
}
}
else
{
mtlblError.Visible = true;
}
}
else
{
mgrdWebApplication.DataSource = null;
mgrdContentDatabase.DataSource = null;
mgrdSiteCollections.DataSource = null;
mgrdSites.DataSource = null;
mgrdLists.DataSource = null;
mgridDocumentLibrary.DataSource = null;
}
}