aaronjonmartin
Technical User
Hi guys hope someone can shed some light on this problem. I have a datagrid on a css positioned page. And in normal mode (i.e. displaying data) it fits on the page nicely. However when i click the edit button it breaks the page width and extends off the right hand side of the screen.
How can i prevent this from happening, i.e. how can i get the datagrid to stay the same width in edit mode? And if the content in the columns to be edited is too long to be displayed the field displaying it extends down instead of horizontally?
Below is the code for my datagrid
"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)
How can i prevent this from happening, i.e. how can i get the datagrid to stay the same width in edit mode? And if the content in the columns to be edited is too long to be displayed the field displaying it extends down instead of horizontally?
Below is the code for my datagrid
Code:
<asp:DataGrid id="WorkHistDG"
BorderWidth="1"
BorderColor="#C1DAD7"
CellPadding="3"
CellSpacing="0"
HorizontalAlign="Center"
Font-Name="Verdana"
Font-Size="12px"
HeaderStyle-BackColor="#54A2CF"
ItemStyle-BackColor="#EEF7FB"
AutoGenerateColumns="false"
AllowPaging="True"
OnPageIndexChanged="OurPager"
PageSize="5"
PagerStyle-NextPageText="Next 5 >"
PagerStyle-PrevPageText="< Prev 5"
PagerStyle-HorizontalAlign="Left"
OnEditCommand="Edit"
OnCancelCommand="Cancel"
OnUpdateCommand="Update"
DataKeyField="WorkID"
OnDeleteCommand="DeleteRow"
OnItemDataBound="ConfirmDelete"
runat="server">
<AlternatingItemStyle backcolor="#C7E0EF"></AlternatingItemStyle>
<columns>
<asp:boundcolumn Headertext="WorkID" DataField="WorkID" readonly="true" visible="False"/>
<asp:boundcolumn Headertext="Start Date" DataField="WorkStart" DataFormatString="{0:d}"/>
<asp:boundcolumn Headertext="End Date" DataField="WorkEnd" DataFormatString="{0:d}"/>
<asp:boundcolumn Headertext="Organisation" DataField="WorkCompany"/>
<asp:boundcolumn Headertext="Job Title" DataField="WorkJobTitle"/>
<asp:boundcolumn Headertext="Work Nature" DataField="WorkNature"/>
<asp:boundcolumn Headertext="Location" DataField="WorkLocation"/>
<asp:boundcolumn Headertext="Duties" DataField="WorkDuties"/>
<asp:boundcolumn Headertext="Reason for Leaving" DataField="WorkLeaving"/>
<asp:EditCommandColumn
ButtonType="PushButton"
EditText="Edit"
CancelText="Cancel"
UpdateText="Update"/>
<asp:ButtonColumn ButtonType="PushButton" Text="Delete" CommandName="Delete"/>
</columns>
</asp:DataGrid>
"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)