Showing Thousand Separator in RadBindingNavigator for WinForms
Environment
Product Version | Product | Author |
---|---|---|
2023.3.1114 | RadBindingNavigator for WinForms | Dinko Krastev |
Description
In this tutorial, we will demonstrate how we can add a thousand separators in the current page input text box.
Solution
To achieve this, you can subscribe to the TextChanged
event of the CurrentNumberTextBox
and modify the text by adding a thousand separator. Here's an example of how you can do this:
- Subscribe to the
TextChanged
event of theCurrentNumberTextBox
:2. In the event handler, add the logic to add a thousand separator to the text:3. Now the internal logic will not be able to parse the number with the thousand separator. To do that we will need to create a custom class that derives from RadBindingNavigator. Then we will need to override the `currentNumberTextBox_KeyDown` method to exclude the comma sign when the user presses the Enter key to navigate to the specified page.Note: The provided solution overrides thecurrentNumberTextBox_KeyDown
method to handle the Enter key press and remove the comma sign before parsing the entered number.