Datagrid puzzler

G

Guest

I am using the following code for a datagrid:

DataView dv = CreateAppPermissionDataSource();
for (int i = 0; i < dv.Count; i++)
{
if (dv.Row[6].ToString() == "0")
{
dv.Row[0] = "NO";
}

}

I get an error that says cannot find column 6. But column 6 is definitely
there as the following line of codes shows:

applicationPermissionGrid.Columns.AddAt(6, optvalue);

What do I need to change to make this work.

Thanks,

Dave
 
C

Chris, Master of All Things Insignificant

Verify that the column got added correctly. Do a

dv.columns.count

I think if you try an addat X but there is no X-1, it will not go to X.

Chris
 

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

Top