Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 07, 2013 02:07 AM by chetan.sarode
Member
11 Points
82 Posts
Jan 06, 2013 09:50 AM|LINK
I have One One DataGrid , in this DataGrid i have one More Child DataGrid.
In Child DataGrid I have One ItemTemplate...In this ItemTemplate i have one TextBox.
I have to Limit the Number Of Characters in this TextBox, When user eneter into textbox.
onkeypress="return this.value.length<=20 (This is working )
<asp:TextBox ID="txtfeedback" Style="padding-right:10px" TextMode="MultiLine" Columns="38" Rows="2" runat="server" onkeypress="return this.value.length<=20" ></asp:TextBox>
When i enter characters , it allowing 20 characters and after that it not allowing eneter characters.
But i need to show in some Lable like if you type 12 characters in textox we need to show 8 characters remaining.
like that i want output, but the TextBox is inside GridView.
Please hellp me,
Thanks.
All-Star
86805 Points
9644 Posts
Moderator
MVP
Jan 06, 2013 10:10 AM|LINK
Set the MaxLength property on the TextBox in the ItemTemplate, like this:
<asp:TextBox id="myTextbox" runat="server" MaxLength="10" />
Jan 06, 2013 03:00 PM|LINK
Hi Darrel,
I set Maxlenth property for TextBox Inside Child DataGrid, but it's not working.
Can you please give me another approach to do.
Thanks,
65839 Points
11163 Posts
Jan 07, 2013 02:07 AM|LINK
Refer this
http://forums.asp.net/t/1861191.aspx/1?remaining+character+count+for+textbox+in+gridview+
http://forums.asp.net/t/1430229.aspx/1
sureshtalla
Member
11 Points
82 Posts
How to Limit Number Of Characters in TexBox Inside DataGrid
Jan 06, 2013 09:50 AM|LINK
I have One One DataGrid , in this DataGrid i have one More Child DataGrid.
In Child DataGrid I have One ItemTemplate...In this ItemTemplate i have one TextBox.
I have to Limit the Number Of Characters in this TextBox, When user eneter into textbox.
onkeypress="return this.value.length<=20 (This is working )
<asp:TextBox ID="txtfeedback" Style="padding-right:10px" TextMode="MultiLine" Columns="38" Rows="2" runat="server" onkeypress="return this.value.length<=20" ></asp:TextBox>
When i enter characters , it allowing 20 characters and after that it not allowing eneter characters.
But i need to show in some Lable like if you type 12 characters in textox we need to show 8 characters remaining.
like that i want output, but the TextBox is inside GridView.
Please hellp me,
Thanks.
DarrellNorto...
All-Star
86805 Points
9644 Posts
Moderator
MVP
Re: How to Limit Number Of Characters in TexBox Inside DataGrid
Jan 06, 2013 10:10 AM|LINK
Set the MaxLength property on the TextBox in the ItemTemplate, like this:
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
sureshtalla
Member
11 Points
82 Posts
Re: How to Limit Number Of Characters in TexBox Inside DataGrid
Jan 06, 2013 03:00 PM|LINK
Hi Darrel,
I set Maxlenth property for TextBox Inside Child DataGrid, but it's not working.
Can you please give me another approach to do.
Thanks,
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: How to Limit Number Of Characters in TexBox Inside DataGrid
Jan 07, 2013 02:07 AM|LINK
Refer this
http://forums.asp.net/t/1861191.aspx/1?remaining+character+count+for+textbox+in+gridview+
http://forums.asp.net/t/1430229.aspx/1
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.