Please Please Help

Hi all,

I've got a really big problem that just wont go away and I'm really really at wits end so if anyone can see what I'm doing or has any suggestions please help me out.
Here Goes.
I have A Nested (Embedded) datagrid well actually three the top (master grid) binds to a dataset that has four tables looks for child dependancies if there is I'm casting a dataset from a DataGridItem which is cast from the bindingcontainer the source for the child grid now this works fantastically heres a snippet

protected MxDataGrid AnswerGrid;
-= the DataBind Wireup
this.AnswerGrid.DataBinding += new System.EventHandler(this.SubAnswersGrid_DataBinding);
The Event Handler which gets fired if theres a child to the Row I'm Binding
private void SubAnswersGrid_DataBinding(object sender, System.EventArgs e)
{
DataGridItem dgi = (DataGridItem) this.BindingContainer;
DataSet ds = (DataSet) dgi.DataItem;
AnswerGrid.DataSource = ds;
AnswerGrid.DataMember = "Answers";
}

Now the Problem is Doing an Edit/Update on this child grid
Heres what I'm doing,

Event Handler fired for the "Edit" Command
private void SubAnswersGrid_Edit(object source, MxDataGridCommandEventArgs e)
{
AnswerGrid.EditItemIndex = e.Item.ItemIndex;
AnswerGrid.DataBind();
}



But in turn the DataBind Isn't working because I loose my ds (meaning an empty datagrid)
when the edit button is clicked I've tried a whole bunch of different things and I'm really really stuck .. so if anyone can can spend a few minutes to help me out it'd be fantasic

P.S I've tried rebinding on postback but made no difference
Thanks
The Eternal Newbie

eQuin0x
0
eQuin0x
12/11/2003 5:36:44 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
863 Views

Similar Articles

[PageSpeed] 33
Get it on Google Play
Get it on Apple App Store

Nested DataGrids can be a real pain and you are certainly feeling a bit to be sure.

My first suggestion is to place your dataset in a Session variable. That will keep it available for the child grids.
You need to have a relation between the upper datatable and the child data table. This key needs to be paased to the child grid and from this you should be able to get your data.
If you consider making the child grids into a UserControl, and then declaring a property in this control to hold this key value. Also expose a public method to populate it's datagrid.
Hope this helps.
0
dnelson
12/11/2003 5:54:28 AM
Well thanks for all the replies! 

I've solved the problem above by throwing the dataset into the Control Cache .. the only problem is a slight event misfire ... for some reason I have to click the edit button twice to get the event to fire ... actually for any of the EditCommand Events i.e Update, Cancel etc
and as I usually follow this forum pretty closley I actually remember someone else had a similar problem .. but I cant find the thread

Thanks,
The Eternal Newbie

eQuin0x
0
eQuin0x
12/11/2003 7:28:54 AM
yes thanks it did set me on the right track ... and after looking over last night I finally did it

by throwings the ds into the cache array from this I can of course keep my data ... and works fine ... the real mystery today this for some reason my edit event misfires on the first click i.e
page_load-> click edit -> page_load -> nothing -> click edit again -> page_load -> grid in edit mode have you ever come across this before or has anyone else? the best part is AnswerGrid <mdg> is actually a usercontrol if I put it on a clean webform it works perfectly the same as any other grid I've done ... but nested the event misfires .. any suggestions of how I could have coded myself into this mess would be great ...
Thanks again
The Enternal Newbie
Equin0x


private void SubAnswersGrid_DataBinding(object sender, System.EventArgs e)
{
DataGridItem dgi = (DataGridItem) this.BindingContainer;
DataSet ds = (DataSet) dgi.DataItem;
Cache["DataSet"] = ds;
BindData();
}
private void BindData()
{
AnswerGrid.DataSource = (DataSet) Cache["DataSet"];
AnswerGrid.DataMember = "Answers";
}
private void SubAnswersGrid_Edit(object source, MxDataGridCommandEventArgs e)
{
AnswerGrid.EditItemIndex = e.Item.ItemIndex;
if(AnswerGrid.DataSource == null)
{
BindData();
}
}


The Eternal Newbie

eQuin0x
0
eQuin0x
12/12/2003 12:09:38 AM
Reply:

Similar Artilces:

