摘要
DataGrid控件用表格型式显示数据,当两个DataGrid绑定同一数据源时,它们在数据处理与显示方面将保持同步。可是当涉及到控件的滚动条事件时,系统并没有作相应处理,拖动其中一个窗口垂直滚动条时,该数据窗口的数据随之滚动,而另一个窗口的数据和流动条都没有跟着同步滚动,为此,必须编程来解决滚动条,滚动到特定位置的问题。C#的事件委托机制为我们提供了解决这一问题的方法和途径。本文简要介绍了C#的事件委托机制及其实现的方法和步骤,并应用该方法实现了一个具有固定列显示功能的双数据窗口同步显示的实例。
The event-delegate mechanism plays a important part in the Windows programmings.This article briefly introduces the event-delegate mechanism of C sharp and it's method and steps of realization,then using this mothod to realize a program instance of display synchronization of double DataGrids with the function of fixed data columns display.
出处
《航空计算技术》
2005年第2期69-71,共3页
Aeronautical Computing Technique