开发者

Problem with Type casting while setting edit mode for radgrid

开发者 https://www.devze.com 2023-03-24 07:21 出处:网络
I have The following code to set the edit mode for Radgrid based on condition but i am getting error saying cannot implcitly convert bool to telerik.web.ui.grideditmode

I have The following code to set the edit mode for Radgrid based on condition but i am getting error saying cannot implcitly convert bool to telerik.web.ui.grideditmode

My Code is

bool EditPrivilege = this.Privilige.CanModify;
 this.FileAdminRadGrid.MasterTableView.Ed开发者_运维问答itMode = EditPrivilege


Error says clearly what is wrong. EditMode is not of type bool. But You try to assign EditPrivilege of type bool to it.


Looks like you are trying to define EditPrivilege as a boolean when it should be of the Telerik type EditMode/Privilige.

Have you tried (something like):

Privilige EditPrivilege = this.Privilige.CanModify; this.FileAdminRadGrid.MasterTableView.EditMode = EditPrivilege

0

精彩评论

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