asp.net custom grid vs GridView/ListView -
A few years ago, I decided to create my own datagroup because I did not like the standard provided by Microsoft. This is a very simple task that takes data as an input parameter and gives a string (HTML code to display a table on the webpage).
It's very flexible (there are some optional parameters to format paging, sorting and the way I want to format), and faster (only records which are used from the database Are retrieved). The function is very low (about 20 lines of code) I'm using it for at least 4 years.
Assume that there is a place holder on your webpage, you will call a custom function like this:
MyPlaceHolder (new Lidal control) (create custom list control (custom custom grid (MaydataTable)) CreateCustomGrid (MyDataTable)) will return something like this (if MyDataTable has 2 columns and 2 rows):
Lt; Table class = "myclass" rule = "all" & gt; & Lt; TR & gt; & Lt; Th & gt; Column 1 & lt; / Th & gt; & Lt; Th & gt; Column2 & lt; / Th & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td align = "center" & gt; Value 1 & lt; / Td> & Lt; Td align = "center" & gt; Value 2 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td align = "center" & gt; Value 3 & lt; / Td> & Lt; Td align = "center" & gt; & Lt; A href = 'MyLink' & gt; Value 4 & lt; / A & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; Internally, the function knows how to format each column (this function is being used only on one website) but it is also possible to change it for each individual column using optional parameters. This is very flexible and easy to use in all this for paging and sorting. Things have changed now and the DataGrid has been replaced by Gridview and / or Listview. I have seen them but I do not see anything that they do that my function is not so, so I will be tempted to use my function, but I can ignore something at the same time, an HTML It seems a little strange to use the custom function to generate the table. What is your opinion on this?