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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total beginners question about datagrids

Status
Not open for further replies.

columbo2

Technical User
Jul 14, 2006
97
GB
Hi All,

I am working on my first c# .net website.
I'll be given the HTML templates and I have to add the code behind.

I need to display an SQL database on the screen and allow it to be updated, delete records etc.

I can't see how I can use a datagrid as I already have the HTML table setup with CSS behind it. From what I've seen of datagrids (i'm laering as I go along) it seems that they aren't as flexible as html tables.

So I have a couple of questions...

1. Do people use datagrids on graphical sites or do they just use them for quickly produced database interaction sites?

2. I'm planning to use textboxes and read and write to them using c# - is this a 'normal' way of doing it or am I barking completely up the wrong tree?

Any help gratefully recieved - I've had my head in books/web for weeks and I sometimes wonder if I'm going off in the wrong direction.

ta
C
 
1st forum855 is better suited to asp.net specific questions.

2nd DataGrid is a 1.1 control GridView is the 2.0 control. if your using 2.0 DataGrid is discouraged. if your 1.1 you don't have a choice.

the GridView(DataGrid) is on of the commonly used/abused controls of asp.net. you have almost complete flexibility in how it operates.

Having said that, your team already setup the html. and wants you to plug in code. asp.net doesn't work like this out of the box. instead the html is generated by the code behind/markup. so where your team has a table, you would replace the entire table with the GridView.

asp.net is known for terrible html output in terms of styling. just about every control outputs to a table whether is really should or not.

Russ Helfand created the CSSFriendlyAdapters for a series of 2.0 controls. they are a great improvment for clean css layouts.

your team may also want to implement the MVP pattern. where the presentaion logic is seperated from the GUI. (allows for easy layout changes and unit testing). If this is the case then you're in for a crash course in non-MS programming.

VS.net and (MS for that matter) preach RAD (rapid application development). drag/drop controls, a wizard for designtime feature. This has its place (be it limited). I say this because asp.net does not play well with the MVP pattern at all. MS says the code behind is the presenter. I call BS. it's not unit testable and completely dependent on the HTTPContext.

back to my point. If your team wants to implement the MVP pattern then you need to either roll your own asp.net MVP framework, or use Castles MVP framework.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
4guysfromrolla
scottgu's blog
david hayden
GridView Guy
of course there are many more. I will say that all these blogs bleed ms blue. in other words they preach the ms way. Scott's manager of ms ajax and asp.net:) David Hayden is on the cutting edge of MS open source projects.

for more agile/tdd programming (not necessairly asp.net related)
google "agile development" or "test driven design". this is more in line with the MVP pattern i mentioned. the ideas are language egnostic so you will hit java examples. this is not a easy concept to grasp.

I only mention this because your team may be implmenting the MVP pattern with the web application. if so this is an invaluable technique. if not, check it out in your spare time.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top