Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Disabling Link Button Column in Datagrid

Reply
Thread Tools

Disabling Link Button Column in Datagrid

 
 
=?Utf-8?B?cHJhZGVlcF9UUA==?=
Guest
Posts: n/a
 
      11-25-2005
Hello world,



I have a simple datagrid on asp.net web form , in which I am showing a
single button column called EDIT. The code in the .aspx files for the same is
as below.

<asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit"
CommandName="EditRec">
<ItemStyle Font-Bold="false" VerticalAlign="Top"
HorizontalAlign="left" Width="30" Height="35"></ItemStyle>
</asp:ButtonColumn>

Currently, I am displaying this Edit link button for every record in the
datagrid. I want to know how can i selectively disable EDIT link button for
few records based on what value is in any single datagrid column. I need to
disable it through the code and NOT when the user does anything on the screen.

(I am using ASP.NET 1.1)

Any ideas

thanks all
pradeep_TP
 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      11-25-2005
Try doing it in the ItemDataBound
Patrick

"pradeep_TP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello world,
>
>
>
> I have a simple datagrid on asp.net web form , in which I am showing a
> single button column called EDIT. The code in the .aspx files for the same

is
> as below.
>
> <asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit"
> CommandName="EditRec">
> <ItemStyle Font-Bold="false" VerticalAlign="Top"
> HorizontalAlign="left" Width="30" Height="35"></ItemStyle>
> </asp:ButtonColumn>
>
> Currently, I am displaying this Edit link button for every record in the
> datagrid. I want to know how can i selectively disable EDIT link button

for
> few records based on what value is in any single datagrid column. I need

to
> disable it through the code and NOT when the user does anything on the

screen.
>
> (I am using ASP.NET 1.1)
>
> Any ideas
>
> thanks all
> pradeep_TP



 
Reply With Quote
 
 
 
 
=?Utf-8?B?cHJhZGVlcF9UUA==?=
Guest
Posts: n/a
 
      11-25-2005
thank you patrick. I have solved the problem myself . Following is what I did

1) Added a template column and inside it i added a linkButton server control.
2) The enabled property of the link button was set as below

<asp:LinkButton id="LinkButton1" Enabled =
'<%#Convert.ToInt16(DataBinder.Eval(Container.Data Item,"employeeid"))==1?Convert.ToBoolean("True"):C onvert.ToBoolean("False")%>' runat="server">

cheers!
pradeep

"Patrick.O.Ige" wrote:

> Try doing it in the ItemDataBound
> Patrick
>
> "pradeep_TP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello world,
> >
> >
> >
> > I have a simple datagrid on asp.net web form , in which I am showing a
> > single button column called EDIT. The code in the .aspx files for the same

> is
> > as below.
> >
> > <asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit"
> > CommandName="EditRec">
> > <ItemStyle Font-Bold="false" VerticalAlign="Top"
> > HorizontalAlign="left" Width="30" Height="35"></ItemStyle>
> > </asp:ButtonColumn>
> >
> > Currently, I am displaying this Edit link button for every record in the
> > datagrid. I want to know how can i selectively disable EDIT link button

> for
> > few records based on what value is in any single datagrid column. I need

> to
> > disable it through the code and NOT when the user does anything on the

> screen.
> >
> > (I am using ASP.NET 1.1)
> >
> > Any ideas
> >
> > thanks all
> > pradeep_TP

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
HyperLink Column and Button Column in a DataGrid =?Utf-8?B?V2FyYW4=?= ASP .Net 0 08-09-2005 12:00 AM
Re: disabling link button on a datagrid in .Net John Timney \(ASP.NET MVP\) ASP .Net 0 03-07-2005 08:46 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
Disabling Datagrid Link Button Sharad Nair ASP .Net Datagrid Control 1 08-08-2003 03:38 PM



Advertisments