我需要对列是显示日期的字符串进行排序。如果我通过单击该列的顶部对其进行排序,则效果不佳。因此,我希望在单击列标题时进行排序-按不同列中的不同值对列进行排序。
喜欢:
列:dateDescription
栏:date
我希望单击dateDescription
列的开头时,它按date
列中的值而不是默认值排序:dateDescription
我尝试用类似的代码编写:
private void M_MortagagePaymentGrid_ColumnHeaderClick(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e)
{
if (e.Column.Index == 4)// this column: dateDescription
{
//hear I want to sort by the values of the column date
// what to write hear??
}
}
我不特别了解Janus.GridEx,但您可能应该只使用已更改的Eventargument调用基本ColumnHeaderClick事件。查看Janus文档以获取您需要调用的基本函数的名称。下面给出示例代码。
private void M_MortagagePaymentGrid_ColumnHeaderClick(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e)
{
if (e.Column.Index == 4)// this column: dateDescription
{
e.Column.Index = 3; //use the column index for the date column
}
//Call the base Event handler here with (sender, e)
}