ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-05-19 04:10:00

adsk0987
Member
Registered: 2016-05-19
Posts: 2

Limit characters length in a cell??

May I know is there any way to limit the character length in a cell? Thanks!

Offline

#2 2016-05-19 11:16:04

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Limit characters length in a cell??

You can use the CellEditCharInputed event.

sheet.CellEditCharInputed += (s, e) =>
 {
	 if (sheet.CellEditText.Length > 5)
	 {
		 e.InputChar = 0;
	 }
 };

When the text length > 5 then set e.InputChart to 0 will prevent new char to be accepted.

Offline

#3 2016-05-22 08:50:05

adsk0987
Member
Registered: 2016-05-19
Posts: 2

Re: Limit characters length in a cell??

Thx!

Offline

Board footer

Powered by FluxBB