5 Answers, 1 is accepted
From what I understood, I suppose you want to display a TextBox for a column in EditMode of the grid. If this is the case, you just have to drop a TextBox control in the EditItemTemplate of a TemplateColumn as shown below.
aspx:
<telerik:GridTemplateColumn UniqueName="Column1" HeaderText="TemplateColumn"> |
<ItemTemplate> |
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> |
</ItemTemplate> |
<EditItemTemplate> |
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
Thanks
Princy.
But I want the same in Winforms.
It should display as many textbox as No. of rows are there.
Please refer to the following article of our documentation. If you assign a datasource, the grid will generate automatically a textbox for each appropriate column.
Best regards,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
But it is not giving the look and feel same as TextBox.
When user clicks on particular cell, it is displaying editable Cell.
By just seeing, user cant know that it is editable field. and also it is nt having border like normal textbox. throught screen shot u'll easily understand.
Hi Rajani,
I have prepared a sample project which demonstrates how to show a RadTextBox for each cell in a particular column. The approach shows how to:
- Create your own GridDataCellElement descending from the GridDataCellElement class.
- Set this custom type to the CellType property in the CreateCell event handler.
- Subscribe to the CellFormatting event, where the Text of the currently formatted cell's RadTextBox should be set.
Please note that this is not out-of-the-box feature, but a workaround. Therefore, you will experience undesired behavior concerning the focus of the cells - i.e. the first time when you try to write in a RadTextBox, RadGridView will take the focus and will open the first editor of the current row. In addition, when you type text in a RadTextBox, the row in which the RadTextBox appears will not become the current one.
You can avoid getting the focus from the RadTextBox by setting RadGridView.ReadOnly to true. However, you will not be able to open any type of RadGridView editors at will.
Regards,
Nikolaythe Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.