-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: LustrousRavi
Message 1 in Discussion
Hi All,
My task is to develop a form ,in which i have to show some data in table format.i am
using datagrid to show that data.in the last column of the datagrid there is a delete
button is there.
but that delete button is to be displayed when the "status" field of that record is
NULL.how can i put this condition in the datagrid??
-----------------------------
some part of my aspx code
<asp:BoundColumn DataField="STATUS_DESC" SortExpression="STATUS_DESC"
HeaderText="Status"></asp:BoundColumn>
<asp:BoundColumn DataField="APPROVED_BY" SortExpression="APPROVED_BY"
HeaderText="Approved By"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Delete">
<HeaderStyle HorizontalAlign="Center" ForeColor="Blue" Width="40px"
VerticalAlign="Middle"></HeaderStyle>
<ItemStyle Width="10px"></ItemStyle>
<ItemTemplate >
'
onclick="return confirm('Are you sure you want to delete')"
runat="server">
</ItemTemplate>
'---------
in ASP when loping through the records i used to check for that condition and display
the correponding text..
i tryed using ItemCreated event
code for aspx.vb file
Private Sub grdMeterDetails_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdLeaveHistory.ItemCreated
If e.Item.DataItem Is Nothing Then Exit Sub
Dim lDv As New DataView()
lDv = sqlDS.Tables("MeterDetails").DefaultView
Dim lRow As DataRowView = lDv(e.Item.ItemIndex)
If IsDBNull(lRow("STATUS_ID")) Then
e.Item.Cells(5).Text = "-"
End If
End Sub
i tried using <asp:repeater> control,but there also i am facing the same problem.
Plz give a solution to my problem.
Thanks in advance
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]