Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP 1.1: DataGrid - Showing/Not Showing Buttons

Reply
Thread Tools

ASP 1.1: DataGrid - Showing/Not Showing Buttons

 
 
Ray Booysen
Guest
Posts: n/a
 
      03-28-2006
Hi all

I have a collection of Invoices that I bind to a datagrid. Some of
these invoices have been processed and you can tell this via a property
in the invoice class called DateProcessed. If an invoice has been
processed I do not want a button to display for this invoice but all
other unprocessed invoices need the button to be displayed.

Any ideas?

Regards
Ray
 
Reply With Quote
 
 
 
 
Ray Booysen
Guest
Posts: n/a
 
      03-28-2006
Ray Booysen wrote:
> Hi all
>
> I have a collection of Invoices that I bind to a datagrid. Some of
> these invoices have been processed and you can tell this via a property
> in the invoice class called DateProcessed. If an invoice has been
> processed I do not want a button to display for this invoice but all
> other unprocessed invoices need the button to be displayed.
>
> Any ideas?
>
> Regards
> Ray

Here is the datagrid:

> <asp:datagrid id="grdInvoices" runat="server" CssClass="StandardGrid" ItemStyle-CssClass="Normal"
> DataKeyField="ID" AutoGenerateColumns="False" CellPadding="5" AllowPaging="True" PageSize="10"
> HeaderStyle-CssClass="SubHead">
> <HeaderStyle CssClass="SubHead"></HeaderStyle>
> <Columns>
> <asp:BoundColumn DataField="InvNum" HeaderText="Invoice Number">
> <ItemStyle Width="50px" CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="Description" HeaderText="Description">
> <ItemStyle CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="AgentName" HeaderText="Client">
> <ItemStyle Width="100px" CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="WEDate" HeaderText="Week Ending" DataFormatString="{0:dd/MM/yyyy}">
> <ItemStyle CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="Amount" HeaderText="Amount">
> <ItemStyle Width="80px" CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="VAT" HeaderText="VAT">
> <ItemStyle Width="80px" CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:BoundColumn DataField="Received" HeaderText="Received">
> <ItemStyle CssClass="Normal"></ItemStyle>
> </asp:BoundColumn>
> <asp:ButtonColumn Text="edit" CommandName="Edit">
> <ItemStyle HorizontalAlign="Center" Width="50px" CssClass="CommandButton"></ItemStyle>
> </asp:ButtonColumn>
> <asp:ButtonColumn Text="delete" CommandName="Delete">
> <ItemStyle HorizontalAlign="Center" Width="50px" CssClass="CommandButton"></ItemStyle>
> </asp:ButtonColumn>
> <asp:ButtonColumn Text="submit" CommandName="Close">
> <ItemStyle HorizontalAlign="Center" Width="50px" CssClass="CommandButton"></ItemStyle>
> </asp:ButtonColumn>
> </Columns>
> <PagerStyle HorizontalAlign="Center" CssClass="SubHead" Mode="NumericPages"></PagerStyle>
> </asp:datagrid>


 
Reply With Quote
 
 
 
 
Ray Booysen
Guest
Posts: n/a
 
      03-28-2006
Ray Booysen wrote:
> Hi all
>
> I have a collection of Invoices that I bind to a datagrid. Some of
> these invoices have been processed and you can tell this via a property
> in the invoice class called DateProcessed. If an invoice has been
> processed I do not want a button to display for this invoice but all
> other unprocessed invoices need the button to be displayed.
>
> Any ideas?
>
> Regards
> Ray

OK, don't worry about it. I can check this via the ItemDataBound()
event and disable the relevant row's cells from there.

I can retrieve the invoice I require from the e.Item.DataItem property.

Thanks!
 
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
The Z axis and simple menu buttons/image buttons Jonathan N. Little HTML 3 04-02-2007 09:57 AM
Datagrid Nav buttons and numeric buttons Jeremy Jones ASP .Net 1 03-22-2007 08:00 AM
Image Buttons/Buttons not responding =?Utf-8?B?QmVu?= ASP .Net 1 07-06-2005 07:34 AM
2 buttons but want enter key in textbox to execute one buttons' click event? Roger ASP .Net 1 05-20-2005 09:47 PM
Asp.net text boxes and buttons not showing on aspx pages Darren D'Orlando ASP .Net 1 08-19-2003 10:06 PM



Advertisments