有沒有合併這兩列的方法?這就是我現在所擁有的 。這是我如何創建這兩列從代碼隱藏合併編輯和刪除Radgrid中的列
GridEditCommandColumn EditColumn = new GridEditCommandColumn();
this.RadGrid1.MasterTableView.Columns.Add(EditColumn);
EditColumn.ButtonType = GridButtonColumnType.ImageButton;
EditColumn.UniqueName = "EditCommandColumn";
EditColumn.HeaderText = "SingleAction";
EditColumn.ColumnGroupName = "test";
GridButtonColumn DeleteColumn = new GridButtonColumn();
this.RadGrid1.MasterTableView.Columns.Add(DeleteColumn);
DeleteColumn.CommandName = "Delete";
DeleteColumn.ButtonType = GridButtonColumnType.ImageButton;
DeleteColumn.UniqueName = "DeleteCommandColumn";
DeleteColumn.ConfirmDialogType = GridConfirmDialogType.Classic;
DeleteColumn.HeaderText = "SingleAction";
DeleteColumn.ConfirmText = "Do you really want to delete?";
現在我要實現這樣的 我試圖做GridCalculatedColumn這樣
GridCalculatedColumn calcol = new GridCalculatedColumn();
calcol.DataFields =new string[]{"EditCommandColumn","DeleteCommandColumn"};
calcol.Expression ="{0}-{1}";
tableViewProjects.Columns.Add(calcol);
但是,我無法達到我想要的。我得到一個錯誤列[EditCommandColumn]不存在,我認爲這是有道理的,因爲它不是數據庫中的數據字段。 那麼,有沒有辦法做到這一點。
請幫幫忙, 預先感謝您