Skip to main content
A little feature of the K2DataGrid found when trying to change the text for the Add and Edit command. When the text of the link button is changed into the local language (here German) the Edit and Add commands do not function correctly. To see this problem, add a K2DataGrid, add an Edit and an Add button and change the text for each. If these are template columns then the clicking in the links will not perform the required functionality of Edit and Add. However the following code can be used as a workaround:

/// <summary>
///
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
private void K2DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if ( e.CommandSource is LinkButton)
{
if ( ((LinkButton)e.CommandSource).Text.ToLower().Equals( "bearbeiten" ))
{
((LinkButton)e.CommandSource).Text = "Edit";
}

if ( ((LinkButton)e.CommandSource).Text.ToLower().Equals( "hinzufügen" ))
{
((LinkButton)e.CommandSource).Text = "Add";
}
}
}

Strangely enough, the other commands of Delete, Cancel and Update do not have this problem. Do the SmartForm controls support i18n?
Be the first to reply!

Reply