DataGrid Question

J

Josema

Hi,

I have a DataGrid that its filled from a DataTable.

this datagrid has autogeneratecolumns=true cause this datatable could have
different number of columns.

My problem its that:

I need that the first column be a link button column.

What its the best way to implement it?, i only imagine that i can derive
from DataGrid Class. Passing to a method of this grid class derived, the
datatable.
this way, depending of the columns of the datatable, i can add to the grid,
the columns in execution time.

Its this a good solution?
There is any easier?
 
S

Sundararajan

Hi,
Why cant u go by the way of adding template columns
<asp:TemplateColumn HeaderText="Employee Number">
<ItemTemplate>
<asp:LinkButton ID="txtempno" Text='<%# DataBinder.Eval(Container,
"DataItem.empno") %>' Runat="server"> </asp:LinkButton >
</ItemTemplate>
</asp:TemplateColumn>

something like this.. by this way ur linkbutton column will be the first one
to be rendered in the data grid. check this out.
regards,
sundararajan.s
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top