Click here to Skip to main content
15,909,466 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: IE6 Crashes while printing Pin
Michael Sync17-Dec-07 15:22
Michael Sync17-Dec-07 15:22 
GeneralRe: IE6 Crashes while printing Pin
TheMajorRager18-Dec-07 5:58
TheMajorRager18-Dec-07 5:58 
GeneralRe: IE6 Crashes while printing Pin
Michael Sync18-Dec-07 15:43
Michael Sync18-Dec-07 15:43 
GeneralRe: IE6 Crashes while printing Pin
TheMajorRager19-Dec-07 6:36
TheMajorRager19-Dec-07 6:36 
GeneralRSS.NET Pin
avengerzx917-Dec-07 14:04
avengerzx917-Dec-07 14:04 
GeneralRe: RSS.NET Pin
avengerzx918-Dec-07 6:42
avengerzx918-Dec-07 6:42 
GeneralRe: RSS.NET Pin
Michael Sync18-Dec-07 15:49
Michael Sync18-Dec-07 15:49 
Generalchild item command event not firing from parent datagrid. Pin
uglyeyes17-Dec-07 11:53
uglyeyes17-Dec-07 11:53 
Hi I have 3 level datagrid.
dg1
dg2
dg3

I am having problem firing event from dg2 to dg3. I have a function in dg2 for itemcommand which should rebind the data in dg3 but its not happening so upto dg1 and dg2 is fine. could someone help me resolve it. I think i need to handle postback events to make it work but not sure how in below code.

Hi!

I am trying to display a three level datagrid drill down. dont know what i am doing wrong. its not working on the third drill down as its not calling itemcommand event on the second datagrid.
also, there is a massive amout of text inviewstate. I want an efficient drill down. how could this be achieved. below are my codes for readability. please someone point me to correct direction.

aspx
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="gvPropertyAssetCapexSummary" DataKeyField="buildingcomponentid" runat="server" Width="472px" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2" GridLines="None" ForeColor="Black" AutoGenerateColumns="False">
<SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue" ></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan" Font-Names="verdana" Font-Size="8pt"></HeaderStyle>
<ItemStyle Font-Names="verdana" Font-Size="8pt"/>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="buildingcomponentid" HeaderText="buildingcomponentid" Visible="false"></asp:BoundColumn>
<asp:TemplateColumn>
<HeaderStyle Width="9px"></HeaderStyle>
<ItemTemplate>
<asp:ImageButton id="btnExpandJob" runat="server" Width="9px" Height="9px" ImageUrl="/Images/Plus.gif" CommandName="ExpandJob"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:PlaceHolder ID="ExpandJob" Runat="server" Visible="False">
</td></tr>
<tr><td > </td>
<td colspan="3">
<asp:DataGrid id="gvPropertyAssetCapexJob" DataKeyField="CapExJobNo" runat="server" Width="100%" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2" GridLines="None" ForeColor="Black" AutoGenerateColumns="False">
<SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan" Font-Names="verdana" Font-Size="8pt"></HeaderStyle>
<ItemStyle Font-Names="verdana" Font-Size="8pt"/>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="CapExJobNo" HeaderText="CapExJobNo" Visible="false"></asp:BoundColumn>
<asp:TemplateColumn>
<HeaderStyle Width="9px"></HeaderStyle>
<ItemTemplate>
<asp:ImageButton id="btnExpandJobDetail" runat="server" Width="9px" Height="9px" ImageUrl="/Images/Plus.gif" CommandName="ExpandJobDetail"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:PlaceHolder ID="ExpandJobDetail" Runat="server" Visible="False">
</td></tr>
<tr><td> </td>
<td colspan="3">
<asp:DataGrid DataSource='<%# getJobDetail(DataBinder.Eval(Container, "DataItem.CapExJobNo")) %>' id="gvPropertyAssetCapexJobDetail" runat="server" Width="100%" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2" GridLines="None" ForeColor="Black" AutoGenerateColumns="False">
<SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan"></HeaderStyle>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="AssetDescription" HeaderText="Asset Description"></asp:BoundColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:DataGrid>
</asp:PlaceHolder>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:DataGrid>
</asp:PlaceHolder>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:DataGrid>

vb
Public Partial Class testfunc
Inherits System.Web.UI.Page
Private domainid As Integer
Private locationid As Integer
Private buildingcomponentid As Integer


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim mydal As New clsDAL

domainid = 1204111332
locationid = 27195
buildingcomponentid = 0
If Not IsPostBack Then

Try
Dim dtPropertyCapex As DataSet = mydal.getAssetsCapexByProperty(domainid, buildingcomponentid, locationid)
If Not dtPropertyCapex Is Nothing Then
gvPropertyAssetCapexSummary.DataSource = dtPropertyCapex
gvPropertyAssetCapexSummary.DataBind()
End If
Catch ee As Exception
mydal.UpdateErrorLog(ee.Message, ee.TargetSite.Name.ToString())
Throw ee
End Try
Try

Catch ex As Exception

End Try
End If



End Sub

Private Sub gvPropertyAssetCapexSummary_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles gvPropertyAssetCapexSummary.ItemCommand

