Dynamic datagrid

I currently designing a datagrid template. I wonder how to set/add some bahaviour, class to table column in datagrid webcontrol.
Below is the HTML i expected to get when ASP.net rendering to HTML.

 <TABLE class="gridBar gridSort" id=gridBar cellSpacing=0 cellPadding=0>
        <COLGROUP id=gridBarCols>
        <COL width=2>
        <COL width=125><COL id=colAutoExpander>
        <COL width=2>
        <COL width=83>
        <COL width=2>
        <COL width=83>
        <COL width=2>
        <COL width=108>
        <COL width=2>
        <COL width=14></COLGROUP>
        <TR id=trHeader pagesize="">
          <TD class=sort title="Sort by Activity Subject"  ondragover=event.returnValue=false; field="subject" isExpanderParent="1"><NOBR>Activity Subject  <IMG class=sort  src="grid_container_files/bar_up.gif" width="13" height="5"></NOBR></TD></TR></TBODY></TABLE>

Hope someone can give me some guidelines on this. Thank You
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IF you want to tick/untick a checkbox you can use the following code

I am very sorry. I posted the above comment by mistake.
Please excuse me
Hi jinhong23,

you can use the repeater control - it is design exactly for this purpose - to render what the developer whants
    ad your column definitions
render your data
close the table tag

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

>>I wonder how to set/add some bahaviour, class to table column in datagrid webcontrol
do u mean style class  ... if s, then
for header u can use the headerstyle tag
<HeaderStyle CssClass="GridHeader">
for the footer .. if u have totals u can use the
<FooterStyle CssClass="GridFooter">

and any class grid can have its own class .. i.e.
<asp:datagrid  CssClass="gridBar" ....
jinhong23Author Commented:
Refer back to HTML code that i provided

<TD class=sort title="Sort by Activity Subject"  ondragover=event.returnValue=false; field="subject" isExpanderParent="1">

As you can translate from above HTML, when mouse rollover to the grid column, it is able to see a tag "Sort by Activity Subject", when ondragover or other bahaviour, it able to perform as what it is & etc

What i want to know is how can i pass all these attibutes and values to datagrid's item column. i know that Cssclas can be assigned using  ItemStyle-CssClass , like the code below
<asp:BoundColumn DataField="Column1" ItemStyle-CssClass ="sort"></asp:BoundColumn>.

How about other attribute like "title", behaviour like onclick, ondragover & etc.
try adding them as attributes to the itemstyle tags ... it might work ..

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.