This is a migrated thread and some comments may be shown as answers.

Grid - always edit specific column

2 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mSchmidt
Top achievements
Rank 1
mSchmidt asked on 18 Oct 2008, 04:09 PM
I have a form where the user should be able to edit a range of Textboxes

It looks something like this:

Number   Name   Amount
123          Test      [TEXTBOX]
125          Test2    [TEXTBOX]
127          Test3    [TEXTBOX]

[Save input Button]

The Number and Name columns are simply clear text, however the Amount column should be an editable textbox.
It this possible with the RadGrid or ?

Do you maybe have an example of how this could be implemented ?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Oct 2008, 04:26 AM
Hi,

One suggestion is to set the ReadOnly property for the Number column and Name column to true and set the Grid in edit mode so that the Amount column will display the textbox in edit mode.

ASPX:
<telerik:GridBoundColumn DataField="Number" ReadOnly="true"  HeaderText="Number" UniqueName="Number"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Name" ReadOnly="true"  HeaderText="Name" " UniqueName="Number " ></telerik:GridBoundColumn> 
 
<telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" SortExpression="Amount" UniqueName="Amount" ></telerik:GridBoundColumn> 


CS:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
       //to set the Grid always in edit mode
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            item.Edit = true
        } 
        RadGrid1.Rebind(); 
   } 

Note: Set EditMode property to Inplace

Thanks
Shinu

0
Lenny_shp
Top achievements
Rank 2
answered on 02 Dec 2008, 09:12 PM
Don't forget AllowMultiRowEdit="true"
Tags
Grid
Asked by
mSchmidt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Lenny_shp
Top achievements
Rank 2
Share this question
or