CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 1/5/2005 4:51:38 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 27 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
danscan
Asp.Net User
A possible bug?1/5/2005 4:51:38 PM

0

I have an XML file that contains multiple datagrid configuration scripts. The XML file is being read as a standard DataSet. What seems to be happening is that the last rowfilter is overwriting the current one even though a new instance of it was created.
pseudo code:

Filter the default view or the primary table of the DATASET
Create a new empty DATAVIEW object
set the new DATAVIEW object to the DefaultView with the filter.
set the new DATAVIEW as the config file of the datagrid.

Create a new filter for the DATASET.
Create a new empty DATAVIEW object (different name);
set the new DATAVIEW object to the Defaultview with the new filter
set the new DATAVIEW as the config file of the second datagrid.

bind the first datagrid.

end pseudo code

Well what happens is that the first datagrid seems to be using the second datagrids config DATAVIEW even though I created a new DATAVIEW object and set the first filtered Defaultview to that. Then gave that DATAVIEW as the first datagrids config DataView.

here is some of the code

//Set the datatable to filter based upon a value (grab the columns for this datagrid)
dsCol.Tables[1].DefaultView.RowFilter = "GridName='GridPrime'";
//Create a new object for DataView
DataView DRV1 = new DataView();
//Set the new object to the previously created dataview
DRV1 = dsCol.Tables[1].DefaultView;
//set the config file for the datagrid
myDataGrid1.DataCols = DRV1;
//get the data to be displayed
dsData.ReadXml(sPath + "DataDrill.xml");
//set the datasource fo the datagrid
myDataGrid1.DataSource = dsData.Tables[0];

//Create the new view
dsCol.Tables[1].DefaultView.RowFilter = "GridName='GridDetail'";
//New instance
DataView DRV2 = new DataView();
//set new instance to the view
DRV2 = dsCol2.Tables[1].DefaultView;
//set the new object as the config file of the second datagrid
myDataGrid2.DataCols = DRV2;
//The second datagrids datasoruce is the second table int he dataset
myDataGrid2.DataSource = dsData.Tables[1];
//DataBind the first datagrid
myDataGrid1.DataBind(); //It uses the what ever the last defaultview.rowfilter was set



So guys to you have any ideas? I have to use the XML files the way they are. So I can't use improvements to what data is actually put into the datasets.


The difference between genius and madness is success. And I haven't been too successful.
georgej
Asp.Net User
Re: A possible bug?1/6/2005 10:34:24 PM

0

I'm not sure what the relationship is between dataset dsData and dataset dsCol. If they are the same thing, or different, so I'm a bit confused.

You should be able to create two different data views, and therefore, two different filters on the same dataset with code like:

DataView DV = new DataView( dsCol.Tables[1] );
DV.RowFilter = "GridName='GridPrime'";
myDataGrid1.DataSource = DV;
myDataGrid1.DataBind();

DV = new DataView( dsCol.Tables[1] );
DV.RowFilter = "GridName='GridDetail'";
myDataGrid2.DataSource = DV;
myDataGrid2.DataBind();

What it appears that you are doing is creating your objects in the wrong order, or don't realize that you are passing object references when you assign objects. In your code, for example, you state:

DataView DRV2 = new DataView();
DRV2 = dsCol2.Tables[1].DefaultView;

The first line creates a new object and assigns the reference to DRV2. But then you throw this object away on the next line and assign an object reference to dsCol2.Tables[1].DefaultView.

Assigning dsCol2.Tables[1].DefaultView to DRV2 doesn't copy the contents, it simply gives you a reference to the object, so you an refer to "dsCol2.Tables[1].DefaultView" as "DRV2", therefore (after the assignment):

dsCol2.Tables[1].DefaultView.RowFilter = "GridName='GridDetail'";

performs the same action as:

DRV2.RowFilter = "GridName='GridDetail'";

Have fun.

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
The gold-bug and other tales Authors: Edgar Allan Poe, Pages: 121, Published: 1991
Buprofezin, a Possible New Insect Growth Regulator to Control Longtailed Mealybug ( August 1994 - June 1996) Authors: Peter H. Jerie, Horticultural Research & Development Corporation, Horticultural Research & Development Corporation, Pages: 8, Published: 1999
Chemoreception in the Blood-Feeding Bug Rhodnius Prolixus: A Possible Role of Cyclic AMP Authors: J J B Smith, W G Friend, TORONTO UNIV (ONTARIO) DEPT OF ZOOLOGY, Pages: 0, Published: 1972

