|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disabling Link Button Column in DatagridI 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 Try doing it in the ItemDataBound
Patrick Show quoteHide quote "pradeep_TP" <pradee***@discussions.microsoft.com> wrote in message news:FE17609C-1F62-4CBE-A6C1-323B0DA86B0B@microsoft.com... > 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 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.DataItem,"employeeid"))==1?Convert.ToBoolean("True"):Convert.ToBoolean("False")%>' runat="server"> cheers! pradeep Show quoteHide quote "Patrick.O.Ige" wrote: > Try doing it in the ItemDataBound > Patrick > > "pradeep_TP" <pradee***@discussions.microsoft.com> wrote in message > news:FE17609C-1F62-4CBE-A6C1-323B0DA86B0B@microsoft.com... > > 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 > > >
Other interesting topics
How to add a small HTML table under a row of a GridView
Application["TotalPlayings"]++ doesn't work Source Control Products??? Downloading file from database Some questions about masterpages. Problem Running ASP.NET/ASP App Under VS 2005 how load one frame before another in aspx page The server tag is not well formed Connecting to Active Directory through ASP.NET Web form An Exception 'System.StackOverflowException' has occured in /LM/W3SVC/1/Root/... |
|||||||||||||||||||||||