Hello everyone,
This problem is killing me so I have to ask...
I have an external form that I am using pretty much just like the example shown here: Grid / Editing with External Form
Of course I have different fields. I have 3 dropdowns all of which have data items that are available/filtered by whats been selected in a previous control cascading.
So for example: Select DD1 -> DD2 fills -> Select DD2 -> DD3 fills.
Now if I am inserting something this works fine, but if I go straight to edit an item from the grid, then the values in the grid can't be found in the dropdowns. The dropdown controls can be found, but not the items as if they were not binding or firing the selectedValue_Changed event so that the list option values can get populated. However if I go to insert something first then try to edit anything it all works like it's supposed to.
I am using OpenAccessDataSource's for the dropdowns. they look something like this:
So on the grids side of things. When I do the DisplayEditForm(GridDataItem selectedItem).... which looks like so:
if I haven't displayed the external form before using insert for instance, it fails at
Now after displaying the form via insert... even if I cancel and don't do the insert... just displaying it, when I come back to update or edit anything in the grid it works beautifully.
Someone please help before I throw my desktop out the window.
Thanks! :D
This problem is killing me so I have to ask...
I have an external form that I am using pretty much just like the example shown here: Grid / Editing with External Form
Of course I have different fields. I have 3 dropdowns all of which have data items that are available/filtered by whats been selected in a previous control cascading.
So for example: Select DD1 -> DD2 fills -> Select DD2 -> DD3 fills.
Now if I am inserting something this works fine, but if I go straight to edit an item from the grid, then the values in the grid can't be found in the dropdowns. The dropdown controls can be found, but not the items as if they were not binding or firing the selectedValue_Changed event so that the list option values can get populated. However if I go to insert something first then try to edit anything it all works like it's supposed to.
I am using OpenAccessDataSource's for the dropdowns. they look something like this:
<
telerik:OpenAccessLinqDataSource
ID
=
"oaldsMap"
Runat
=
"server"
ContextTypeName
=
"HRSystemModel.HRContext"
EntityTypeName
=
""
ResourceSetName
=
"EMaps"
Select
=
"new (EMapName, ECaption)"
Where
=
"EProcedureName == @EProcedureName"
>
<
WhereParameters
>
<
asp:ControlParameter
ControlID
=
"rtbProcedure"
Name
=
"EProcedureName"
PropertyName
=
"Text"
Type
=
"String"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
<
telerik:OpenAccessLinqDataSource
ID
=
"oaldsStage"
Runat
=
"server"
ContextTypeName
=
"HRSystemModel.HRContext"
EntityTypeName
=
""
OrderBy
=
"ECaption"
ResourceSetName
=
"EStages"
Select
=
"new (EStageName,ECaption)"
Where
=
"EMapName == @EMapName"
>
<
WhereParameters
>
<
asp:ControlParameter
ControlID
=
"cmbMapNames"
DefaultValue
=
""
Name
=
"EMapName"
PropertyName
=
"SelectedValue"
Type
=
"String"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
<
telerik:OpenAccessLinqDataSource
ID
=
"oaldsAction"
Runat
=
"server"
ContextTypeName
=
"HRSystemModel.HRContext"
EntityTypeName
=
""
ResourceSetName
=
"EActions"
Select
=
"new (EActionName, ECaption)"
Where
=
"EStageName == @EStageName && EMapName == @EMapName"
>
<
WhereParameters
>
<
asp:ControlParameter
ControlID
=
"cmbStageName"
DefaultValue
=
""
Name
=
"EStageName"
PropertyName
=
"SelectedValue"
Type
=
"String"
/>
<
asp:ControlParameter
ControlID
=
"cmbMapNames"
DefaultValue
=
""
Name
=
"EMapName"
PropertyName
=
"SelectedValue"
Type
=
"String"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
So on the grids side of things. When I do the DisplayEditForm(GridDataItem selectedItem).... which looks like so:
protected
void
DisplayEditForm(GridDataItem selectedItem)
{
PlaceHolder.FindControl(
"pnlExternalForm"
).Visible =
true
;
(PlaceHolder.FindControl(
"btnSaveChanges"
)
as
Button).Text =
"Update"
;
(PlaceHolder.FindControl(
"cmbMapNames"
)
as
RadComboBox).FindItemByText(selectedItem[
"MMap"
].Text).Selected =
true
;
(PlaceHolder.FindControl(
"cmbStageName"
)
as
RadComboBox).FindItemByText(selectedItem[
"MStage"
].Text).Selected =
true
;
(PlaceHolder.FindControl(
"cmbAction"
)
as
RadComboBox).FindItemByText(selectedItem[
"MAction"
].Text).Selected =
true
;
}
if I haven't displayed the external form before using insert for instance, it fails at
PlaceHolder.FindControl(
"cmbMapNames"
). Always.
It throws a need to create new object error... and I have checked to confirm that it's not the dropdown but the list item that it can't find.Now after displaying the form via insert... even if I cancel and don't do the insert... just displaying it, when I come back to update or edit anything in the grid it works beautifully.
Someone please help before I throw my desktop out the window.
Thanks! :D