You can handle the GotFocus Event as shown below
private void ComboBox_GotFocus(object sender, RoutedEventArgs e)
{
(sender as ComboBox).IsDropDownOpen = true
}
You can handle the GotFocus Event as shown below
private void ComboBox_GotFocus(object sender, RoutedEventArgs e)
{
(sender as ComboBox).IsDropDownOpen = true
}
One approach you can try is to define celltemplate for the column as shown below
<GridViewColumn x:Name="gdcol">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock x:Name="txtbox" Text="{Binding Path}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
then in code where you want to update the target:
object obj = gdcol.CellTemplate.LoadContent();
TextBlock blk = obj as TextBlock;
BindingExpression exp = BindingOperations.GetBindingExpression(blk, TextBlock.TextProperty);
exp.UpdateTarget();
I have not tried the code, you can give it a shot.
Pass by value and pass by reference: Passing mechanisms decide how changes made to the parameter affect the caller. Consider the following code snippet Ex: class MyClass { public int value; } class Program { ..void funcPassbyValue(MyClass obj) { obj.value = 10; obj = new MyClass(); obj.value = 5; } ..void func2PassbyRef(ref MyClass obj) { obj.value = 10; obj = new MyClass(); obj.value = 5; } .. Main() { MyClass passedObj = new MyClass(); funcPassbyValue(passedObj ); Console.WriteLine(passedObj .value); //Outputs 10 func2PassbyRef(ref passedObj ); Console.WriteLine(passedObj .value); //Outputs 5 } } You can see both the methods funcPassbyValue && func2PassbyRef differ only in their signature. Things which happen in common to both the methods: Any changes made to the argument to the method will be reflected back (condition is the changes are done while the parameter - in this case obj - is not changed to refer other object). what does funcPassbyValue do differently: any changes made to the parameter (obj) will be local within the method and will not change (change here means to make it refer other object) the passedObj to refer other object. Hope this clears your doublt. what does func2PassbyRefdo differently: any changes made to the parameter (obj) will be reflected back to the caller in this case passedObj is changed to refer to the new object created inside the method.