Addicted to Rich Data Controls

391 Views Asked by At

I learned .NET via the compulsory texts and resources. Almost all of them spend all of their time using rich data controls to display and work with data. I'm in a job situation now where this is being discouraged. Could someone provide some examples or suggest some resources for doing it in a less "lazy" way? I think the reason for this transition is because we will be going MVC down the road. Still writing with web forms however. Thanks all.

3

There are 3 best solutions below

2
On

My boss showed me what I was looking for.

<asp:Panel ID="ProcPanel" runat="server" />

Code behind

ProcPanel.Controls.Add(new LiteralControl("<table><thead><tr>"));
            //loop labels here
ProcPanel.Controls.Add(new LiteralControl("</thead>"));
ProcPanel.Controls.Add(new LiteralControl("</tr></table>"));

Why do it this way instead of using Gridview or others? Less abstraction, lighter load.

Thanks all.

1
On

Just get familiar with HTML, CSS, javascript and jQuery, they should be all you need to develop websites where you have the most control on what's being rendered and how it's being rendered.

P.S.: I use .NET MVC for web development at my current job

0
On

This is a more complete working solution.

ProcPanel.Controls.Add(new LiteralControl("<table><tr>"));
            DataSet lblSet = getBlendInfo.GetProcessLabels(Equip_ID);
            StringBuilder tblString = new StringBuilder("");
            foreach (DataRow dRow in lblSet.Tables[0].Rows)
            {
                tblString.Append("<td>");
                tblString.Append(dRow["Input_Column_Caption"].ToString());
                tblString.Append("</td>");
            }
            ProcPanel.Controls.Add(new LiteralControl(tblString.ToString()));
            ProcPanel.Controls.Add(new LiteralControl("</tr></table>"));