|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
can assist me. The ingredients: Two DropDownList Controls One DataGrid Purpose of Page: User selects a menu using a DropDownList Control (DDLMenu). Depending on the selection another DropDownList Control(DDLSection) appears revealing the sub-selections available to DDLMenu. Once a selection is made with DDLSection a DataGrid appears with the data that is available to the selection in DDLSection. The user is able to edit the data in the DataGrid by either pressing Delete or the Edit buttons in the datagrid as the user would with any standard DataGrid. Problem with the page: When the user clicks on Edit or Delete on the DataGrid(dgCMS) Both DropDownList selections are lost or one or the other is kept while the other is lost. I believe the problem lies with rebinding the DropDownList to the users' selection. If someone could be so kind to tell me or guide me in the correct direction in maintaining the users selection on rebind or let me know of a tutorial in C#. I would be truly greatful. Thank you in advance. Sam- Hi Sam.
It's hard to tell what the problem is, without the source. Maybe you are reseting the drop down on page load, without checking IsPostback? Sharon. Show quoteHide quote "I am Sam" <Iam***@discussions.microsoft.com> wrote in message news:2939F3F1-C40D-44AA-AECA-706D951E7BF8@microsoft.com... > I have a rather complicated problem I need to sort out and wonder if anyone > can assist me. > > The ingredients: > > Two DropDownList Controls > One DataGrid > > Purpose of Page: > > User selects a menu using a DropDownList Control (DDLMenu). Depending on > the selection another DropDownList Control(DDLSection) appears revealing the > sub-selections available to DDLMenu. Once a selection is made with > DDLSection a DataGrid appears with the data that is available to the > selection in DDLSection. The user is able to edit the data in the DataGrid > by either pressing Delete or the Edit buttons in the datagrid as the user > would with any standard DataGrid. > > Problem with the page: > > When the user clicks on Edit or Delete on the DataGrid(dgCMS) Both > DropDownList selections are lost or one or the other is kept while the other > is lost. I believe the problem lies with rebinding the DropDownList to the > users' selection. If someone could be so kind to tell me or guide me in the > correct direction in maintaining the users selection on rebind or let me know > of a tutorial in C#. I would be truly greatful. Thank you in advance. > > Sam- Hi Sharon,
I would provide the source code but it is very long(over 300 lines). I placed the DropDownList DataBind in a seperate method called BindData() then called it in Page_Load() after testing if page (!IsPostBack) so I know that isn't the problem. I think I should create two seperate methods that rebinds the DropDowns based on user selection but I'm worried about continual calls to the database. So I am also thinking of stuffing the Data information into an array and binding the array to the DropDowns instead. I'm not sure though. Show quoteHide quote "Sharon" wrote: > Hi Sam. > It's hard to tell what the problem is, without the source. > Maybe you are reseting the drop down on page load, > without checking IsPostback? > Sharon. > > "I am Sam" <Iam***@discussions.microsoft.com> wrote in message > news:2939F3F1-C40D-44AA-AECA-706D951E7BF8@microsoft.com... > > I have a rather complicated problem I need to sort out and wonder if > anyone > > can assist me. > > > > The ingredients: > > > > Two DropDownList Controls > > One DataGrid > > > > Purpose of Page: > > > > User selects a menu using a DropDownList Control (DDLMenu). Depending on > > the selection another DropDownList Control(DDLSection) appears revealing > the > > sub-selections available to DDLMenu. Once a selection is made with > > DDLSection a DataGrid appears with the data that is available to the > > selection in DDLSection. The user is able to edit the data in the > DataGrid > > by either pressing Delete or the Edit buttons in the datagrid as the user > > would with any standard DataGrid. > > > > Problem with the page: > > > > When the user clicks on Edit or Delete on the DataGrid(dgCMS) Both > > DropDownList selections are lost or one or the other is kept while the > other > > is lost. I believe the problem lies with rebinding the DropDownList to > the > > users' selection. If someone could be so kind to tell me or guide me in > the > > correct direction in maintaining the users selection on rebind or let me > know > > of a tutorial in C#. I would be truly greatful. Thank you in advance. > > > > Sam- > > > sounds like you 're not maintaining the state of your listboxes after the
postback ch Jim Show quoteHide quote "I am Sam" <Iam***@discussions.microsoft.com> wrote in message news:2939F3F1-C40D-44AA-AECA-706D951E7BF8@microsoft.com... > I have a rather complicated problem I need to sort out and wonder if anyone > can assist me. > > The ingredients: > > Two DropDownList Controls > One DataGrid > > Purpose of Page: > > User selects a menu using a DropDownList Control (DDLMenu). Depending on > the selection another DropDownList Control(DDLSection) appears revealing the > sub-selections available to DDLMenu. Once a selection is made with > DDLSection a DataGrid appears with the data that is available to the > selection in DDLSection. The user is able to edit the data in the DataGrid > by either pressing Delete or the Edit buttons in the datagrid as the user > would with any standard DataGrid. > > Problem with the page: > > When the user clicks on Edit or Delete on the DataGrid(dgCMS) Both > DropDownList selections are lost or one or the other is kept while the other > is lost. I believe the problem lies with rebinding the DropDownList to the > users' selection. If someone could be so kind to tell me or guide me in the > correct direction in maintaining the users selection on rebind or let me know > of a tutorial in C#. I would be truly greatful. Thank you in advance. > > Sam- I think your right but how do I maintain state? Using _ViewState?
Show quoteHide quote "Jimmy" wrote: > sounds like you 're not maintaining the state of your listboxes after the > postback > > ch Jim > "I am Sam" <Iam***@discussions.microsoft.com> wrote in message > news:2939F3F1-C40D-44AA-AECA-706D951E7BF8@microsoft.com... > > I have a rather complicated problem I need to sort out and wonder if > anyone > > can assist me. > > > > The ingredients: > > > > Two DropDownList Controls > > One DataGrid > > > > Purpose of Page: > > > > User selects a menu using a DropDownList Control (DDLMenu). Depending on > > the selection another DropDownList Control(DDLSection) appears revealing > the > > sub-selections available to DDLMenu. Once a selection is made with > > DDLSection a DataGrid appears with the data that is available to the > > selection in DDLSection. The user is able to edit the data in the > DataGrid > > by either pressing Delete or the Edit buttons in the datagrid as the user > > would with any standard DataGrid. > > > > Problem with the page: > > > > When the user clicks on Edit or Delete on the DataGrid(dgCMS) Both > > DropDownList selections are lost or one or the other is kept while the > other > > is lost. I believe the problem lies with rebinding the DropDownList to > the > > users' selection. If someone could be so kind to tell me or guide me in > the > > correct direction in maintaining the users selection on rebind or let me > know > > of a tutorial in C#. I would be truly greatful. Thank you in advance. > > > > Sam- > > > that is one of them yes.
ch Jim Show quoteHide quote "I am Sam" <Iam***@discussions.microsoft.com> wrote in message news:3B189ABA-2E60-41FA-8795-5994131F8498@microsoft.com... > I think your right but how do I maintain state? Using _ViewState? > > "Jimmy" wrote: > > > sounds like you 're not maintaining the state of your listboxes after the > > postback > > > > ch Jim > > "I am Sam" <Iam***@discussions.microsoft.com> wrote in message > > news:2939F3F1-C40D-44AA-AECA-706D951E7BF8@microsoft.com... > > > I have a rather complicated problem I need to sort out and wonder if > > anyone > > > can assist me. > > > > > > The ingredients: > > > > > > Two DropDownList Controls > > > One DataGrid > > > > > > Purpose of Page: > > > > > > User selects a menu using a DropDownList Control (DDLMenu). Depending on > > > the selection another DropDownList Control(DDLSection) appears revealing > > the > > > sub-selections available to DDLMenu. Once a selection is made with > > > DDLSection a DataGrid appears with the data that is available to the > > > selection in DDLSection. The user is able to edit the data in the > > DataGrid > > > by either pressing Delete or the Edit buttons in the datagrid as the user > > > would with any standard DataGrid. > > > > > > Problem with the page: > > > > > > When the user clicks on Edit or Delete on the DataGrid(dgCMS) Both > > > DropDownList selections are lost or one or the other is kept while the > > other > > > is lost. I believe the problem lies with rebinding the DropDownList to > > the > > > users' selection. If someone could be so kind to tell me or guide me in > > the > > > correct direction in maintaining the users selection on rebind or let me > > know > > > of a tutorial in C#. I would be truly greatful. Thank you in advance. > > > > > > Sam- > > > > > > |
|||||||||||||||||||||||