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

Inplace edit update changes grid size in 2007 3 1314 assembly

6 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ChrisWalker
Top achievements
Rank 1
ChrisWalker asked on 04 Feb 2008, 08:55 PM
I recently upgraded from the 2007 3 1218 assembly to the 2007 3 1314. My grid has several columns that can be edited in place using a double click. In the 1218 assembly, after a doubleclick and the editItem method is called on the row, the grid width stays the same as before and the HTML input controls are shown as expected by looking at the online demo-

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/EditOnDblClick/DefaultCS.aspx


When I upgraded the assembly to 1218, the grid width no longer stays the same when showing the edit fields for that row- its much wider now. When reseting (clearedititems called from the server) the grid goes back to its desired size. This happens for both IE7 and FireFox 2.0.0.11.  Is there something that I need to add in the grid for this new assembly?

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 06 Feb 2008, 09:33 AM
Hello Chris,

The link to the online example you referred to, is using the 2007 3 1314 version of the assembly. Can you review the code and let us know if something differs on your end, that could lead to the undesired width change?

Looking forward to your reply.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
ChrisWalker
Top achievements
Rank 1
answered on 06 Feb 2008, 04:28 PM
Steve,
I looked at the code example from the demo and think I found out what is causing this problem with the new assembly. It seems to deal with the number of total editable columns in the grid. Using the grid from the demo code, the original number of columns: 5 worked fine with the new assembly. I started adding editable columns until I had this for my mastertableview:

<

MasterTableView Width="100%" DataKeyNames="GroupID" EditMode="InPlace" AutoGenerateColumns="false">

<Columns>

<telerik:GridBoundColumn UniqueName="GroupID" DataField="GroupID" HeaderText="OrderID" ReadOnly="True" HeaderStyle-Width="10%" />

<telerik:GridBoundColumn UniqueName="ProductID" DataField="GroupID" HeaderText="ProductID" ReadOnly="True" HeaderStyle-Width="15%" />

<telerik:GridBoundColumn UniqueName="Quantity" DataField="PERMNUM" HeaderText="Quantity" HeaderStyle-Width="10%" />

<telerik:GridBoundColumn UniqueName="Quantity" DataField="PERMNUM" HeaderText="Quantity2" HeaderStyle-Width="10%" />

<telerik:GridDropDownColumn UniqueName="UnitPrice" HeaderText="GROUPID"

ListTextField="GroupID" ListValueField="GroupID" DataSourceID="SqlDataSource1" DataField="GroupID" HeaderStyle-Width="15%" />

<telerik:GridBoundColumn UniqueName="Discount" ReadOnly="true" DataField="GroupID" HeaderText="Discount" HeaderStyle-Width="10%" />

<telerik:GridBoundColumn UniqueName="Discount2" DataField="GroupID" HeaderText="Discount2" HeaderStyle-Width="10%" />

<telerik:GridBoundColumn UniqueName="Discount3" DataField="GroupID" HeaderText="Discount3" HeaderStyle-Width="10%" />

<telerik:GridBoundColumn UniqueName="Discount4" DataField="GroupID" HeaderText="Discount4" HeaderStyle-Width="10%" />

</Columns>

</MasterTableView>

It seems that when the editable columns are rendered, the <input> fields are the same size no matter what the original width was set to and will then readjust the column width to fit the new <input> field.
Like I said in my original post, this behavior started with the 1314 assembly and did not happen with the 1218 assembly.

0
ChrisWalker
Top achievements
Rank 1
answered on 07 Feb 2008, 09:15 PM
I reinstalled the 1218 assembly and noticed that the editable input fields honored the grid column's original width which I set using the HeaderStyle-Width. When I put back on the 1314 assembly, the editable fields seem to default to a constant fixed size thus making the new width larger for some small columns than its original width before the edititem() is called.
0
Accepted
Steve
Telerik team
answered on 11 Feb 2008, 01:52 PM
Hi ChrisWalker,

Thank you for the clarification. After a bit of testing, I figured out what is happening. In the 1218 version, the grid's TableLayout was not working as intended. By default it is auto, which means that if you have data larger than the width, the table will stretch. Setting it to fixed means that it will not stretch and keep the exact width set.
To achieve the same effect - simply set the TableLayout in MasterTableView to Fixed. This should resolve the problem you've encountered.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
ChrisWalker
Top achievements
Rank 1
answered on 11 Feb 2008, 10:44 PM
Steve-
Thank you. That fixed it for IE and 'almost' for firefox. I noticed this same behavior in the older assembly but didn't really see it as a big problem like the one you just solved. To use the terminology in MasterTableView's Tablelayout, in Firefox, the last column does not get "fixed" but seems to be set back to "auto". It will extend past the grid's width and in my case will set the width of the last input element to the far right of the browser's border. All of the other columns in firefox are correct when setting the Tablelayout to fixed: just the last column is not set properly.
0
Steve
Telerik team
answered on 12 Feb 2008, 01:42 PM
Hello Chris,

Unfortunately there is nothing we can do here as Firefox does not respect the TableLayout setting (you can try  standard html table or asp:GridView to verify this. Our suggestion would be to enable column resize in the grid, so that the input is cut-off but does not overlap outside the grid:

<Resizing AllowColumnResize="true"  />

Hope this helps.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
ChrisWalker
Top achievements
Rank 1
Answers by
Steve
Telerik team
ChrisWalker
Top achievements
Rank 1
Share this question
or