Yes, I guess that is pretty much a representation of what I am trying to
achieve.
Since I don't really use use declarative syntax for our circumstance,
however, when in the process of creating the control tree does this Eval get
evaluated?
(eg. at the time the cell is initialised or via a databinding operation?)
"Onwuka Emeka" <> wrote in message
news:%...
> Im not very sure i get your problem clearly, but wouldn't doing something
> like this solve your problem?
> <asp:CommandField ShowDeleteButton="True"
> Visible='<%#IsDeleteVisible(Eval("AProperty"))%>'> ' />
>
> <asp:CommandField ShowEditButton="True"
> Visible='<%#IsEditVisible(Eval("AProperty"))%>'/>
>
> where IsDeleteVisible and IsEditVisible are functions that takes a value
> of a property bound to your grid to determine if the button should show.
>
>
>
>
> "Kevin Frey" <> wrote in message
> news:%23y%...
>> Hello. I asked this question a while back and got no response, so I
>> thought I'd have another shot.
>>
>> When I display a list of records in a GridView, I want to be able to vary
>> the presence of the Edit and Delete buttons per row depending on eg. the
>> user's security permissions for that row, or attributes associated with
>> the
>> record (eg. a purchase order that has been dispatched to a supplier
>> cannot
>> be deleted).
>>
>> Can anyone tell me the correct method to go about this?
>>
>> The track I am currently taking is to build a specialised CommandField
>> object, and hiding the appropriate controls from within a data-binder.
>> I'm doing this so I don't have to reimplement much of CommandField
>> (InitializeCell specifically).
>>
>> Is there any easier way to achieve this? (To be honest the whole
>> data-binding strategy seems very circuitous at times for cases like
>> this).
>>
>
>
|