Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Form Coodinating Grid and Textboxs
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00876460
Message ID:
00876570
Views:
14
Cathi,

Thanks for explaining that better than I did. <g>

~~Bonnie



>Kirk and Bonnie,
>
>Kirk, I would agree with trying what Bonnie suggested. This is a common problem developers run into. The CurrencyManager created behind the scenes is based on the exact binding used for the controls. If the bindings are different in how they are created, like the examples that Bonnie wrote, two different CurrencyManagers will be created. Then when one CurrencyManager's position is moved, the controls using the other manager are not affected. This could be what is happening here.
>
>>Kirk,
>>
>>Don't know for sure ... this is just a guess.
>>
>>There are two ways of DataBinding when binding to a DataTable and I remember something about not mixing and matching, so perhaps this is what happened. So you can have a Binding something this:
>>
>>this.DataBindings.Add("Text", MyDataSet, "MyDataTable.MyColumn")
>>
>>- or -
>>
>>this.DataBindings.Add("Text", MyDataSet.MyDataTable, "MyColumn")
>>
>>Given the fact that your next/previous button code uses the BindingContext syntax of the first example, I'm guessing that maybe the grid's DataBinding uses the second syntax (I haven't used a DataGrid for navigation, so I'm not sure which way it works). But, I bet if you change the TextBox's DataBinding to use the second example's syntax, it'll probably work. It sounds like you've set it in the Property Sheet instead of in code, so you'll have to look for it in the Designer Generated Code.
>>
>>If this doesn't help, lemme know ..
>>
>>~~Bonnie
>>
>>>Sorry, this is probably really simple, but I don't seem to have it figured out.
>>>
>>>I have build a form that contains a datagrid tied to DataSet11.VersionData in the Datasource. The grid is pulling data from a SQL Server table. I also have to text boxes for the collection of big text (memo) entries that aren't not easily typed into the grid. So I want the controls to stay in sync as I move the record pointer in the grid.
>>>
>>>When the form first loads, the first record in the grid has it's data in the text boxes. In the main textbox properties, I set the Databidings (expanded out) Text property to DataSet11-versionData.ModificationText (which is the field). But if I move to another record in the grid, the data in the text box does not change.
>>>
>>>I added a next/previous set of buttons and when I use these to move from record to record, the data in the text box is updated, below is the code I have in the next button:
>>>
>>>
>>>Me.BindingContext(DataSet11, "VersionData").Position += 1
>>>
>>>
>>>
>>>In the Grids Navigate code I put me.Update(), but that didn't do anything.
>>>
>>>Thanks for any advice.
>>>
>>>Kirk
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform