Click here to Skip to main content
15,913,486 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How can i iterate through and modify the data in databround rows of a 3.5 ListView similar to a Gridview Pin
pmarfleet27-Jan-08 8:47
pmarfleet27-Jan-08 8:47 
GeneralDoubt about wesite accessing Pin
sjs4u26-Jan-08 23:10
sjs4u26-Jan-08 23:10 
GeneralRe: Doubt about wesite accessing Pin
pmarfleet27-Jan-08 2:09
pmarfleet27-Jan-08 2:09 
GeneralRe: Doubt about wesite accessing Pin
sjs4u27-Jan-08 4:38
sjs4u27-Jan-08 4:38 
GeneralRe: Doubt about wesite accessing Pin
pmarfleet27-Jan-08 5:38
pmarfleet27-Jan-08 5:38 
GeneralRe: Doubt about wesite accessing Pin
Vasudevan Deepak Kumar27-Jan-08 18:01
Vasudevan Deepak Kumar27-Jan-08 18:01 
GeneralRe: Doubt about wesite accessing Pin
Tad McClellan27-Jan-08 8:24
professionalTad McClellan27-Jan-08 8:24 
QuestionProblem adding additional nested gridviews to a form Pin
bamagrad26-Jan-08 4:27
bamagrad26-Jan-08 4:27 
Hi;

I have tried to add a third gridview to my version of this code (See Editable Nested Gridview article on this site) but I still have some questions about the code.

Such as     <ItemTemplate><br />
                                                        <a href="javascript:expandcollapse2('div<%# Eval("Institution") %>', 'one');"><br />
                                                            <img id="imgdiv<%# Eval("Institution") %>" alt="Click to show/hide Overdraft Summaries for Institution Types <%# Eval("Institution") %>"<br />
                                                                border="0" src="plus.gif" width="9px" /><br />
                                                        </a><br />
                                                    </ItemTemplate>

What is the meaning of the 'one' string used in the expandcollaspe2() call ?
I know that the expected value is row ? Current row ?

Here is the function :

function expandcollapse2(obj,row)<br />
    {<br />
        var div = document.getElementById(obj);<br />
        var img = document.getElementById('img' + obj);<br />
        <br />
        if (div.style.display == "none")<br />
        {<br />
            div.style.display = "block";<br />
            if (row == 'alt')<br />
            {<br />
                img.src = "minus.gif";<br />
            }<br />
            else<br />
            {<br />
                img.src = "minus.gif";<br />
            }<br />
            img.alt = "Close to view other Institutions";<br />
        }<br />
        else<br />
        {<br />
            div.style.display = "none";<br />
            if (row == 'alt')<br />
            {<br />
                img.src = "plus.gif";<br />
            }<br />
            else<br />
            {<br />
                img.src = "plus.gif";<br />
            }<br />
            img.alt = "Expand to show Institutions";<br />
         }<br />
     } 


And finally when I try to all a third DVG I am not getting it to display. I have taken care to repeat the code sequence done to get the second grid to display, which it does.
So for grid 3 I create a template column in grid2 like so:
<br />
         <asp:TemplateField><br />
                                                    <ItemTemplate><br />
                                                        <tr><br />
                                                            <td colspan="100%"><br />
                                                                <div id="div<%# Eval("typeName") %>" style="display: none; position: relative; left: 15px;<br />
                                                                    overflow: auto; width: 92%"><br />
                                                                    <asp:GridView ID="GridView3" AllowPaging="True" AllowSorting="true" BackColor="White"  , ETC.<br />


IN MY CODE BEHIND I SETUP MY FUNCTION TO RETURN A DATASET:

 Private Function ChildDataSource2(ByVal strInstitution As String, ByVal strTypeName As String, ByVal strSort As String) As AccessDataSource<br />
<br />
        Dim strQRY2 As String = ""<br />
        Dim dsTemp2 As AccessDataSource = New AccessDataSource()<br />
        dsTemp2.DataFile = "App_Data/aGreatDB.mdb"<br />
