CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 12/10/2007 4:10:25 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
Stan92
Asp.Net User
Newbie question : Connection between 3 or more webparts12/10/2007 4:10:25 PM

0/0

Hi,

I m trying to play with web parts.

I would like to know if it's possible to create a connection between 3 web parts ?
here's my web parts.
WebPart A is a Gridview with the Customers list.
WebPart B is a Gridview with the Orders list (the orders are filtered by the customer Id)
WebPart C is a Gridview with the Details Order (and my goal is to display the detail of the order from the selection of B).

how to make the relation between B and C. (for A->B, it works for me).

Any help is really welcome.
Stan

Amanda Wang - M
Asp.Net User
Re: Newbie question : Connection between 3 or more webparts12/14/2007 7:31:46 AM

0/0

Hi,

About the relation between the B and C should be similar to the relation between A and B.

Below is my test code helps.

1. Aspx code:

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ParentId"
                                DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
                                <Columns>
                                    <asp:BoundField DataField="ParentId" HeaderText="ParentId" SortExpression="ParentId" />
                                    <asp:BoundField DataField="ParentName" HeaderText="ParentName" SortExpression="ParentName" />
                                    <asp:CommandField ShowSelectButton="True" />
                                </Columns>
                            </asp:GridView>
                            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" OnSelectedIndexChanged="GridView2_SelectedIndexChanged" DataKeyNames="SubID">
                                <Columns>
                                    <asp:BoundField DataField="ParentId" HeaderText="ParentId" SortExpression="ParentId" />
                                    <asp:BoundField DataField="ChildName" HeaderText="ChildName" SortExpression="ChildName" />
                                    <asp:BoundField DataField="subID" HeaderText="subID" SortExpression="subID" />
                                    <asp:CommandField ShowSelectButton="True" />
                                </Columns>
                            </asp:GridView>
                            <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource3" DataKeyNames="SubID">
                                <Columns>
                                    <asp:BoundField DataField="SubID" HeaderText="SubID" SortExpression="SubID" />
                                    <asp:BoundField DataField="SubName" HeaderText="SubName" SortExpression="SubName" />
                                </Columns>
                            </asp:GridView>

                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
                        SelectCommand="SELECT * FROM [ParentTable]"></asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"  >
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" > 
                    </asp:SqlDataSource>

 2. The code behind:

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.SqlDataSource2.SelectCommand = "SELECT * FROM [ChildTable] WHERE ([ParentId] = " + this.GridView1.SelectedDataKey.Value.ToString() + ")";
        this.GridView2.DataBind();
    }
    protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
    {
this.SqlDataSource3.SelectCommand = "SELECT * FROM [SubTable] WHERE ([SubID] = "+this.GridView2.SelectedDataKey.Value.ToString()+")";
this.GridView3.DataBind();

    }

 Notice, you should set the second gridview's datakey is the third gridview's key field.

 Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Newbie question : Connection between 3 or more webparts - ASP.NET ... Newbie question : Connection between 3 or more webparts. Last post 12-14-2007 2: 31 AM by Amanda Wang - MSFT. 1 replies. Sort Posts: ...
Developing a reusable SQL Data viewer WebPart for Sharepoint -Part ... Developing a reusable SQL Data viewer WebPart for Sharepoint -Part 3. Customize the webpart properties for dynamic connection to SQL server and to enable ...
SharePoint List View Web Part Connection Issue List View Web Part Connection Issue. Jason Flye posted at 29-Aug-08 02:41. Hi everyone,. I have a newbie question for you guys that Im really hoping you can ...
The Road To SharePoint Web Parts So I, as developer definitely treat web parts in a different way than web controls - I have more respect to them :D 3. Talking about dwp file you may also ...
TheMSsForum.com >> Windows Services >> ToolPane Manager and Page ... If I don't make the first list a dropdown, the connection between the 2 lists ... Allan the newbie Tag: ToolPane Manager and Page Tabs webpart Tag: 20802 ...
Menu Implementation With ASP.NET Web Parts - xFX JumpStart Public ... Post #3. Newbie * Group: Members Posts: 4 Joined: 21-July 06 Member No.: 3118. QUOTE(xfx @ Jul 26 2006, 09:21 AM) *. I cannot see the connection between the ...
KWizCom SharePoint CRM Blog: Using FrontPage Data View Web Part ... 2. Nimrod – Please add steps to adding a data view web part 3. ... Generic SQL Error Code: 0x80044150 · Error using web part connection in list item form ...
how to use WebPart in asp.net2.0 - .NET Forum how to use WebPart in asp.net2.0. Question posted by: archu007 (Newbie) on October 11th, 2007 07:49 AM. Hi frds i hav used webparts in my ...
The Mobile Web Part 6: 7 Useful Mobile Site Resources | Webmaster ... It’s a great service, and one ideal for newbies and those who aren’t the Do-it- Yourself type. ... The Mobile Web Part 3: iPhonitizing Your Site Sans MoFuse ...
Office & SharePoint Pro - Passing parameters to web parts Eric, to answer your fundamental question, there is a defined communications mechanism for communicating between Web Parts. ...




Search This Site:










deployment problems

absolute positioning in a custom module

@nokiko reply to this....

dotnetnuke lists

vb code to play a sound file

how to authenticate active directory username+password ?

life of cart data that hasn't been ordered

custom role provider being ignored?

"nofollow" spidering problems dnn 2.1.2 help!!!

access to path denied creating file

pass on authenticated username and password of sharepoint site in networkcredential() method.

menu control help needed

rendering existing table design as css layout

how to compile two files using .net framework vbc compiler?

mysql version of dnn based on 1.10

accessing or obtaining visual designer for building class diagrams for c#?

mobile

exception when download file

persian dotnetnuke programmers

adding a database record in vwd

3.0 module debugging page please post

file upload errors

turning off background compiler?

error in saving project

changepassword control fails in firefox but successes in ie?

ms word from an asp.net webapp with vb

personal site starter kit

dynamic user attributes objcodecompiler and userprofile.vb

c# error

how to: preserve access to response.write and the other intrinsic "classic asp" methods

 
All Times Are GMT