Populating a control dependant on data bound in Gridview
-
Hi, Problem: I have a web application that is tied into a Windows Workflow that tracks orders. In the portion of the application that allows the user to set/reset the state of an order I have a gridview and a formview. The gridview displays the meat of the order data as stored in the database, and the formview is where I'd like to store the buttons that will perform the updates and progress the order states.....etc. I'd like to set the visibility of the different buttons in the formview dependant on the current state of the Workflow. I can get the current state of the order no problem from the gridview's OnItemCreated event. I've tried to access the FormView control via:
FormView fv = this.Page.FindControl("fvOrderState") as FormView;
but hitherto I am unable to get any reaction from the FormView. I would appreciate any and all suggestions and/or leads for this problem. Thank you.
An American football fan - Go Seahawks! Lil Turtle
-
Hi, Problem: I have a web application that is tied into a Windows Workflow that tracks orders. In the portion of the application that allows the user to set/reset the state of an order I have a gridview and a formview. The gridview displays the meat of the order data as stored in the database, and the formview is where I'd like to store the buttons that will perform the updates and progress the order states.....etc. I'd like to set the visibility of the different buttons in the formview dependant on the current state of the Workflow. I can get the current state of the order no problem from the gridview's OnItemCreated event. I've tried to access the FormView control via:
FormView fv = this.Page.FindControl("fvOrderState") as FormView;
but hitherto I am unable to get any reaction from the FormView. I would appreciate any and all suggestions and/or leads for this problem. Thank you.
An American football fan - Go Seahawks! Lil Turtle
-
Have you called the formview.DataBind event after changes? In my use of hte formview that has usually been the problem. So when the data or dependancies change you have to databind the formview for the changes to show up. Hope that helps. Ben
Even if I don't have any dynamic data, just buttons within the control, I still need to databind the control? Thanks for the reply BTW:)
An American football fan - Go Seahawks! Lil Turtle
-
Even if I don't have any dynamic data, just buttons within the control, I still need to databind the control? Thanks for the reply BTW:)
An American football fan - Go Seahawks! Lil Turtle
-
Yes, I believe so. I haven't done exactly what you are trying to do, but in my case I always had to rebind to get the formview to change. Hope that helps. Ben
I tried to bind the FormView, with no luck:(( I solved the problem by statically declaring a GridView column to be Visible depending on the state of the order, but I don't like having to to do this.:( Thanks for the replies.
An American football fan - Go Seahawks! Lil Turtle