Book Image

ASP.NET Data Presentation Controls Essentials

By : Joydip Kanjilal
Book Image

ASP.NET Data Presentation Controls Essentials

By: Joydip Kanjilal

Overview of this book

<p class="MsoNormal"><span class="postbody">The ASP.NET Data Presentation Controls are server controls to which you can bind data to organize and display it in different ways.<o:p></o:p></span></p> <p class="MsoNormal"><span>This book shows you how to get the most from these controls to easily display and manage complex data in your web applications. It takes you through each of the major data presentation controls in ASP.NET, gets you started using them, and then shows you how to use them in your applications for managing your data.<span></span><o:p></o:p></span></p>
Table of Contents (14 chapters)
ASP.NET Data Presentation Controls Essentials
Credits
About the Author
Acknowledgements
About the Reviewers
Preface

Sorting Data Using the Repeater Control


For sorting data, we have links that correspond to the columns in the employee result set, in the header section of the Repeater control.

<tr>
<th>
<asp:LinkButton id="Emp_Code" OnClick="EmpCodeSort"
Text="Employee Code" runat="server" /></th>
<th>
<asp:LinkButton id="Emp_Name" OnClick="EmpNameSort"
Text="Employee Name" runat="server" /></th>
<th>
<asp:LinkButton id="Emp_Basic" OnClick="EmpBasicSort"
Text="Employee Basic" runat="server" /></th>
<th>
<asp:LinkButton id="Dept_Code" OnClick="DeptCodeSort"
Text="Department Code" runat="server" /></th>
</tr>

All of these link buttons have associated event handlers that get called on their OnClick events. These event handlers set the sortColumn variable to the name of the column on which the sort has to be performed. Refer to the following code snippets:

protected void EmpCodeSort(object sender, EventArgs e)
{
sortColumn...