Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Is there an available web control like this?

Reply
Thread Tools

Is there an available web control like this?

 
 
Erick T
Guest
Posts: n/a
 
      08-07-2003
Hello,

I am looking for a Web UI Control, either commercial or free. I don't
know exactly what to call it, so I will describe what I need it to do.
In a nutshell, it's a control to visually represent an intersection
table in a many-to-many relationship. For example, in this ERD

Country ----< CountryVisit >---- Person

each country can have more then one person visiting, and each person
can visit more then one country. What I want to have is a way to
display/edit information for the association/intersection table; all
possible records shown with one end fixed (either all Countries for a
person, or vise versa). The CountryVisit (or intersection) table could
have a number of fields

CountryID
PersonID
DateOfVisit
etc

So the control needs to behave like the DataGrid, where you can define
a template for the items to be displayed. So if my countries were
(USA, Canada, UK) I could fix the Person, and the control would show
(for example) (aircode, but if anything doesn't make sense, let me
know)

<ItemTemplate>
<asp:checkbox checked=<%
IsNull(Container.DataItem("Item.CountryID")) %> Text=<%
Container.DataItem("Item.CountryName") %> />
</ItemTemplate>

and the ItemTemplate would repeat for all possible Countries. Also,
the control would have events for when a row in the intersection table
is created or deleted, so I could set the columns as needed.

The reason I want this control is that a lot of my databases have
large numbers of these intersections tables. And I seem to end up
writing the same code over and over again. What I generally write is
below.

I need a method in my code behind to correctly populate the List,
which is called when the elements of the page are DataBound. e.g.,

<asp:CheckBoxList id="checkBoxList" DataSource = "Country" etc />

and in the codebehind:

CountryVisitView.Filter = "PersonID = " + someID;
foreach (CountryVisitRow r in CountryVisitView) {
list.FindItem(r.CountryID).Checked = true;
// set other properties (date, etc)
}

Then, in my update method, I often end up doing something like this,
which simply syncs the contents of the list to the recordset.

CountryVisitView.Filter = "PersonID = " + someID;
// find newly added rows in intersection
foreach (Item i in checkBoxList) {
if (i.Checked == true) {
// or method which loops over the view
if (!CountryVisitView.Contains(i.CountryID)) {
// add row to CountryVisitView
}
}
if (i.Checked == false) {
if (!CountryVisitView.Contains(i.CountryID)) {
// remove row from country view
}
}
}

What I would like, is something like

<IdealControl
IntersectDataSource="CountryVisit"
Relationship1Name="CountryVisitCountry">
Relationship2Name="CountryVisitPerson"
Fixed="PersonID=123"
OnAdd="AddIntersectRec"
OnRemove="RemoveIntersectRec"
>

<ItemTemplate>
<asp:CheckBox ... > etc
// with DataItem a reference to the current
DataRow/DataRowView of the intersection table
</ItemTemplate>
</IdealControl>

Then, the OnAdd/OnRemove events would work like the ADO.NET
SqlRowUpdating event, where I can inspect/update/cancel the pending
operation (the addition or removal of the row in the Intersection
table). I hope this makes sense, if not, let me know and I'll answer
anything I can.

Sorry about the long post, but I wasn't sure how to describe this.
Does anyone know if such a control exists?

Thanks,
Erick
 
Reply With Quote
 
 
 
 
Tommy
Guest
Posts: n/a
 
      08-08-2003
http://www.infragistics.com/products/grids.asp

The above grid has the presentation layer you're looking. Not too sure
about the logic behind it. Hope this helps.

Tommy,

http://www.velocityreviews.com/forums/(E-Mail Removed) (Erick T) wrote in message news:<(E-Mail Removed). com>...
> Hello,
>
> I am looking for a Web UI Control, either commercial or free. I don't
> know exactly what to call it, so I will describe what I need it to do.
> In a nutshell, it's a control to visually represent an intersection
> table in a many-to-many relationship. For example, in this ERD
>
> Country ----< CountryVisit >---- Person
>
> each country can have more then one person visiting, and each person
> can visit more then one country. What I want to have is a way to
> display/edit information for the association/intersection table; all
> possible records shown with one end fixed (either all Countries for a
> person, or vise versa). The CountryVisit (or intersection) table could
> have a number of fields
>
> CountryID
> PersonID
> DateOfVisit
> etc
>
> So the control needs to behave like the DataGrid, where you can define
> a template for the items to be displayed. So if my countries were
> (USA, Canada, UK) I could fix the Person, and the control would show
> (for example) (aircode, but if anything doesn't make sense, let me
> know)
>
> <ItemTemplate>
> <asp:checkbox checked=<%
> IsNull(Container.DataItem("Item.CountryID")) %> Text=<%
> Container.DataItem("Item.CountryName") %> />
> </ItemTemplate>
>
> and the ItemTemplate would repeat for all possible Countries. Also,
> the control would have events for when a row in the intersection table
> is created or deleted, so I could set the columns as needed.
>
> The reason I want this control is that a lot of my databases have
> large numbers of these intersections tables. And I seem to end up
> writing the same code over and over again. What I generally write is
> below.
>
> I need a method in my code behind to correctly populate the List,
> which is called when the elements of the page are DataBound. e.g.,
>
> <asp:CheckBoxList id="checkBoxList" DataSource = "Country" etc />
>
> and in the codebehind:
>
> CountryVisitView.Filter = "PersonID = " + someID;
> foreach (CountryVisitRow r in CountryVisitView) {
> list.FindItem(r.CountryID).Checked = true;
> // set other properties (date, etc)
> }
>
> Then, in my update method, I often end up doing something like this,
> which simply syncs the contents of the list to the recordset.
>
> CountryVisitView.Filter = "PersonID = " + someID;
> // find newly added rows in intersection
> foreach (Item i in checkBoxList) {
> if (i.Checked == true) {
> // or method which loops over the view
> if (!CountryVisitView.Contains(i.CountryID)) {
> // add row to CountryVisitView
> }
> }
> if (i.Checked == false) {
> if (!CountryVisitView.Contains(i.CountryID)) {
> // remove row from country view
> }
> }
> }
>
> What I would like, is something like
>
> <IdealControl
> IntersectDataSource="CountryVisit"
> Relationship1Name="CountryVisitCountry">
> Relationship2Name="CountryVisitPerson"
> Fixed="PersonID=123"
> OnAdd="AddIntersectRec"
> OnRemove="RemoveIntersectRec"
> >

> <ItemTemplate>
> <asp:CheckBox ... > etc
> // with DataItem a reference to the current
> DataRow/DataRowView of the intersection table
> </ItemTemplate>
> </IdealControl>
>
> Then, the OnAdd/OnRemove events would work like the ADO.NET
> SqlRowUpdating event, where I can inspect/update/cancel the pending
> operation (the addition or removal of the row in the Intersection
> table). I hope this makes sense, if not, let me know and I'll answer
> anything I can.
>
> Sorry about the long post, but I wasn't sure how to describe this.
> Does anyone know if such a control exists?
>
> Thanks,
> Erick

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any "Drop down checklist" web control for VS2008 available now? CNkid ASP .Net Web Controls 0 01-15-2010 02:43 AM
object-like macro used like function-like macro Patrick Kowalzick C++ 5 03-14-2006 03:30 PM
RE: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:11 AM
Re: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" Natty Gur ASP .Net 0 06-06-2004 05:46 AM
Is there an available web control like this? Erick T ASP .Net 1 08-08-2003 01:45 AM



Advertisments