Exemplo n.º 1
0
        protected void radgrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            Entities.User u = GetCurrentUser();
            u.GetPermissions();
            if (u.ChekPermission(Permissions.WaterPointReadOnly.ToString()))
            {
                if (e.Item.OwnerTableView.Name == "WP" || e.Item.OwnerTableView.Name == "Service" || e.Item.OwnerTableView.Name == "Event")
                {
                    if (e.Item is GridDataItem)
                    {
                        GridDataItem dataItem = e.Item as GridDataItem;

                        dataItem["EditCommandColumn"].Visible = false;// Controls[0] as ImageButton).Visible = false;
                    }
                }
            }



            //Задаём ширину для дропдауна в режиме редактирования
            if (e.Item.OwnerTableView.Name == "Works")
            {
                if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
                {
                    GridEditableItem item  = (GridEditableItem)e.Item;
                    RadComboBox      combo = (RadComboBox)item["WorkType"].Controls[0];
                    combo.Width = Unit.Pixel(500);
                }
            }
        }
Exemplo n.º 2
0
 protected void radgrid_ItemCreated(object sender, GridItemEventArgs e)
 {
     Entities.User u = GetCurrentUser();
     u.GetPermissions();
     if (u.ChekPermission(Permissions.WaterPointReadOnly.ToString()))
     {
         e.Item.OwnerTableView.CommandItemDisplay = GridCommandItemDisplay.None;
     }
 }