
Smitha Test
Top achievements
Rank 1
Smitha Test
asked on 05 Nov 2009, 04:26 PM
Hi,
Is there a way to make the TextboxColumn added to Gridview like in code below to accept return<enter>..???
currently i have to do alt+ enter to accept the <enter> key.
Thanks,
GridViewTextBoxColumn textBoxColumn = new GridViewTextBoxColumn(); |
textBoxColumn.FieldName = "Comments"; |
textBoxColumn.FieldAlias = "Comments"; |
textBoxColumn.UniqueName = "Comments"; |
textBoxColumn.HeaderText = "Text"; |
this.radGridView1.Columns.Add(textBoxColumn); |
11 Answers, 1 is accepted
0
Hello Smitha Test,
Please, address the questions we have put forward in the "Tab strip inside tab-stip" ticket and we will gladly address your latest inquiry. You can find the mentioned ticket in your account.
Greetings,
Vassil
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Please, address the questions we have put forward in the "Tab strip inside tab-stip" ticket and we will gladly address your latest inquiry. You can find the mentioned ticket in your account.
Greetings,
Vassil
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Scott
Top achievements
Rank 1
answered on 09 Nov 2009, 07:36 PM
Good Afternoon,
Was there an answer to this inquiry? I'm having the same issue and was wondering what the solution was.
Thank you,
Scott Vercuski
Was there an answer to this inquiry? I'm having the same issue and was wondering what the solution was.
Thank you,
Scott Vercuski
0

Smitha Test
Top achievements
Rank 1
answered on 09 Nov 2009, 07:40 PM
No Scott
I am waiting on an answer after replying to my previous post of Tabstrip.
No reply from telerik yet!!!
do let me know if you get a reply
0

Smitha Test
Top achievements
Rank 1
answered on 16 Nov 2009, 05:14 AM
I am still waiting for a reply
could anybody help me . i want to have a multiline textbox in grid view that accepts return...
0
Accepted
Hi Smitha Test,
We noticed that you gave a response in the "Tab strip inside tab-strip" ticket. You can check our respective reply there.
As to the question at hand, in order to get the desired behavior, you should extend the BaseGridBehavior and override the ProcessEnterKey method. This will allow you to keep the multiline editor opened when you press the Enter key. In addition, you should subscribe to the CellEditorInitialied event where you need to set the Multiline and AcceptReturn properties to true. The full approach is demonstrated in the sample project attached.
I hope this helps. If you have additional questions, feel free to contact me.
Greetings,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Smitha Test
Top achievements
Rank 1
answered on 18 Nov 2009, 02:54 PM
Thanks it worked!!!
0

Bill
Top achievements
Rank 1
answered on 26 May 2010, 06:40 PM
Thanks for the example. I'm using Q1 2010 SP2 and I'm able to accept multiple lines of text but, once the user finishes entering data, I want the grid row to resize to show ALL rows of text that were entered. At the end of the form constructor in your sample project, I added these two lines of code:
this.radGridView1.AutoSizeRows = true; |
this.radGridView1.MasterGridViewInfo.TableHeaderRow.MinHeight = 40; |
The issues I have are:
- The rows resize but are always half of a textrow too short to show the entire text that was entered (see screenshot - I keyed "Last" on the last line I entered which you will see cut off).
- The Add New row's height got big too. We would hope that the height of the Add New row would stay constant.
Thanks for any assistance you can provide...
0

Bill
Top achievements
Rank 1
answered on 26 May 2010, 09:03 PM
This looks like a possible workaround (except for the AddNewRow height) but there's got to be a better way. I've added a RowFormatting event handler:
private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e) |
{ |
int padding = 16; |
Graphics g = radGridView1.CreateGraphics(); |
int oneRowH = (int)g.MeasureString("X", e.RowElement.Font).Height; |
g.Dispose(); |
//int oneRowH = Convert.ToInt32(e.RowElement.Font.GetHeight()) + 1; |
if (e.RowElement.RowInfo is GridViewDataRowInfo) |
{ |
char[] cArr = e.RowElement.RowInfo.Cells["CompanyName"].Value.ToString().ToCharArray(); |
int k = 0; |
foreach (char c in cArr) |
{ |
if (c == '\r') k++; |
} |
e.RowElement.RowInfo.Height = (k * oneRowH == 0 ? oneRowH : k * oneRowH) + padding; |
} |
else |
{ |
e.RowElement.RowInfo.Height = oneRowH + padding; |
} |
} |
0
Hi Bill,
Thank you for the question and please accept my apologies for the delayed response.
Indeed, the described issue exists in Q1 2010 SP2 and I am glad to inform you that it will be addressed in Q2 2010 due in the beginning of July. The workaround that you have implemented is efficient and you can use it until we release the new version.
However, I was not able to reproduce the behavior where all rows (including the new row) get height of 40 when the following property is set:
Please note that this setting should set only the height of the TableHeaderRow (columns' headers), but not the height of all rows.
There is a special setting for the new row:
If you need to set the MinHeight of the DataRows, you should do it as it is shown below:
I hope this helps. If you have additional questions, feel free to contact me.
Kind regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thank you for the question and please accept my apologies for the delayed response.
Indeed, the described issue exists in Q1 2010 SP2 and I am glad to inform you that it will be addressed in Q2 2010 due in the beginning of July. The workaround that you have implemented is efficient and you can use it until we release the new version.
However, I was not able to reproduce the behavior where all rows (including the new row) get height of 40 when the following property is set:
this
.radGridView1.MasterGridViewInfo.TableHeaderRow.MinHeight = 40;
Please note that this setting should set only the height of the TableHeaderRow (columns' headers), but not the height of all rows.
There is a special setting for the new row:
this
.radGridView1.MasterGridViewInfo.TableAddNewRow.MinHeight = 40;
If you need to set the MinHeight of the DataRows, you should do it as it is shown below:
for
(
int
i = 0; i <
this
.radGridView1.Rows.Count; i++)
{
this
.radGridView1.Rows[i].MinHeight = 40;
}
I hope this helps. If you have additional questions, feel free to contact me.
Kind regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Sathya
Top achievements
Rank 1
answered on 08 Jun 2010, 12:57 PM
Did u got any solution?
0

Sathya
Top achievements
Rank 1
answered on 08 Jun 2010, 12:58 PM
No