We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GGC and pulldown box

Hi,

we are using a GGC to present our data. The grid works really fine. Nevertheless I have got a question about localization and the pulldown box. The column which is presented as a pulldown box is an enum type in our business object. Now I am wondering what's the best or preferred way to handle the localization of this type. I thought about implementing a custom celltype for that column and handle the localization there - is this the best way?

Perhaps you can give me a hint or a small code example what you would suggest.

Thank you very much in advance

Tom

6 Replies

AD Administrator Syncfusion Team January 22, 2007 06:21 PM UTC

Hi Tom,

Please try the attached sample and let me know if you are looking something different.
DropDownCultureInfo.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team January 23, 2007 08:16 AM UTC

Hi Haneef,

thank you for your example, but I think this isn't really what I suggest. I have attached the modified sample so you can see my problem.

First of all the the cell value is not "localized" - i have to click on the cell to see the localized values in the dropdown box. Furthermore if I choose a "localized" value then I get an exception.

Perhaps you can take a look at this ?

Best regards,
Tom

DropDownCultureInfo.zip


AD Administrator Syncfusion Team January 23, 2007 07:47 PM UTC

Hi Tom,

You need to change the CellValueType property of the "Data" column descriptor to "System.String" and also handle the DrawCellDisplay event to display the custom text in a cell. Please refer to the attached sample and let me know if you are looking something different.

Sample : ModifiedDropDownCultureInfo.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team January 24, 2007 08:53 AM UTC

Hi Haneef,

thanks for your sample, the problem with your suggestion is, that if you start the application you see the NOT localized value in each cell. After you have choosen an item from the drop down box, everything is fine. How can I handle the problem during startup?

Thanks in advance


AD Administrator Syncfusion Team January 24, 2007 03:02 PM UTC

Hi Tom,

This is the default behavior of the grid, however to get the desired behavior, you can use DrawCellDisplayText event and set the e.DispalyText to some new value to want to display. Here is a code snippet

void Grid_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
{
string hashCode = GetHashCode(e.RowIndex,e.ColIndex);
if( DisplayCellValue.Contains(hashCode))
{
e.DisplayText = DisplayCellValue[hashCode].ToString();
}
else
{
for (int i = 0; i < m_Names.Length;i++ )
{
if (m_Names[i].IndexOf(e.DisplayText)>-1)
{
DisplayCellValue[hashCode] = m_Names[i];
e.DisplayText = m_Names[i];
break;
}
}

}
}

Please try the attached sample and let me know if this helps.
ModifiedDropDownCultureInfo.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team January 24, 2007 03:07 PM UTC

Thanks Haneef,

this works fine :-)

Loader.
Live Chat Icon For mobile
Up arrow icon