GridView-FormView/Master-Detail with ObjectDataSource
GridView-FormView/Master-Detail with ObjectDataSource
am 18.01.2008 22:52:24 von Aamir Ghanchi
Hi,
I find it amazing that there is no single example over the web that
discusses how to use Master(Gridview) and Detail (FormView) model
using objectdatasource and the whole nine yards Edit/Insert also.
There is one availabe with DetailsView.
If any one has a link, then please send it my way. I'll appreciate it
The problem I am having is that Formview's EditItemTemplate does not
appear when a Select command button is clicked on a row in Gridview.
In the selectedIndex changed event of gridview, I am changing the
FormViewMode to Edit:
FormView1.ChangeMode(FormViewMode.Edit); I'm doubling it in the
Selected event handler of the Formview's objectdatasource.
The the select paramater of objectdatasource to which the FormView is
bind has a Control parameter that gets its value from the
SelectedValue property of GridView.
I have been tracing the code . The Selected event of FormView's
objectdatasource fires. The DataBound event of Formview fires.
Re: GridView-FormView/Master-Detail with ObjectDataSource
am 19.01.2008 00:08:53 von Aamir Ghanchi
Hi I am the original poster. One more update on this.
The template its displaying instead of EditItemTemplate is
EmptyDataTemplate.
As I have the Trace on, it shows the FormView Mode still as Edit in
the FormView1_PreRender event handler.
On Jan 18, 3:52=A0pm, Aamir Ghanchi wrote:
> Hi,
>
> I find it amazing that there is no single example over the web that
> discusses how to use Master(Gridview) =A0and Detail (FormView) model
> using objectdatasource and the whole nine yards Edit/Insert also.
> There is one availabe with DetailsView.
>
> If any one has a link, then please send it my way. I'll appreciate it
>
> The problem I am having is that Formview's EditItemTemplate does not
> appear when a Select command button is clicked on a row in Gridview.
> In the selectedIndex changed event of gridview, I am changing the
> FormViewMode to Edit:
> FormView1.ChangeMode(FormViewMode.Edit); I'm doubling it in the
> Selected event handler of the Formview's objectdatasource.
>
> The the select paramater of objectdatasource to which the FormView is
> bind has a Control parameter that gets its value from the
> SelectedValue property of GridView.
>
> I have been tracing the code . The Selected event of FormView's
> objectdatasource fires. The DataBound event of Formview fires.
>
> I am not sure what am I missing?
>
> /////// aspx code "Test.aspx" ////////////
>
e"
> DataKeyNames=3D"ExperienceID" DataSourceID=3D"objdsGridView"
> OnSelectedIndexChanged=3D"GridView1_SelectedIndexChanged"
> OnSelectedIndexChanging=3D"GridView1_SelectedIndexChanging">
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
ndField ShowSelectButton=3D"True" />
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
Re: GridView-FormView/Master-Detail with ObjectDataSource
am 19.01.2008 00:49:14 von Aamir Ghanchi
My bad :(
I was not returning the "this" object from the SelectMethod of the
ObjectDataSource Class.
sorry for the confusion.
On Jan 18, 5:08=A0pm, Aamir Ghanchi wrote:
> Hi I am the original poster. One more update on this.
>
> The template its displaying instead of EditItemTemplate is
> EmptyDataTemplate.
> As I have the Trace on, it shows the FormView Mode still as Edit in
> the FormView1_PreRender event handler.
>
> On Jan 18, 3:52=A0pm, Aamir Ghanchi wrote:
>
>
>
> > Hi,
>
> > I find it amazing that there is no single example over the web that
> > discusses how to use Master(Gridview) =A0and Detail (FormView) model
> > using objectdatasource and the whole nine yards Edit/Insert also.
> > There is one availabe with DetailsView.
>
> > If any one has a link, then please send it my way. I'll appreciate it
>
> > The problem I am having is that Formview's EditItemTemplate does not
> > appear when a Select command button is clicked on a row in Gridview.
> > In the selectedIndex changed event of gridview, I am changing the
> > FormViewMode to Edit:
> > FormView1.ChangeMode(FormViewMode.Edit); I'm doubling it in the
> > Selected event handler of the Formview's objectdatasource.
>
> > The the select paramater of objectdatasource to which the FormView is
> > bind has a Control parameter that gets its value from the
> > SelectedValue property of GridView.
>
> > I have been tracing the code . The Selected event of FormView's
> > objectdatasource fires. The DataBound event of Formview fires.
>
> > I am not sure what am I missing?
>
> > /////// aspx code "Test.aspx" ////////////
> >
rue"
> > DataKeyNames=3D"ExperienceID" DataSourceID=3D"objdsGridView"
> > OnSelectedIndexChanged=3D"GridView1_SelectedIndexChanged"
> > OnSelectedIndexChanging=3D"GridView1_SelectedIndexChanging">
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
mandField ShowSelectButton=3D"True" />
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0