hi,
i am doing a project which is window based.
in my datagridview i have five fields.
1.Volume of File 2.DateOfOpening 3.DateOfClosing 4.DateOfDestroy and 5.Status which is a combobox.
Within this combobox i have three items i.e Active,Closed and Destroyed.
when the user selects Active from the combobox,only the datetime picker of DateOfOpening should pop up and others should not pop up.
when user selects Destroy from the combobox,only datetime picker of DateOfClosing should pop Up and vice versa.
i have am opening the datetime picker but cant do with these conditions.this is my coding below:
int _colIndex = e.ColumnIndex;
string _colName = null;
_colName = dgFileDetails.Columns[_colIndex].Name;
CommonControls.IPicker objPicker = null;
if (BlCommon.ValidateColumnFordate(_colName))
{
objPicker = new CommonControls.DatePicker();
if (objPicker != null)
{
if (_colIndex == dgFileDetails.Columns[_colName].Index)
{
objPicker.ShowDialog();
if (objPicker.Tag != null)
{
dgFileDetails[_colName, e.RowIndex].Value = objPicker.Tag;
dgFileDetails[_colName, e.RowIndex].ReadOnly = true;
}
}
}
}
public static bool ValidateColumnFordate(string columnName)
{
string temp = columnName.Substring(0, 4);
if (temp.ToLower() == "date")
return true;
else
return false;
}