【发布时间】:2014-12-31 14:51:03
【问题描述】:
我正在尝试将 WinForms 升级到 Telerik Controls,当我升级它时
this.treeAccounting.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TreeAccountingAfterSelect);
对于这个新的 RadControl 声明:
this.treeAccounting.SelectedNode += new Telerik.WinControls.UI.RadTreeViewEventArgs(this.TreeAccountingAfterSelect);
我收到一个关于最佳重载方法匹配的错误,其中 TreeAccountingAfterSelect 的参数无效。它还说不能从“方法组”转换为“Telerik.WinControls.UI.RadTreeNode”。这是 TreeAccountingAfterSelect 的函数事件。
private void TreeAccountingAfterSelect(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
{
string strSelectedNode = treeAccounting.SelectedNode.Text;
// Since the user can select any node (root, branch, leaf) of a tree in any order -
// cannot presume that they will select a root, then a leaf - so handle accordingly.
if (treeRootNames[(int)TreeNodes.TrialBalance] == strSelectedNode)
{
// Configure the Generator for doing a Trial Balance (detail) report
CrntReport = ReportTypes.TrialBalance;
CrntLocation = Locations.UNKNOWN;
// Based on default settings in the Report Property dialog (from App.Config) initialize
// screen controls.
lblCurrency.Visible = rptProperties.TBShowCurrencyCodes;
cboxCurrencyCode.Visible = rptProperties.TBShowCurrencyCodes;
this.Refresh();
// Setup the selections for the various parameters in the TrialBalance
// Parameters group.
SetupTBControls();
}
return;
}
我是 Telerik 的新手,我尝试了不同的事件并尝试更改通过函数传递的参数,但由于某种原因,它不允许我像 WinForms 那样使用它。有人能告诉我在哪里我不理解 WinForms 到 Telerik 的变化。
【问题讨论】: