J
Jennifer
Hi! I've got a datagrid on an asp page and I'd like to set a few of
the columns to center-align. The rest should be left align.
The datagrid (called dgDSR) has 61 columns. It is databound using a
data table.
The code I was trying out to center just the columns I want is:
dgDSR.Columns(2).ItemStyle.HorizontalAlign = HorizontalAlign.Center
I get the error message that the index is out of bounds. I thought
that was odd, since there really are 61 columns. So I got the value
of dgDSR.Items.Count and it was 1.
So I guess my question is, can I change the alignment of certain
columns? And if so, what is the proper way to do that?
Thanks,
Jennifer
the columns to center-align. The rest should be left align.
The datagrid (called dgDSR) has 61 columns. It is databound using a
data table.
The code I was trying out to center just the columns I want is:
dgDSR.Columns(2).ItemStyle.HorizontalAlign = HorizontalAlign.Center
I get the error message that the index is out of bounds. I thought
that was odd, since there really are 61 columns. So I got the value
of dgDSR.Items.Count and it was 1.
So I guess my question is, can I change the alignment of certain
columns? And if so, what is the proper way to do that?
Thanks,
Jennifer