Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create gridview from code-behind

Status
Not open for further replies.

rrhandle8

Programmer
May 9, 2008
10
US
I am trying to build a drop-down that control what data is shown in a grid view. Here is a work example that does exactly what I need, but it is all handled on the web page. I need to do exactly the same thing, but do it all from the code-behind page. Can someone point me to a tutorial that explains setting up an editable gridview from the code-behind page?

 
why? the point of the markup is to act as the template. the point of the code behind is to supply data to the template. trying to build a template completely in code behind is working against the framework, not with it.

there are other ways to accomplish what you want.
1. hide the grid view until you want to display it
2. only bind to the grid view after the data is filtered
3. encapsulate the UI changes in web user controls

I guess the bottom line is that your current approach, while not impossible, is very complex and will be difficult to maintain over time.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Jason, I think you are right. I was trying to do something rather complex. I'll take your advice, and break the process into separate steps.
Thanks for your suggestion. I have been thinking the same thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top