Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在UltraGrid中更改单元格内容_C#_.net_Infragistics_Ultrawingrid - Fatal编程技术网

C# 如何在UltraGrid中更改单元格内容

C# 如何在UltraGrid中更改单元格内容,c#,.net,infragistics,ultrawingrid,C#,.net,Infragistics,Ultrawingrid,如果金额单元格中的值被更新,我将尝试更改同级单元格(天)的值。问题是,我不知道如何访问day cell。这是我到目前为止所拥有的 private void UltraGridEdit_AfterCellUpdate(object sender, CellEventArgs e) { if(e.Cell.Column.PropertyDescriptor.DisplayName.Equals("Amount")) {

如果金额单元格中的值被更新,我将尝试更改同级单元格(天)的值。问题是,我不知道如何访问day cell。这是我到目前为止所拥有的

 private void UltraGridEdit_AfterCellUpdate(object sender, CellEventArgs e)
        {
            if(e.Cell.Column.PropertyDescriptor.DisplayName.Equals("Amount"))
            {
                UltraGridHsaContributionEdit.ActiveRow.Band.Columns["StartDate"].?

            }
        }

您可以通过UltraGridCell的Row属性访问同级单元格:

private void UltraGridEdit_AfterCellUpdate(object sender, CellEventArgs e)
{
  if(e.Cell.Column.Key == "Amount_Column_Key")
  {
    e.Cell.Row.Cells["StartDate"].Value = CalculateStartDateValue();
  }
}

private DateTime CalculateStartDateValue()
{
  // calculate start date value here
}
希望,这有帮助。

你试过这个吗

e.Cell.Row.Cells["StartDate"].Value = DateTime.Today; //or whatever your date is

这是我得到的解决方案,和你们两个都很相似

private void UltraGridEditAfterCellUpdate(object sender, CellEventArgs e)
            {
                if (e.Cell.Column.PropertyDescriptor.DisplayName.Equals("Amount"))
                {
                    UltraGridEdit.ActiveRow.Cells["StartDate"].Value = null;
                }
            }