<br />
              strQRY2 = "SELECT Institution, AcctNum, AcctName, ODDate, [Rundate]-[ODDate] As DaysOverdrawn, CurrentOD, OFFICERS_NAME, OFFICER_CODE, " _<br />
                     & "Income, Principle, NetOD AS COB_OD, TypeName  FROM  qryDetail2   WHERE Institution = '" & strInstitution & "'  AND TypeName = '" & strTypeName & "' " + strSort<br />
<br />
                  dsTemp2.SelectCommand = strQRY2<br />
        Return dsTemp2<br />
      <br />
    End Function<br />

I also have a question about where this function should be called. Do I call this in Gridview1.ROWDATABOUND or in GRIDVIEW2.ROWDATABOUND ?

This is my code to call the dataset function:

 Dim gv2 As GridView = New GridView()<br />
        gv2 = row.FindControl("GridView3")<br />
<br />
               '    'Expand the Child grid<br />
            ClientScript.RegisterStartupScript(Me.GetType(), "Expand", "<script language="javascript">expandcollapse2('div" + e.Row.DataItem("Institution").ToString() + "','one');</script>")<br />
        End If<br />
<br />
        'Prepare the query for Child GridView by passing the Institution of the parent row<br />
        gv2.DataSource = ChildDataSource2(e.Row.DataItem("Institution").ToString(), e.Row.DataItem("TypeName").ToString(), strSort)<br />
        gv2.DataBind()


If my function is expecting two PARMS is this correct syntax for the e.Row.DataItem method call ?

Sorry if I have exceeded my in message code limit.

Thanks for any suggestions or insights !
Generalshowing some of whole data in a drop down list Pin
Member 471741225-Jan-08 21:54
Member 471741225-Jan-08 21:54 
GeneralRe: showing some of whole data in a drop down list Pin
pmarfleet25-Jan-08 22:05
pmarfleet25-Jan-08 22:05 
GeneralAutomatic alert to other users Pin
Vipin.d25-Jan-08 21:52
Vipin.d25-Jan-08 21:52 
GeneralRe: Automatic alert to other users Pin
Abhijit Jana25-Jan-08 23:31
professionalAbhijit Jana25-Jan-08 23:31 
GeneralRe: Automatic alert to other users Pin
Guffa26-Jan-08 10:17
Guffa26-Jan-08 10:17 
GeneralRe: Automatic alert to other users Pin
Guffa26-Jan-08 10:11
Guffa26-Jan-08 10:11 
Generalebook link Pin
Sonia Gupta25-Jan-08 21:36
Sonia Gupta25-Jan-08 21:36 
GeneralRe: ebook link Pin
Abhijit Jana25-Jan-08 22:59
professionalAbhijit Jana25-Jan-08 22:59 
GeneralRe: ebook link Pin
Paul Conrad26-Jan-08 6:30
professionalPaul Conrad26-Jan-08 6:30 
GeneralRe: ebook link Pin
John-ph26-Jan-08 19:39
John-ph26-Jan-08 19:39 
QuestionHow to show a web user control's properties in property window IF? Pin
maryam.saboor25-Jan-08 20:22
professionalmaryam.saboor25-Jan-08 20:22 
GeneralSending mails on particular date and time Pin
csn25-Jan-08 8:01
csn25-Jan-08 8:01 
GeneralRe: Sending mails on particular date and time Pin
Ennis Ray Lynch, Jr.25-Jan-08 9:24
Ennis Ray Lynch, Jr.25-Jan-08 9:24 
GeneralRe: Sending mails on particular date and time Pin
csn25-Jan-08 17:43
csn25-Jan-08 17:43 
GeneralRe: Sending mails on particular date and time Pin
John-ph26-Jan-08 19:44
John-ph26-Jan-08 19:44 
GeneralGetting the controls form an asp:Table [modified 2] Pin
Fernando A. Gomez F.25-Jan-08 7:18
Fernando A. Gomez F.25-Jan-08 7:18 
GeneralRe: Getting the controls form an asp:Table Pin
ChrisKo25-Jan-08 8:19
ChrisKo25-Jan-08 8:19 

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.