2016-11-03 2 views
1

iamに別の値を追加します。私が尋ねたいのは、スケジューラーマッピング記述に別の値を追加する方法です。devexpressのスケジューラコントロールを使用して、スケジューラの説明

私はこのコード

  schedulerStorage1.Appointments.Mappings.Description = dt.Columns["description"].ToString() + dt.Columns["name"].ToString(); 
を使用して、マッピングの説明にIAM別の値を追加したいディスプレイがそこからこの

enter image description here

のようなものです

  schedulerStorage1.Resources.DataSource = dt; 
      schedulerControl1.Storage.Resources.DataSource = dt; 
      schedulerStorage1.Appointments.DataSource = dt; 

      schedulerStorage1.Appointments.Mappings.Start = dt.Columns["Start"].ToString(); 
      schedulerStorage1.Appointments.Mappings.End = dt.Columns["End"].ToString(); 
      schedulerStorage1.Appointments.Mappings.Subject = dt.Columns["Title"].ToString(); 
      schedulerStorage1.Appointments.Mappings.Description = dt.Columns["description"].ToString(); 

を使用したコード

ですが、説明の要素に何も表示されていませんグラム

enter image description here

+0

は、「名前」欄が中に存在しているあなたは確かですさそれを参照しようとすると例外がスローされないことを確認します。デバッガでコードを実行し、例外があるかどうかを確認します。 – andrews

+0

はい、私はかなり確かに、私はまた、 "タイトル"自体に何かを表示didntの列 "名前"を変更する – chopperfield

+0

デバッグがスムーズだったとき、何もエラーを与えませんでした – chopperfield

答えて

0

私は、このことによってそれを解決しています。最初

私は新しいカスタムマッピング

 this.schedulerStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("a", dt.Columns["name"].ToString())); 

を追加する必要があり、その後、私はそれは私が使用しているコードをschedulerControl1_InitAppointmentDisplayText割り当てる必要が

private void schedulerControl1_InitAppointmentDisplayText(object sender, AppointmentDisplayTextEventArgs e) 
    {     
    e.Description = e.ViewInfo.Appointment.Description + e.ViewInfo.Appointment.CustomFields["a"].ToString();    
    } 
関連する問題