问题
I have a Grid view and each column have different length of data. i want to customize each columns according to data.
i have added property ControlStyle-Width="400"
but i didnt see any change when i do a debug run.
回答1:
Try the ItemStyle-Width attribute on the column elements
<asp:TemplateField ItemStyle-Width="123" ... />
<asp:BoundField ItemStyle-Width="123" ... />
// etc.
来源:https://stackoverflow.com/questions/6088117/how-can-i-give-fixed-size-for-each-columns-in-my-gridview