|
Prev: Logopaede Logopaedin arbeit im ausland Marketingleiter Marketingleiterin jobboerse nuernberg
Next: Cannot load my custom HttpHandler
From: SAL on 8 Jul 2008 17:07 Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know if that's what's causing the behavior or not. It seems like the Update button should at least do something. When the Edit button is clicked, the grid goes into Edit mode and the Cancel button takes the grid out of Edit mode. So, I don't get what the trick is here. I've enabled adding records via the FooterRow. The reason I'm using a join is to allow sorting on the joined in field. I know that I could drop kick the join, add in a template field and then populate it during RowDataBound but then the sort won't work... Any ideas? Thanks SAL
From: Steven Cheng [MSFT] on 9 Jul 2008 00:35 Hi SAL, From your description, you're encountering some problem to get the update function in GridView to work, correct? As for the Updating not work, do you means if you click "Update" button, the page doesn't postback or the page does postback but the database updating commands are not taking effect? Also, how do you implement the edit/update in GridView, are you directly use SqlDataSource's two-way databinding to automatically perform update or you manually use code to update the database (when updating event fires)? Generally, for such issue, I would first register the "RowUpdating" event of the Gridview(ensure it get fired) and then check all the parameters (via the event Argument parameter) to see whether the column data user entered have been supplied correctly in the parameter collection: =================== protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { //e.Keys; //e.NewValues; // e.OldValues; ................... ====================== If there is anything I omit, please feel free to let me know. Sincerely, Steven Cheng Microsoft MSDN Online Support Lead Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg(a)microsoft.com. ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- >From: "SAL" <SAL(a)nospam.nospam> >Subject: GridView update problem >Date: Tue, 8 Jul 2008 14:07:56 -0700 >Hello, >I have a Gridview control (.net 2.0) that I'm having trouble getting the >Update button to fire any kind of event or preforming the update. The >datatable is based on a join so I don't know if that's what's causing the >behavior or not. It seems like the Update button should at least do >something. >When the Edit button is clicked, the grid goes into Edit mode and the Cancel >button takes the grid out of Edit mode. So, I don't get what the trick is >here. >I've enabled adding records via the FooterRow. >The reason I'm using a join is to allow sorting on the joined in field. I >know that I could drop kick the join, add in a template field and then >populate it during RowDataBound but then the sort won't work... > >Any ideas? > >Thanks >SAL > > >
From: SAL on 9 Jul 2008 12:52 Hi Steven. As far as I can tell, it's not even doing a postback. If an event was firing, I could at least manually update the record. It would be nice to have it update itself however via two-way binding. I've implemented two way binding via an objectdatasource which is bound to a business object and the business object is using a table adapter that was created using the designer. S "Steven Cheng [MSFT]" <stcheng(a)online.microsoft.com> wrote in message news:e5Of00X4IHA.4688(a)TK2MSFTNGHUB02.phx.gbl... > Hi SAL, > > From your description, you're encountering some problem to get the update > function in GridView to work, correct? > > As for the Updating not work, do you means if you click "Update" button, > the page doesn't postback or the page does postback but the database > updating commands are not taking effect? > > Also, how do you implement the edit/update in GridView, are you directly > use SqlDataSource's two-way databinding to automatically perform update or > you manually use code to update the database (when updating event fires)? > Generally, for such issue, I would first register the "RowUpdating" event > of the Gridview(ensure it get fired) and then check all the parameters > (via > the event Argument parameter) to see whether the column data user entered > have been supplied correctly in the parameter collection: > > =================== > protected void GridView1_RowUpdating(object sender, > GridViewUpdateEventArgs e) > { > //e.Keys; > //e.NewValues; > // e.OldValues; > .................. > ====================== > > If there is anything I omit, please feel free to let me know. > > Sincerely, > > Steven Cheng > > Microsoft MSDN Online Support Lead > > > Delighting our customers is our #1 priority. We welcome your comments and > suggestions about how we can improve the support we provide to you. Please > feel free to let my manager know what you think of the level of service > provided. You can send feedback directly to my manager at: > msdnmg(a)microsoft.com. > > ================================================== > Get notification to my posts through email? Please refer to > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications. > > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues > where an initial response from the community or a Microsoft Support > Engineer within 1 business day is acceptable. Please note that each follow > up response may take approximately 2 business days as the support > professional working with you may need further investigation to reach the > most efficient resolution. The offering is not appropriate for situations > that require urgent, real-time or phone-based interactions or complex > project analysis and dump analysis issues. Issues of this nature are best > handled working with a dedicated Microsoft Support Engineer by contacting > Microsoft Customer Support Services (CSS) at > http://msdn.microsoft.com/subscriptions/support/default.aspx. > ================================================== > This posting is provided "AS IS" with no warranties, and confers no > rights. > > -------------------- >>From: "SAL" <SAL(a)nospam.nospam> >>Subject: GridView update problem >>Date: Tue, 8 Jul 2008 14:07:56 -0700 > >>Hello, >>I have a Gridview control (.net 2.0) that I'm having trouble getting the >>Update button to fire any kind of event or preforming the update. The >>datatable is based on a join so I don't know if that's what's causing the >>behavior or not. It seems like the Update button should at least do >>something. >>When the Edit button is clicked, the grid goes into Edit mode and the > Cancel >>button takes the grid out of Edit mode. So, I don't get what the trick is >>here. >>I've enabled adding records via the FooterRow. >>The reason I'm using a join is to allow sorting on the joined in field. I >>know that I could drop kick the join, add in a template field and then >>populate it during RowDataBound but then the sort won't work... >> >>Any ideas? >> >>Thanks >>SAL >> >> >> >
From: Steven Cheng [MSFT] on 9 Jul 2008 23:16 Thanks for your reply SAL, That seems unexpected since the postback should work as long as the update button is put correctly(via edit/update command field). Is it reproable via some simplified data source? You can send me a simplified copy so that I can also test it on my side. My email is "stcheng" + @ + "microsoft.com" Sincerely, Steven Cheng Microsoft MSDN Online Support Lead Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg(a)microsoft.com. -------------------- >From: "SAL" <SAL(a)nospam.nospam> >References: <OhWH06T4IHA.2580(a)TK2MSFTNGP06.phx.gbl> <e5Of00X4IHA.4688(a)TK2MSFTNGHUB02.phx.gbl> >Subject: Re: GridView update problem >Date: Wed, 9 Jul 2008 09:52:04 -0700 > >Hi Steven. As far as I can tell, it's not even doing a postback. If an event >was firing, I could at least manually update the record. It would be nice to >have it update itself however via two-way binding. > >I've implemented two way binding via an objectdatasource which is bound to a >business object and the business object is using a table adapter that was >created using the designer. > >S > >"Steven Cheng [MSFT]" <stcheng(a)online.microsoft.com> wrote in message >news:e5Of00X4IHA.4688(a)TK2MSFTNGHUB02.phx.gbl... >> Hi SAL, >> >> From your description, you're encountering some problem to get the update >> function in GridView to work, correct? >> >> As for the Updating not work, do you means if you click "Update" button, >> the page doesn't postback or the page does postback but the database >> updating commands are not taking effect? >> >> Also, how do you implement the edit/update in GridView, are you directly >> use SqlDataSource's two-way databinding to automatically perform update or >> you manually use code to update the database (when updating event fires)? >> Generally, for such issue, I would first register the "RowUpdating" event >> of the Gridview(ensure it get fired) and then check all the parameters >> (via >> the event Argument parameter) to see whether the column data user entered >> have been supplied correctly in the parameter collection: >> >> =================== >> protected void GridView1_RowUpdating(object sender, >> GridViewUpdateEventArgs e) >> { >> //e.Keys; >> //e.NewValues; >> // e.OldValues; >> .................. >> ====================== >> >> If there is anything I omit, please feel free to let me know. >> >> Sincerely, >>
From: SAL on 10 Jul 2008 13:31
Steven, I have sent a small project that exhibits this symptom. S "Steven Cheng [MSFT]" <stcheng(a)online.microsoft.com> wrote in message news:37vfutj4IHA.4056(a)TK2MSFTNGHUB02.phx.gbl... > Thanks for your reply SAL, > > That seems unexpected since the postback should work as long as the update > button is put correctly(via edit/update command field). Is it reproable > via > some simplified data source? You can send me a simplified copy so that I > can also test it on my side. My email is > > "stcheng" + @ + "microsoft.com" > > Sincerely, > > Steven Cheng > > Microsoft MSDN Online Support Lead > > > Delighting our customers is our #1 priority. We welcome your comments and > suggestions about how we can improve the support we provide to you. Please > feel free to let my manager know what you think of the level of service > provided. You can send feedback directly to my manager at: > msdnmg(a)microsoft.com. > > > -------------------- >>From: "SAL" <SAL(a)nospam.nospam> >>References: <OhWH06T4IHA.2580(a)TK2MSFTNGP06.phx.gbl> > <e5Of00X4IHA.4688(a)TK2MSFTNGHUB02.phx.gbl> >>Subject: Re: GridView update problem >>Date: Wed, 9 Jul 2008 09:52:04 -0700 > >> >>Hi Steven. As far as I can tell, it's not even doing a postback. If an > event >>was firing, I could at least manually update the record. It would be nice > to >>have it update itself however via two-way binding. >> >>I've implemented two way binding via an objectdatasource which is bound to > a >>business object and the business object is using a table adapter that was >>created using the designer. >> >>S >> >>"Steven Cheng [MSFT]" <stcheng(a)online.microsoft.com> wrote in message >>news:e5Of00X4IHA.4688(a)TK2MSFTNGHUB02.phx.gbl... >>> Hi SAL, >>> >>> From your description, you're encountering some problem to get the >>> update >>> function in GridView to work, correct? >>> >>> As for the Updating not work, do you means if you click "Update" button, >>> the page doesn't postback or the page does postback but the database >>> updating commands are not taking effect? >>> >>> Also, how do you implement the edit/update in GridView, are you >>> directly >>> use SqlDataSource's two-way databinding to automatically perform update > or >>> you manually use code to update the database (when updating event >>> fires)? >>> Generally, for such issue, I would first register the "RowUpdating" >>> event >>> of the Gridview(ensure it get fired) and then check all the parameters >>> (via >>> the event Argument parameter) to see whether the column data user > entered >>> have been supplied correctly in the parameter collection: >>> >>> =================== >>> protected void GridView1_RowUpdating(object sender, >>> GridViewUpdateEventArgs e) >>> { >>> //e.Keys; >>> //e.NewValues; >>> // e.OldValues; >>> .................. >>> ====================== >>> >>> If there is anything I omit, please feel free to let me know. >>> >>> Sincerely, >>> > |