在Syncfusion Datagrid winforms中对列进行分组时,其显示为:"column name" : record - 10 items。如何更改[项目]语言或将其更改为另一个单词?
Syncfusion Datagrid winforms
"column name" : record - 10 items
hpcdzsge1#
您提到的单词被定义为字符串类型的默认组标题格式。它没有本地化资源键,因此我们无法使用本地化更改此单词。但是,您在SfDataGrid中更改GridCaptionFormat中的单词的要求可以通过自定义DrawCell事件来实现。请参考以下代码片段,
//Event SubscriptionsfDataGrid1.DrawCell += OnDrawCell;// Event customizationprivate void OnDrawCell(object sender, DrawCellEventArgs e){ //Here customize based on your requirement if (e.DataRow.RowType == RowType.CaptionCoveredRow) { // Check language and change the text accordingly if (Thread.CurrentThread.CurrentUICulture.Name == "fr-FR") e.DisplayText = e.DisplayText.Replace("Items", "Unid"); } }
//Event Subscription
sfDataGrid1.DrawCell += OnDrawCell;
// Event customization
private void OnDrawCell(object sender, DrawCellEventArgs e)
{
//Here customize based on your requirement
if (e.DataRow.RowType == RowType.CaptionCoveredRow)
// Check language and change the text accordingly
if (Thread.CurrentThread.CurrentUICulture.Name == "fr-FR")
e.DisplayText = e.DisplayText.Replace("Items", "Unid");
}
字符串
**UG链接:**标题摘要KB链接:Group Caption Text
1条答案
按热度按时间hpcdzsge1#
您提到的单词被定义为字符串类型的默认组标题格式。它没有本地化资源键,因此我们无法使用本地化更改此单词。但是,您在SfDataGrid中更改GridCaptionFormat中的单词的要求可以通过自定义DrawCell事件来实现。请参考以下代码片段,
字符串
**UG链接:**标题摘要
KB链接:Group Caption Text