2014-01-30 21 views
0

我在Telerik RadListView中動態添加按鈕。但按鈕不包裝文本。文字環繞Telerik RadButtonElement不工作

這裏是我的代碼:

this.radBtnProduct = new RadButtonElement(); 

this.radBtnProduct.TextElement.Size = new Size(100,60); // .TextWrap = true; 
this.radBtnProduct.Location = new Point(0, 0); 
this.radBtnProduct.MinSize = new Size(100, 60); 
this.radBtnProduct.MinSize = new Size(100, 60); 
// wrapping 
this.radBtnProduct.TextWrap = true; 

任何幫助表示讚賞

編輯:

我用這個代碼

this.radBtnProduct.Text = this.dataItem.Text.Replace(" ", "\n"); 

但如果有一些問題我不知道用它

回答

0

默認情況下,RadButtonElement的AutoSize打開。您需要關閉它才能使您的尺寸正常工作。試試這個:

this.radBtnProduct = new RadButtonElement(); 
    this.radBtnProduct.AutoSize = false; 
    this.radBtnProduct.Size = new Size(100, 60); // .TextWrap = true; 
    this.radBtnProduct.TextWrap = true;