By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,839 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,839 IT Pros & Developers. It's quick & easy.

Problem with Nested Gridview

P: n/a

I am using ASP.NET 2.0. What I have done is nested a gridview inside
another column of a gridview using a template data field column
declaritively in my web form. Inside this child gridview I have set an
ItemStyle property of width 20% for the first templated field which
contains a hyperlink control, and an ItemStyle of width 80% for the
second templated field which contains a label. Both of these controls
are databound to columns in a dataview.

I overrode the DataRowBound event to bind the appropriate dataview to
the nested gridview for a particular row in the parent gridview - it's
my way of working with a master-detail relationship.

All of the data displays correctly, which means I am binding things
correctly. Unfortunately, the nested gridview doesn't seem to
appropriately take into consideration the widths of the columns. In
design view when I look at the nested gridview in the appropriate item
template column of the parent gridview, the column widths seem to be
split correctly at 20%/80%. However, when the data is displayed at
runtime, the column which is bound to a hyperlink control seems to take
up much more than 20% of the entire width of the nested gridview.

What am I doing wrong here, and how can I fix it so the nested gridview
splits the column widths appropriately?



Dec 30 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.