Click here to Skip to main content
15,846,899 members

Comments by Thomas Duwe (Top 40 by date)

Thomas Duwe 21-May-13 3:43am View    
You didn't mention this second case in detail, so I couldn't begin to guess as to what you really want.
But regardless, this second case is almost the same: remember the first/last row you want to be visible and
call dataGrid1.ScrollIntoView(itemToScrollTo);
Remember that itemToScrollTo needs to be the DataRow of your DataTable.
Thomas Duwe 22-Apr-13 6:17am View    
If you change the code in the *.Designer.cs file you must be careful, what you change.
AFAIK the designer of Visual Studio is not capable of doing what you want (array-initialization of datagridviews).
Changing the name of some field/variable works just fine, but changing the way some fields are initialized/read/write
can result in errors.
Thomas Duwe 22-Apr-13 5:17am View    
Are you changing the automatically generated code in the <FormName>.Designer.cs?
Thomas Duwe 9-Apr-13 5:57am View    
I used DataTriggers in the DataTemplate in conjunction with a converter in the DataTrigger's binding to return true/false if something needed a change.
For example you can trigger the changes if the DataContext of the DataGridCell changes:
<datatrigger value="True" binding="{Binding Path=DataContext, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType=DataGridCell, Mode=FindAncestor}, Converter={<converter here>}}" Value="True">

Whereas the converter needs to return true or false so that the binding will work.

And inside of DataTrigger you can then set the properties of "numTextBlock".
Thomas Duwe 8-Apr-13 2:57am View    
Do you want access to the TextBox or the bound value of the TextBox?