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

Disable Edit after Insert

3 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 24 Feb 2008, 11:34 PM
Can someone let me know if this is possible and how I would do it.

In my grid, I have a column that I want to show a combobox for on Insert so that the user can select on item, but I don't want them to be able to change that value if they edit the row. I have InLine editing turned on.

Is there something I can put in the edit template to display a label if it's in Edit mode, but a ComboBox if it's in Insert mode?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Feb 2008, 12:43 PM
Hi Philip,

You can do this using Enabled property. Here is an example:

Enabled=<%#  (Container as GridItem).OwnerTableView.IsItemInserted %>

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Robert Cathey
Top achievements
Rank 1
answered on 04 Mar 2008, 06:29 AM
I'm pretty sure I have this coded correctly, but I keep getting an error:

<telerik:RadComboBox Width="145" MarkFirstMatch="true" Skin="scSkin" EnableEmbeddedSkins="false" DataTextField="adv_nm" DataValueField="adv_id" DataSourceID="AdvDataSource" ID="dd_adv_id" runat="server" SelectedValue='<%# Bind("adv_id") %>' Enabled='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "true" : "false" %>' /> 

Error: Compiler Error Message: BC30198: ')' expected.

If I take out the Enabled parameter, it works fine. Am I missing something here? Is there some hidden paren that I can't see?
0
Vlad
Telerik team
answered on 04 Mar 2008, 08:55 AM
Hi Robert ,

You should pass boolean type to Enabled not strings.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Philip
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Robert Cathey
Top achievements
Rank 1
Share this question
or