Web:
A possible bug in os_tsk_delete, MDK-ARM v3.50 Thread 14851: Hi everyone,It appears there is a bug in os_tsk_delete function in MDK-ARMv3.50.If a task with an OS_TID = tries to delete aprevious task with ...
Citrix Forums : a possible bug ... Thread: a possible bug. This question is not answered. ... Posts: 8. a possible bug. Posted: Apr 17, 2009 5:06 AM. Click to reply to this thread ...
[Customgeometry] A possible bug [Customgeometry] A possible bug. Kertis Henderson kertishenderson at hotmail.com . Thu Jan 22 16:23:30 PST 2009. Previous message: [Customgeometry] A ...
Possible bug in Apple's iPhone - SC Magazine US Apr 17, 2009 ... Charlie Miller, a well-known hacker and analyst at Independent Security Evaluators in Baltimore said that he found a way to trick the iPhone ...
A possible Bug - Wetpaint Central Central help and community resource for Wetpaint. FAQs, Help, Tips, News, and more! - A possible Bug.

Page.LoadControl bug - ng.asp-net-forum ... possible bug in SPFolder? -getting InvalidOperationException when ... ID, SPContext.Current.Site.RootWeb). Dim tbToolbar As ToolBar = DirectCast(Page. ...
VWD 2008 Express AJAX Control Toolkit control named CC1 and ... Also each control is marked with a cc prefix. Is this OK?? What possibly am i missing or is there a possible bug somewhere... Thanks. ...
Help Find Control on UserControl - ng.asp-net-forum.windows ... a possible bug? opinion on web1host? getting a list of controls in the property inspector ยท help, i've fallen (into an admin pit) and i ...
i need the Header to remain stationary when page scrolls... - ng ... --%> .... re: possible omission from 3.2 source code ...
Menu with LevelMenuItemStyles - ng.asp-net-forum ... I'm pretty sure this is a known bug. I seem to remember reporting ... dnn 3.0.5- pagename and title [possible] bug(s)? approval process? ...

Videos:
Murder Herd's Keep Falls - Possible Bug? Well it seems there maybe a bug ingame, Primal Fury while checking out Murder Herd's Keep found it could be damaged, so it was razed to the ground ...
Demo of possible fix for GNOME bug 138126 Demonstration of adding emblems to bugs. Here we show the addition of the gnome-love emblem (a heart) and the patch emblem (a plaster/bandage ...
World 9 Grand Exchange Killing Bug? PART 2 HAS BEEN REMOVED! In this video, I come upon a possible bug at the grand exchange. TAGS BELOW _______ King Duffy 1 Mithril Dragon ...
Prospecting for Bugs Google TechTalks April 28, 2006 Ross Collard Ross Collard is with Collard & Company, a Manhattan-based consulting firm which specializes in ...
A Possible Solution For Copyright Problem Listen to the video but to be brief, a way to stop copyright is to say it is educational. Video I mentioned in beginning: http://www.youtube ...












treeview server side select node

treeview checkbox

how to get the content of the controls in tab & multipage

using multipage and tabstrip within repeater

right click on the web treeview node

problem in treeview webcontrol

can't set the state of treeview

problem in the alignment of the nodes in a tree

help:tabstrip-multipage ie web control

tabstip and multipage problem

tabstrip && internet explorer 7

treeview display problems .. nodes not aligned

treeview wrap

how to display a table in the tree??? or put a hidden value for each node???

treeview is causing a huge viewstate

multipage controls

drag and drop in treeview

iewebcontrols and cassini web server problem !

problem with microsoft.web.ui.webcontrols.dll

how do i set clienttarget per control

treeview creating the dll

how can i get the page has expired

using treeview expand and collaspe events in javascript

ie web controls not rendering on page

treeview and ajax?

tree view help.

tabstrip/multipage printing

problems with treeview control

ie tree view binding to custom business objects

toolbar - style

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT