开发者

ASP.NET: Changing Gridview Properties Dynamically in Devexpress

I have a Gridview and RadioButtonList like this;

ASP.NET: Changing Gridview Properties Dynamically in Devexpress

As you can see my Gridview can Enable for Editing, and some columns are DropdownLis开发者_如何学JAVAt when editing. (also when it was bound)

ASP.NET: Changing Gridview Properties Dynamically in Devexpress

I have 2 radiobutton in my RadioButtonList. Görüntüleme (It means View) and Düzenleme (It means Edit).

What I want is, If Düzenleme selected, normal Gridview can bind. (I can do that.) If Görüntüleme selected, Gridview can't has EnableEdit and I want all columns should be normal column. (GridViewDataTextColumn) So, people can only view the gridview.

The point is,

How can I change Gridview's EnalbleEdit and all column changed to GridViewDataTextColumn?


I found the solution.

For ASP.NET Gridview

Just change

GridView1.AutoGenerateEditButton = False

For Devexpress ASPxGridview

Just change

(ASPxGridView.Columns["#"] as GridViewCommandColumn).EditButton.Visible = false

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