Please! Please! Please! Please! Help
I am very new to the Linux/Oracle/Perl world coming from a many many years of a Windows environment. I have self learned everything I know about this new environment. So far I have successfully installed Redhat 9 in an Intel box and have gotten Oracle 9I running correctly. I can run scripts via sqlplus, sqlldr etc. Perl (I think ver. 5.8.0) is running on the box and I can create and run scripts that do other processes but I have had no success in getting Perl to connect to the Oracle database to generate some reports. With my experience using MS-SQL there is no major issues w...

Please Please Please help me out...
hello, our netware 6.0 file server can'nt connect the internet, we have a proxyserver with netware 6.0 and BM 3.8. can somebody please help me out i'm a newbie. hello, our netware 6.0 file server can'nt connect the internet, we have a proxyserver with netware 6.0 and BM 3.8. can somebody please help me out i'm a newbie. the file server ip is 192.20.71.1 the proxy ip is 192.20.71.252 akula_26@hotmail.com wrote: > our netware 6.0 file server can'nt connect the internet, we have a > proxyserver with netware 6.0 and BM 3.8. can somebody please hel...

Please Please Please HELP!!!
I have posted this many times to no avail. I managed to publish the site somwhere despite being an intranet. I have published the site just in case I was not clear in explaining the prblem that I was having. Go to http://www.undg.ks.undp.org/test/login.aspx and login with userid: test password: test Click on 'search for cases' and then click on the search button (the dates are inserted automatically). Click on the paging and try to go to page 12,13,14,15 - any page really above page 11. Can you see what is happening? Below is the code that I am using. Please tell me wha...

Please Please Please help
I am trying to populate a second dropdownlist from the first. both dropdownlists are displayed inside the datagrid. I can populate the first one easily but my onselectedindexchanged event states: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 195...

Please help, please, please
This is driving me crazy, I cannot find what is wrong with this thing. I have a custom module and after post back none of the following are processed : user, login, visibility, title, solpartmenu. None of it gets processed. Please help meYou died at the very end of your life Are you saying a skin, or a custom module. With custom modules you should not be dealing with tokens, I don't think they have anything to do with it. What module are you working with? No I am not using tokens, container skin is Classic skin that comes with DNN. I am talking about custom module. It has a text box a...

Please please please
Folks, Please can we stop the petty bickering about banning or not banning............... The points have been made and in my opinion this is not the place to carry on with it. Once again - PLEASE! Regards Ian _____________________________________ Ian Sargent Education & Training Consulting Services Ltd Tel/Fax: 01344 644579 Mobile: 07970 847197 email: ians@etcs.co.uk www: http://www.etcs.co.uk _____________________________________ "Ian Sargent" <ians@nospam_etcs.co.uk> wrote in news:af7d6c$2da6$1 @news.grc.com: > Please can we st...

Please Please Please
I have only been asking for 4 years but PLEASE include a setting at the accounts level that sets the default compose to plain text if the account of type NEWS. Its a PITA to have to recall or remember to change my compose to plain text manually! Andre, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might try one of the following options: - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp - Check a...

please please please
Name: Product: Firefox Summary: please please please Comments: could you please resolve this crashing. the browsers crashes so often... I'm watching streaming video and it crashes in the middle of it... which costs me. I don't want to exceed me bandwith with friggin rogers. they're a pain. Browser Details: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you mus...

PLEASE PLEASE PLEASE
Name: Nick Crain Email: n.crain_at_rogers.com Product: Firefox Summary: PLEASE PLEASE PLEASE Comments: Can you please include a rss feed indicator thing like IE 7 has. You know where every time you visit a page that has an rss feed available it beeps and then you can subscribe to it? That is such a handy feature. It's just too bad it's on a damn microsux product. please put it in firefox. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Nick Crain wrote: > Name: Nick Crain > Email: n.crain_at_r...

Please, please, please ....
Name: Dean Talboys Email: deanatlouistalboysdotcom Product: Firefox Summary: Please, please, please .... Comments: Could you include a button on Firefox to register the currently viewed site as Firefox "Unfriendly"? I'm a developer of sophisticated Internet applications (check out http://www.psychl.com/ONE/cyclex.asp to see how much abuse a browser can take) and I always spend time to ensure my sites are IE and Firefox compatible. But I'm really frustrated at the number of sites that aren't Firefox compatible. You know, you get to the last screen of ...