Select Case e.CommandName
Case "ExpandJob"
Dim img As ImageButton
img = e.Item.Cells(1).FindControl("btnExpandJob")
If img.ImageUrl = "/Images/Plus.gif" Then
img.ImageUrl = "/Images/Minus.gif"
Else
img.ImageUrl = "/Images/Plus.gif"
End If

Dim exp As PlaceHolder
exp = e.Item.Cells(1).FindControl("ExpandJob")
Dim dgjob As DataGrid
dgjob = CType(e.Item.FindControl("gvPropertyAssetCapexJob"), DataGrid)
If (Not dgjob Is Nothing) Then
dgjob.DataSource = getJob(e.Item.Cells(0).Text)
dgjob.DataBind()
End If

exp.Visible = Not exp.Visible

End Select
End Sub
Public Function getJob(ByVal BCId As Integer) As DataSet
Dim myDal As New clsDAL
Dim dsPropertyAssetCapexSummary As DataSet
domainid = 1204111332
locationid = 27195
dsPropertyAssetCapexSummary = myDal.getCapitalExpenditureJob(domainid, BCId, locationid)

dsPropertyAssetCapexSummary = dsPropertyAssetCapexSummary
Return dsPropertyAssetCapexSummary
End Function

Private Sub gvPropertyAssetCapexJob_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Select Case e.CommandName
Case "ExpandJobDetail"
Dim img As ImageButton
img = e.Item.Cells(1).FindControl("btnExpandJobDetail")
If img.ImageUrl = "/Images/Plus.gif" Then
img.ImageUrl = "/Images/Minus.gif"
Else
img.ImageUrl = "/Images/Plus.gif"
End If

Dim exp As PlaceHolder
exp = e.Item.Cells(1).FindControl("ExpandJobDetail")
Dim dgjobdetail As DataGrid
dgjobdetail = CType(e.Item.FindControl("gvPropertyAssetCapexJob"), DataGrid)
If (Not dgjobdetail Is Nothing) Then
dgjobdetail.DataSource = getJobDetail(e.Item.Cells(0).Text)
dgjobdetail.DataBind()
End If
exp.Visible = Not exp.Visible
End Select
End Sub

Public Function getJobDetail(ByVal CapexJObNo As Integer) As DataSet
Dim myDal As New clsDAL
Dim dsPropertyAssetCapexSummary As DataSet
domainid = 1204111332
locationid = 27195
buildingcomponentid = 0
dsPropertyAssetCapexSummary = myDal.getCapitalExpenditureJobDetail(domainid, buildingcomponentid, locationid, CapexJObNo)
Return dsPropertyAssetCapexSummary
End Function

End Class

thanks in advance.
GeneralRe: child item command event not firing from parent datagrid. Pin
uglyeyes17-Dec-07 19:00
uglyeyes17-Dec-07 19:00 
GeneralRe: child item command event not firing from parent datagrid. Pin
Paul Conrad23-Dec-07 8:12
professionalPaul Conrad23-Dec-07 8:12 
GeneralRe: child item command event not firing from parent datagrid. Pin
uglyeyes1-Jan-08 11:31
uglyeyes1-Jan-08 11:31 
GeneralGeneric page Pin
pmillio17-Dec-07 10:54
pmillio17-Dec-07 10:54 
GeneralRe: Generic page Pin
Michael Sync17-Dec-07 15:26
Michael Sync17-Dec-07 15:26 
QuestionIE7 Drop Down Issue [modified] Pin
bluewavestrider17-Dec-07 6:04
bluewavestrider17-Dec-07 6:04 
GeneralRe: IE7 Drop Down Issue Pin
Michael Sync30-Dec-07 16:14
Michael Sync30-Dec-07 16:14 
GeneralCrystal Report Pin
Sarfaraj Ahmed17-Dec-07 5:36
Sarfaraj Ahmed17-Dec-07 5:36 
GeneralRe: Crystal Report Pin
Manoj G17-Dec-07 7:57
Manoj G17-Dec-07 7:57 
QuestionAddning scrip while using UpdatePanel? Pin
thomasa17-Dec-07 5:11
thomasa17-Dec-07 5:11 
Generalpaypal Pin
Mogaambo17-Dec-07 4:28
Mogaambo17-Dec-07 4:28 
GeneralRe: paypal Pin
Sathesh Sakthivel17-Dec-07 5:19
Sathesh Sakthivel17-Dec-07 5:19 
GeneralRe: paypal Pin
Mogaambo17-Dec-07 21:46
Mogaambo17-Dec-07 21:46 
GeneralRe: paypal Pin
Paul Conrad23-Dec-07 8:14
professionalPaul Conrad23-Dec-07 8:14 
Questionhow to edit DetailsView control in a Edit Mode? Pin
hurrem17-Dec-07 4:19
hurrem17-Dec-07 4:19 
Generalpassing the values from one web page to another webpage Pin
venkatramana_arutla17-Dec-07 3:42
venkatramana_arutla17-Dec-07 3:42 
GeneralRe: passing the values from one web page to another webpage Pin
Paddy Boyd17-Dec-07 4:13
Paddy Boyd17-Dec-07 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.