This is a migrated thread and some comments may be shown as answers.

VS 2010 Design Mode Messy HTML

1 Answer 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon Kennerly
Top achievements
Rank 1
Jon Kennerly asked on 20 Jan 2011, 04:33 PM
I like to stay in the hard-coded markup for ASP .Net and html. However, on a team I have no control of other developers flipping over to Visual Studio's 'Design Mode'. Versions of Visual Studio after 2003 improved to where flipping back and forth from 'Design Mode' to 'Text Mode' did not butcher the HTML markup. But for some reason Telerik ASP .Net controls still end up with weird formatting and inserting duplicate style tags on my RadGrid columns (for instance).

Is there anything that can be done about this? See this example.

            <Columns>
                <telerik:GridBoundColumn DataField="Patient.DisplayId" DataType="System.String" HeaderText="Patient ID"
                    SortExpression="Patient.DisplayId" />
                <telerik:GridBoundColumn DataField="Patient.FullName" DataType="System.String" HeaderText="Name"
                    SortExpression="Patient.FullName" />
                <telerik:GridDateTimeColumn DataField="Patient.Dob" DataType="System.DateTime" HeaderText="Date of Birth"
                    SortExpression="Patient.Dob" ItemStyle-Width="85px"
                    DataFormatString="{0:MM/dd/yyyy}" >
<ItemStyle Width="85px"></ItemStyle>
                </telerik:GridDateTimeColumn>
                <telerik:GridNumericColumn DataField="Age" DataType="System.Int32" HeaderText="Age"
                    SortExpression="Age" ItemStyle-HorizontalAlign="Right"
                    ItemStyle-Width="50px" >
<ItemStyle HorizontalAlign="Right" Width="50px"></ItemStyle>
                </telerik:GridNumericColumn>
                <telerik:GridNumericColumn DataField="Count" DataType="System.Int32" HeaderText="Claims"
                    SortExpression="Count" ItemStyle-HorizontalAlign="Right"
                    ItemStyle-Width="50px" >
<ItemStyle HorizontalAlign="Right" Width="50px"></ItemStyle>
                </telerik:GridNumericColumn>
                <telerik:GridNumericColumn DataField="AmountPaid"
                    DataType="System.Decimal" HeaderText="Amount Paid"
                    SortExpression="AmountPaid" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}"
                    ItemStyle-Width="85px" >
<ItemStyle HorizontalAlign="Right" Width="85px"></ItemStyle>
                </telerik:GridNumericColumn>
            </Columns>

The <ItemStyle HorizaontalAlign="Right" Width="85px"></ItemStyle> was not input by the developer, and it is a duplicate of settings already in the columns. It appeared after the developer made some other settings on the grid withing VS 'Design Mode'.

I understand 'Design Mode' isn't best, but it should not insert new markup and reformat the other markup so badly.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 26 Jan 2011, 09:30 AM
Hi Jon,

We are constantly trying to improve the way our components behave when switching between design view and markup view. We understand the VS designer is not perfect, and we are trying to minimize the issues related to using it. However, we are not able to tinker with every aspect of the VS designer. Markup formatting is one if these things we cannot modify. Also, some RadGrid properties have dynamically determined default values. Values for these properties may depend on values of other properties and settings. Therefore, it is not possible to specify the exact default value of all properties in all cases. As the VS designer relies on property attributes to determine the required behavior, we are unable to always provide accurate attribute data at build time. Thus, VS may interpret any current property value as non-default and explicitly add the property and its value to the markup. We are working towards minimizing these scenarios, but we cannot completely eliminate them.

Veli
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
Jon Kennerly
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or