﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Thu, 04 Feb 2010 23:17:11 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi Yousif,&lt;/p&gt;&lt;p&gt;I am sorry if I was not clear enough to explain about your issue.&lt;br /&gt;&lt;br /&gt;In your scenario, you add an unbound column via button click. No matter how you save or load via xml, when refresh the grid, the value/text of added column would be missing.&lt;br /&gt;This happened because your scenario against our lifecyle.&lt;br /&gt;When do refresh our IntializeDataSource should be called/triggered again (loaded data) which all the data on WebGrid would be loaded again. This caused an issue in your added column because it's unbound.&lt;/p&gt;
&lt;p&gt;So, I don't agree if Madhavan's scenario is same like yours. In his sample, I can see that he handled the position and even the size in PrepareDataBinding (also not unbound) with correct life cycle. I think his scenario is possible to do. &lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Thu, 04 Feb 2010 22:56:10 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;I have created a simple sample using the scenario you described. After selecting a row in the WebGrid #1, WebGrid #2 will load a new data source.&lt;/p&gt;&lt;p&gt;I have done some small modification in the technique you used in the attached sample. However, I think you could still achieve the desired result. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Thu, 04 Feb 2010 08:41:30 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;We do something similar as we have a database driven grid structure configuration.  We've run into several issues and InterSoft is aware of some of the limitations, like dynamically changing the grid on post back, e.g., adding a column or removing a column, or shuffling the positions, etc.  See this thread for a bit of info&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.intersoftpt.com/Community/WebGrid/WebGrid-7---Updating-Structure-Dynamically-WorksAlmost/"&gt;http://www.intersoftpt.com/Community/WebGrid/WebGrid-7---Updating-Structure-Dynamically-WorksAlmost/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I've had to do a lot of work on the actual XML structure info that gets saved/loaded myself.  In some instances, any post back on the grid, i.e., sort, refresh, column move, etc. may need the page to be refreshed.  We have to do that if, for example, the user ungroups a column or makes it visible again from the Select Columns column context menu.  When this happens, InterSoft adds the column to the end of the gird, but we want it added back at its original assigned position.&lt;/p&gt;
&lt;p&gt;So you'll need to override the grid and do your own work in instances where the grid just will not update what you need dynamically.  In some cases, if you save the layout and then load it again, the grid will show the columns but not the data and rebinding the data source doesn't work either.&lt;/p&gt;
&lt;p&gt;Note in the thread above, that the remainder of the conversation took place via email to support, so even though it's not listed, InterSoft is aware of the inability to dynamically configure the grid at the moment.&lt;/p&gt;</description></item><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Thu, 04 Feb 2010 02:41:25 GMT</pubDate><dc:creator>Skgrid@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi Glenn.&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;The logic you have mentioned is mainly for predefined columns.&lt;/p&gt;
&lt;p&gt;In our cases (columns will vary based on the workflow selected in Left Hand side self reference grid)&lt;/p&gt;
&lt;p&gt;LHS will display all workflows.on click of each workflow the details on RHs grid varies along with the column and data.As we want new columns on click of each workflow we are first clearing the roottable columns in the preparedatabinding method and binding the columns. &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Madhavan&lt;/p&gt;</description></item><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Wed, 03 Feb 2010 22:12:44 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;In order to preserve the column structure and order in RefreshAll using your approach, you will need to add the column as the order in the previous WebGrid not by setting the position property. Here is the modified snippet of the PrepareDataBinding event handler:&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_PrepareDataBinding1(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)&lt;br /&gt;{&lt;br /&gt;    if (!IsPostBack || WebGrid1.FlyPostBackAction == PostBackAction.RefreshAll)&lt;br /&gt;    {&lt;br /&gt;        System.Collections.Generic.Dictionary&amp;lt;string, Unit&amp;gt; columnSize = new System.Collections.Generic.Dictionary&amp;lt;string, Unit&amp;gt;();&lt;br /&gt;        System.Collections.Generic.Dictionary&amp;lt;string, int&amp;gt; columnPosition = new System.Collections.Generic.Dictionary&amp;lt;string, int&amp;gt;();&lt;br /&gt;&lt;br /&gt;        for (int i = 0; i &amp;lt; WebGrid1.RootTable.Columns.Count; i&amp;#43;&amp;#43;)&lt;br /&gt;        {&lt;br /&gt;            columnSize.Add(WebGrid1.RootTable.Columns[i].Name, WebGrid1.RootTable.Columns[i].Width);&lt;br /&gt;            columnPosition.Add(WebGrid1.RootTable.Columns[i].Name, WebGrid1.RootTable.Columns[i].Position);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(255, 0, 0);"&gt;if (!(columnPosition.Count &amp;gt; 0))&lt;br /&gt;        {&lt;br /&gt;            columnPosition.Add("Application",0);&lt;br /&gt;            columnPosition.Add("Workflow", 1);&lt;br /&gt;            columnPosition.Add("ActivityDisplayName", 2);&lt;br /&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        WebGrid1.RootTable.Columns.Clear();&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: rgb(255, 0, 0);"&gt;foreach (string key in columnPosition.Keys)&lt;br /&gt;        {&lt;br /&gt;            WebGridColumn Col2 = new WebGridColumn();&lt;br /&gt;            Col2.Name = key;&lt;br /&gt;            Col2.Bound = true;&lt;br /&gt;            Col2.DataMember = key;&lt;br /&gt;&lt;br /&gt;            WebGrid1.RootTable.Columns.Add(Col2);&lt;br /&gt;            &lt;br /&gt;            if (columnSize.Count &amp;gt; 0)&lt;br /&gt;                Col2.Width = columnSize[Col2.Name];&lt;br /&gt;        }&lt;/span&gt;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    WebGrid1.RootTable.DataMember = "skworkitem";&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Wed, 03 Feb 2010 01:49:26 GMT</pubDate><dc:creator>Skgrid@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please somebody advice on this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Madhavan&lt;/p&gt;</description></item><item><title>Retaining Size and Position of the column</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Retaining-Size-and-Position-of-the-column/</link><pubDate>Tue, 02 Feb 2010 03:22:07 GMT</pubDate><dc:creator>Skgrid@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;Our Scenario is we are having two grids.one on the LHS and other one in RHS.&lt;/p&gt;
&lt;p&gt;LHS will display all workflows.on click of each workflow the details on RHs grid varies along with the column and data.As we want new columns on click of each workflow we are first clearing the roottable columns in the preparedatabinding method and binding the columns. &lt;/p&gt;
&lt;p&gt;We want the functionality of retaining Size and Position.The Size is getting retained for the columns after refreshing the existing structure but the position is not retaining.&lt;/p&gt;
&lt;p&gt;For example say we are having columns Application,Workflow,Activitydisplayname in the order and after loading the grid we have arranged Workflow to first and Activitydisplayname as 2 and Application as last.So we wnat to retain this changed order when we refresh the structure again.&lt;/p&gt;
&lt;p&gt;Please find the sample piece of code in prepareDatabinding method which we are trying wityh no luck.&lt;/p&gt;
&lt;p&gt;Please suggest us.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;madhavan&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>