Development/Winform

[Devexpress] CustomColumnDisplayText Event

Tiger Tom 2020. 2. 17. 17:57



//주의 : GetRowCellValue가 아니라, GetListSourceRowCellValue 함수를 호출

if (e.ListSourceRowIndex < 0) return;
if (e.Value == null || e.Value.ToString() == "") return;
GridView view = sender as GridView;
int rIdx = e.ListSourceRowIndex;

if (e.Column.FieldName.Equals("OVERDUE_DATE"))
{
    string strValue = view.GetListSourceRowCellValue(rIdx, view.Columns["STATUS"]) != null ? view.GetListSourceRowCellValue(rIdx, view.Columns["STATUS"]).ToString() :"";
    if (strValue.ToString().ToUpper().Contains("IMPLEMENTED") || strValue.ToString().ToUpper().Contains("ACCEPTED") || strValue.ToString().ToUpper().Contains("REJECTED") || strValue.ToString().ToUpper().Contains(""))
   {        
        if (Convert.ToInt32(e.Value)==0 || e.Value.ToString().Trim() == "0")
e.DisplayText = "";
    }
}