﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Clicking on toolstrip from dirty Ultrawingrid cell causes cell to not save to BBS</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 18 May 2026 15:05:36 GMT</lastBuildDate><ttl>20</ttl><item><title>Clicking on toolstrip from dirty Ultrawingrid cell causes cell to not save to BBS</title><link>http://forum.strataframe.net/FindPost28425.aspx</link><description>I have an ultrawingrid in a groupbox.&amp;nbsp; If I am in a dirty cell, then click save, the changes to the current dirty cell are not saved.&amp;nbsp; As best I can tell this is because the buttons on the toolstrip do not actually get focus, so the lostfocus of the cell, grid, groupbox do not fire.&lt;br/&gt;&lt;br/&gt;If I just put a button on the form and put Me.Save() in the click all is well and the dirty cell saves as shown.&lt;br/&gt;&lt;br/&gt;So, I found the itemclicked event of the toolstrip and I can determine which button was clicked but setting focus to that button doesn't seem to be an option.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;Is there an elegant way to fire a focus() if the choice is Save so that the cell will save properly?&amp;nbsp; or should I just put my own save button over the save button on the toolbar (seems to come as a set with Undo) and then handle the enabling etc myself. ?&lt;br/&gt;&lt;br/&gt;TIA&lt;br/&gt;&lt;br/&gt;Charles</description><pubDate>Mon, 20 Sep 2010 08:15:28 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Clicking on toolstrip from dirty Ultrawingrid cell causes cell to not save to BBS</title><link>http://forum.strataframe.net/FindPost28438.aspx</link><description>That was great, Charles.&lt;br/&gt;&lt;br/&gt;I do have a small&amp;nbsp;invisible textbox on my base form that I always make visible, set focus and make invisible in its &amp;nbsp;BeforeSave method. That did the trick for me for all my forms.</description><pubDate>Mon, 20 Sep 2010 08:15:28 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Clicking on toolstrip from dirty Ultrawingrid cell causes cell to not save to BBS</title><link>http://forum.strataframe.net/FindPost28429.aspx</link><description>Thought you might get a kick out of that.&lt;br/&gt;&lt;br/&gt;I was looking for something *really* simple.&amp;nbsp; Remembered that it was often necessary to not have a control get focus so you could escape from some field that wouldn't validate.&amp;nbsp; Still don't know how they keep a maintenance strip from getting focus by default and was frankly a bit surprised to see that calling it explicitly works but so far seems to be the answer.&amp;nbsp; ( and I really trust the guy who answered it ... ) </description><pubDate>Sat, 18 Sep 2010 11:31:54 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Clicking on toolstrip from dirty Ultrawingrid cell causes cell to not save to BBS</title><link>http://forum.strataframe.net/FindPost28428.aspx</link><description>LOL, this from the guy who teased me about talking to myself on the F1 forums.&lt;br/&gt;&lt;br/&gt;I was going to say you could always subclass your form and create a writebuffer method that the save calls :)</description><pubDate>Sat, 18 Sep 2010 10:22:15 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Clicking on toolstrip from dirty Ultrawingrid cell causes cell to not save to BBS</title><link>http://forum.strataframe.net/FindPost28426.aspx</link><description>Charles, once again a particularly well explained and insightful question &lt;span&gt;:P&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;It seems setting focus to the toolstrip itself is the trick&lt;br/&gt;&lt;br/&gt;This is now in the MaintenanceformToolStrip_itemClicked() event&lt;br/&gt;&lt;br/&gt;&lt;span&gt; If e.ClickedItem.Name = "cmdSave" then            &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.MaintenanceFormToolStrip1.Focus()&lt;br/&gt;        End If&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;and now it seems happy.&amp;nbsp; If I click Save directly from a dirty cell the changes shown in the cell are retained.&lt;br/&gt;&lt;br/&gt;( now when I forget how this works I can Search on the forum &lt;span&gt;:cool:&lt;/span&gt; )</description><pubDate>Fri, 17 Sep 2010 19:10:29 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item></channel></rss>