A
Andy
How to catch row selection in datagrid?
TIA
TIA
Miha Markic said:Hi Andy,
I would implement BindingManagerBase.PositionChanged event.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
Andy said:How to catch row selection in datagrid?
TIA
Andy said:Hi, Miha
I'v already tried this, but PositionChanged event is triggered only once,
after datasource was filled.
Here is my code fragment:
public class MyForm : System.Windows.Forms.Form {
.....
public MyForm()
{
InitializeComponent();
this.BindingContext[this.dsWS1,"GIN_SERVICE"].PositionChanged
+= new EventHandler(this.Pos_Changed);
...
}
private void Pos_Changed(object sender,System.EventArgs e)
{
MessageBox.Show(this.BindingContext[this.dsWS1,"GIN_SERVICE"].Position.ToStr
ing());
}
}
Is anything wrong?
Miha Markic said:Hi Andy,
I would implement BindingManagerBase.PositionChanged event.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
Andy said:How to catch row selection in datagrid?
TIA
Miha Markic said:Hi Andy,
Do show me the code that binds data to grid - parameters should be the same
for binding and BindingContext
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
MessageBox.Show(this.BindingContext[this.dsWS1,"GIN_SERVICE"].Position.ToStrAndy said:Hi, Miha
I'v already tried this, but PositionChanged event is triggered only once,
after datasource was filled.
Here is my code fragment:
public class MyForm : System.Windows.Forms.Form {
.....
public MyForm()
{
InitializeComponent();
this.BindingContext[this.dsWS1,"GIN_SERVICE"].PositionChanged
+= new EventHandler(this.Pos_Changed);
...
}
private void Pos_Changed(object sender,System.EventArgs e)
{ing());
}
}
Is anything wrong?
Miha Markic said:Hi Andy,
I would implement BindingManagerBase.PositionChanged event.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
How to catch row selection in datagrid?
TIA