[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Transfer Data from datagrid across frames

Asked by daletian in Programming for ASP.NET

Tags: datagrid, item_created, tranright

Hello Experts,

I've got a frame page with webcontrols and code to read an XML file on the left frame and I want it to display the data from the XML file in a datagrid on the right frame when the Showlog link is clicked.

I've tried various was like using javascript to send the data across using the tranright function but no joy.
I've had it work using a text box control but seem to hit a brickwall with the datagrid

u can see a live demo here http://www.brockleymassives.com/ee  

Also, here is the code I've been using

------------------------------------- Left Hand Frame page---------------------------------------

<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.IO" %>
<%@ Page Language="vb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <title>WebForm1</title>
            <script runat="server">

    Sub Page_Load(Src As Object, E As EventArgs)
      End Sub
   
      Sub ShowBRLog (Src As Object, E As EventArgs)
   
                 Dim objDataSet As New DataSet()
   
                 objDataSet.ReadXml("http://www.brockleymassives.com/ee/log.xml")
   
                 dgBrockleyLog.DataSource = objDataSet.Tables("weblog").DefaultView
                 dgBrockleyLog.DataBind()
   
   
      End Sub
   
      Sub Item_Bound (sender As Object, e As System.Web.UI.WebControls.DataGridItemEventArgs)
            dgbrockleylog.Attributes.Add("onitemdatadound","javascript:tranRight(dgreceiveLog.value)")
      End Sub
   
    Sub Item_Created (sender As Object, e As DataGridItemEventArgs)
            dgbrockleylog.Attributes.Add("onitemdatadound","javascript:tranRight(dgreceiveLog.value)")
    End Sub

            </script>
            <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
            <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
            <meta content="JavaScript" name="vs_defaultClientScript">
            <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
            <link href="portalstyle.css" type="text/css" rel="stylesheet"> <!--[if !IE]><LINK href="../scripts/Styles.css"
type=text/css rel=stylesheet><![endif]-->
            <script language="javascript">
            function tranRight(ltext){

      parent.frames(1).document.forms("frmReceive").item("dgreceiveLog").value = ltext;

}
            function tranRight(l7text){

      parent.frames(1).document.forms("frmReceive").item("Brockley").value = l7text;


}
            </script>
      </HEAD>
      <body ms_positioning="GridLayout">
            <form id="Form2" method="post" runat="server">
                  <table id="AutoNumber1" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" cellspacing="0"
                        cellpadding="0" width="100%" border="0">
                        <tbody>
                              <tr>
                                    <td>
                                    </td>
                                    <td>
                                          <div class="container">
                                                <p>
                                                      <asp:linkbutton id="LinkButton2" onclick="showbrlog" runat="server" CssClass="LinkButton" Text="Show Log"></asp:linkbutton>
                                                      <br>
                                                </p>
                                          </div>
                                    </td>
                              </tr>
                              <tr>
                                    <td class="sidecell">
                                          <div class="container">
                                                <h2>
                                                </h2>
                                          </div>
                                    </td>
                                    <td class="maincell" visible="false">
                                          <div class="logs">
                                                <p>
                                                </p>
                                                <p>
                                                </p>
                                                <asp:datagrid id="dgBrockleyLog" runat="server" OnItemDataBound="Item_Bound" OnItemCreated="Item_Created">
                                                      <HEADERSTYLE font-bold="true" backcolor="Blue" forecolor="White" />
                                                      <ITEMSTYLE backcolor="White" />
                                                      <ALTERNATINGITEMSTYLE backcolor="Gainsboro" />
                                                </asp:datagrid>
                                                <p>
                                                </p>
                                          </div>
                                    </td>
                              </tr>
                        </tbody>
                  </table>
            </form>
      </body>
</HTML>

----------------------------------------------------------------------------------------------------------------------------------------





--------------------------   and for right hand frame, just code waiting to receive the data-----------------------------

<%@ Page Language="vb"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <title>WebForm2</title>
            <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
            <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
            <meta name="vs_defaultClientScript" content="JavaScript">
            <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
            <LINK href="portalstyle.css" type="text/css" rel="stylesheet"> <!--[if !IE]><LINK href="../scripts/Styles.css"
type=text/css rel=stylesheet><![endif]-->
      </HEAD>
      <body MS_POSITIONING="GridLayout">
            <form id="Form1" method="post" runat="server">
                  <div class="logs"><p></p>
                        <asp:datagrid id="dgreceiveLog" runat="server">
                              <HEADERSTYLE font-bold="true" backcolor="Blue" forecolor="White" />
                              <ITEMSTYLE backcolor="White" />
                              <ALTERNATINGITEMSTYLE backcolor="Gainsboro" />
                        </asp:datagrid>
                        <p></p>
                  </div>
            </form>
      </body>
</HTML>

----------------------------------------------------------------------------------------------------------------------------------


Thanks for your time and help
[+][-]07/06/04 04:02 PM, ID: 11486784Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Programming for ASP.NET
Tags: datagrid, item_created, tranright
Sign Up Now!
Solution Provided By: a1x
Participating Experts: 1
Solution Grade: A
 
[+][-]07/06/04 09:29 AM, ID: 11482856Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/06/04 02:58 PM, ID: 11486339Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/06/04 06:07 PM, ID: 11487487Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/06/04 07:03 PM, ID: 11487701Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/07/04 03:03 AM, ID: 11489700Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93