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

Grid EditFormSettings

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Tabatadze
Top achievements
Rank 1
David Tabatadze asked on 07 May 2010, 02:54 PM

I am using RadGrid in my web page (asp)

and in EditFormSettings - FormTemplate i have two RadComboBoxes with their datasources.

here is part of my code:

<FormTemplate>

<telerik:RadComboBox ID="cbCompany" runat="server" 
Enabled='<%#(Container.DataItem is Telerik.Web.UI.GridInsertionObject)%>' >

<telerik:RadComboBox ID="cbCompanyField" runat="server" 
OnSelectedIndexChanged="cbCompanyField_SelectedIndexChanged" />

<FormTemplate>

so, cbCompany is enabled only when i'm making Add New (rad commanditem), in case of editing it's enable is false.

plus when i'm changing cbCompanyField combo, cbCompany items mast change accordig as cbCompanyField selected value.

(on cbCompanyField_SelectedIndexChanged i change cbCompany datasource)

the problem is that, when i change cbCompanyField item in Add New mode, and the page is posting back, cbCompany's  enable is turning to false.

i wonder, is there any solution for this?

2 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 07 May 2010, 05:30 PM
I don't know if this will make any difference, but instead of the line Enabled='<%#(Container.DataItem is Telerik.Web.UI.GridInsertionObject) %>' to change it to this: Enabled='<%# (Container is GridEditFormInsertItem) %>'. That's how the Telerik demo's determine the edit mode of the form.
0
David Tabatadze
Top achievements
Rank 1
answered on 07 May 2010, 09:17 PM
oh, thx so much, it works!
Tags
Grid
Asked by
David Tabatadze
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
David Tabatadze
Top achievements
Rank 1
Share this question
or