Hi all, I'm having an issue trying to get the right look for our grid.
The Grid autogenerates all the columns, but in the edit mode the grid expands the whole page and sometimes it creates an horizontal scroll at page level, what I want to do is that the grid respects the specified grid's width and if necessary enlarge the horizontal scroll at grid level. My aspx code is something like this:
And i hooked the ColumnCreated event for preventing to wrap, like this:
I attached screenshots that represent the actual grid behaviour in edit mode...
Thanks in advance,
Diego.
The Grid autogenerates all the columns, but in the edit mode the grid expands the whole page and sometimes it creates an horizontal scroll at page level, what I want to do is that the grid respects the specified grid's width and if necessary enlarge the horizontal scroll at grid level. My aspx code is something like this:
<telerik:RadGrid id="{@id}" runat="server" AutoGenerateColumns="True" AllowMultiRowSelection="True" AllowMultiRowEdit="True" MasterTableView-EditMode="InPlace" Skin="Windows7"Width="50%"> <HeaderContextMenu EnableAutoScroll="True"/> <MasterTableView DataSourceID="{@id}_" HorizontalAlign="NotSet"> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> <ItemStyle CssClass="MyImageButton" /> </telerik:GridEditCommandColumn> </Columns> <EditFormSettings ColumnNumber="2" InsertCaption="New"> <FormTableItemStyle Wrap="False" /> <FormCaptionStyle CssClass="EditFormHeader" /> <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" /> <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" /> <FormTableAlternatingItemStyle Wrap="False" /> <EditColumn ButtonType="ImageButton" InsertText="Insert record" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit" /> <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow" /> </EditFormSettings> </MasterTableView> <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="false"> <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"/> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings></telerik:RadGrid>And i hooked the ColumnCreated event for preventing to wrap, like this:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e){ if (e.Column is GridBoundColumn) { (e.Column as GridBoundColumn).DataFormatString = "<nobr>{0}</nobr>"; }}I attached screenshots that represent the actual grid behaviour in edit mode...
Thanks in advance,
Diego.