Datagrid bound columns

J

Julie Barnet

I would like to be able to either autogenerate my bound columns or
create them at runtime based on parameters passed into the page.

When doing either method, I cannot access any of the fields.

For example:
I have created a delete link button and used the edit/update template
for an additional link button on each row (at design time). Inside
the itemcommand event if I do a mydatagrid.columns.count ->I only get
a value of 2. I should be getting 3.

Also if I try to print:
Response.Write(MyDataGrid.Columns.Item(0).HeaderText) ->Delete
Response.Write(MyDataGrid.Columns.Item(1).HeaderText) ->Edit
Response.Write(MyDataGrid.Columns.Item(2).HeaderText) ->Out of index
error

One last test (itemcommand event):
response.write(e.Item.Cells(2).text) ->Out of index error

This happens when autogenerating columns or if I create the last
column at runtime (I created a databind function, and I create the
column from there each time I want to databind my grid.)

Thanks in advance
Julie Barnet
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top