Please please help with user controls!!
Am new to ASP.NET, my need is simple. 1. 1 main page with a header, footer and center area to the left. The page is divided using a simple HTML table, with a ASP.NET placeholder control each for the header, footer and center 2. I have created user controls for header, footer and specific book_details user control to show in center 3. In header, I have a textbox where someone can enter a book name 4.When book name is entered, I want the containing page (the main page holding the control) to display more details on the book - this has to be done by loading the book_details to the c...

LDAP Request Help
My head is about to fly off my neck and shoot through the ceiling! Ive been trying to make the following code work for weeks, and I cannot figure it out. The code is located at this website: http://v5.beta.docutek.com/eres/custom/fresnoLDAP.aspx. Everytime I try to run this sub I get the following error: "Unknown error (0x80005000) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServic...

Please, Please Help!
I have been trying to figure this out for weeks now and I dont know what is going on. I am trying to insert a row into a database and for some reason it gives me this error. I really need help on this, I have been trying to figure this out for SO long and I can't find anything anywhere.     Unable to open the physical file "C:\ASP.NET\App_Data\dbInfo.mdf". Operating system error 5: "5(Access is denied.)".An attempt to attach an auto-named database for file C:\ASP.NET\App_Data\dbInfo.mdf failed. A database with the same name exists, or specified file canno...

Please help...please
Name: jOHN MILEQUE Email: kingofallkings08athotmaildotcom Product: Firefox Summary: Please help...please Comments: Heloo...how do i remove firefox as my default browser...i dont want to make it my default browser...i want internet explorer to be my default browser but i need help on that....fast as possible.. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 ...

Please please help...
can someone please help me to link the asp to my database and return specific results in html. I'm really stuck and I have to hand the assignment in today at 12. I'm really stuck. asp.zip > I'm really stuck. You sure are — you're not even on the right forums. ASP developers talk on the ASP Messageboard.Alister What you want to do in this problem. Enter the data from user. Then insert into table. And finally show the result. Clear the problem.My Blog: DotNetError@BhatiaWorldDont forget to click "Mark as Answer" on the post that helped you.This credits tha...

Web resources about - Please Please Help - asp.net.presentation-controls

President Obama on San Bernardino Shooting: ‘It Is Just Too Easy’ to Buy Guns
President Barack Obama said authorities do not yet know the motivations of the suspects who opened fire on a holiday party in San Bernardino ...

Marco Rubio Hits Donald Trump Over Israel
Florida Sen. Marco Rubio attacked GOP front-runner Donald Trump’s assertion that the Israeli people must be willing to sacrifice more for peace. ...

Speccy restores compatibility with Windows 10, supports latest Intel processors
Piriform has released Speccy 1.29 , a new version of its free Windows system information tool. The headline new feature in version 1.29 also ...

Mark Hamill Goes Undercover as Stormtrooper to Greet ‘Star Wars’ Fans on Hollywood Blvd.
Mark Hamill disguised himself as a stormtrooper and took to Hollywood Boulevard to tell fans that this is their last chance to win tickets for ...

Syrian activists react with dismay to UK decision to launch air strikes on ISIS
Many Syrian campaigners have expressed concern the bombing campaign will do little to hinder ISIS while others suggested it would drive new recruits ...

‘Batman Vs. Superman’ full-length trailer drops: this looks really stupid, right?
For the love of all that is holy, Batman vs. Superman: Dawn of Justice looks like an exquisite mess. To be fair, I’m sure it will make billions. ...

7 apps I really want to see on the new Apple TV
Theres plenty to choose from in the tvOS App Store for the new Apple TV, but the set-top box still hasnt become my absolute go-to device for ...

Russell Knox three off lead in South Africa
Scotsman Russell Knox three off lead in South Africa Scotsman A good effort for his first competitive outing in South Africa, it saw Knox ...

Climate Change Policy Should Start With Energy Efficiency
A new report explores the important role of energy efficiency in policies attempting to address global climate change. According to Yu Wang, ...

Africa Launches 300 GW Renewable Energy Initiative
The heads of state of African nations have launched the African Renewable Energy Initiative in an attempt to provide 300 GW of renewable energy. ...

Resources last updated: 12/3/2015 4:49:18 PM