roipatrick
New member
- Joined
- Mar 19, 2014
- Messages
- 1
- Programming Experience
- 5-10
I only wanted to hide a row if startdate column of that row has this statement (startdate < presentdate). It deleted but only 1 row and I want to delete all rows if they have the statement (dtartdate < presentdate) is satisfied. But i always come accross errors. Please help me guys....I need this one desparately. Thank you in advance and i apologize for my english.
or if you can rephrase my whole code then thank you....Please help me guys...
C#:
void LoadSource() {
//string dateInString = Convert.ToString(Convert.ToDateTime(_dr[4]));
//string dateInString = Convert.ToString(Convert.ToDateTime(RaDate));
//DateTime startdate = DateTime.Parse(dateInString);
//DateTime datelimit = startdate.AddDays(90);
//int counter = 0;
_fd = new FinancialData();
if (cboType.SelectedIndex == 0) //&& DateTime.Now > datelimit)
grdDetails.DataSource = _fd.RetrievePayments();
DataTable _dtPayment = _fd.RetrievePayments();
if (grdDetails.DataSource == null)
{
MessageBox.Show("sample");
}
else
{
MessageBox.Show("smple");
}
string item = grdDetails[grdDetails.CurrentCell.ColumnIndex,
grdDetails.CurrentCell.RowIndex].Value.ToString();
if (item != null)
{
int di = 0;
int id = Convert.ToInt32(grdDetails[di, grdDetails.CurrentCell.RowIndex].Value);
foreach (DataRow _dr in _dtPayment.Rows)
{
var now = DateTime.Now;
if (DateTime.Parse(_dr[4].ToString()) < now)
{
this.grdDetails.Rows[id].Visible = false;
}
id++;
di++;
}
}
MessageBox.Show(grdDetails.DataSource);
else if (cboType.SelectedIndex == 1)// && DateTime.Now > datelimit)
grdDetails.DataSource = _fd.RetrieveRemittanceAdvices();
else
grdDetails.DataSource = null;
}
or if you can rephrase my whole code then thank you....Please help me guys...