We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

col widths problem

Thread ID:





14187 May 20,2004 12:55 PM UTC Jun 9,2004 12:36 PM UTC Windows Forms 18
Tags: Grouping
Administrator [Syncfusion]
Asked On May 20, 2004 12:55 PM UTC

hi, i have this function which loads filter or column settings, as attached. the problem is with loading column settings if its the first thing i do and the settings are identical except for the widths. the widths wont change on the second load, but it works fine if i loaded a filter first or totally different col settings (not just widths). it works every time after that. i tried alot of reset/refresh calls before/after resumelayout, didn''t help. if i try to manually resize the col in question, it jumps to the 2nd loaded width. so the width values seem to be in memory ok, but not redrawn. tia load_2024.zip

Administrator [Syncfusion]
Replied On May 20, 2004 02:05 PM UTC

Have you tried gridGroupingControl1.Table.TableDirty = true; gridGroupingControl1.Refresh(); after you have loaded the settings?

Administrator [Syncfusion]
Replied On May 20, 2004 02:13 PM UTC

unfortunately that didn''t work.

Administrator [Syncfusion]
Replied On May 20, 2004 03:08 PM UTC

i added those two lines and left them there, i just noticed that they caused the load filter to stop working??? i sure dont know why.

Administrator [Syncfusion]
Replied On May 20, 2004 08:46 PM UTC

actually it doesn''t work every time after, if i keep loading different settings eventually the col widths will stop resizing, then sometimes even the header names don''t change. everything is put right once i do a manual resize, so it looks like a refresh problem.

Administrator [Syncfusion]
Replied On May 24, 2004 03:04 PM UTC

Colin, I looked at your code but can''t find anything wrong by just looking at that function. The problem you describe is also not a known issue for us. Do you have a small sample project that let''s us reproduce the issue? - Or - Do you have the source code for the grid? In your code, does the line g.TableDescriptor.Columns = cd; get executed. Can you debug into it and check if the GridColumnDescriptor.InitializeFrom is hit after that line and if the width is set as expected? Also, what happens if you check the width of a specific column (just check grid.Columns[0].Width for example). Is it the right width that you assigned to it? Are any exceptions being thrown? Sorry for the late reply. I was travelling the last couple of days. Thanks, Stefan

Administrator [Syncfusion]
Replied On May 25, 2004 08:47 AM UTC

i can answer the "or" part right now, i''ll see if i can get around to making a sample, but i wish you had sql server, then i could pass you the db. i recommend you install it for any future use anyway, if possible. to answer some questions, the lines are executed as expected, and the widths are being set, i know this because when i do a manual resize everything snaps into place, thats important to be clear, let me know if its not. no exceptions are being thrown. before i make a demo, could you let me know if its possible to pass you the db anyway, i think you have msde or whatever it is, i''m just not familiar with it. thanks

Administrator [Syncfusion]
Replied On May 25, 2004 09:38 AM UTC

We have MSDE. Only problem with it is cumbersome to setup and easliy a step or two is left out and then we can''t exactly reproduce the problem. One way we get around people not having SQL Server or MSDE on their development machines can be found in our samples. Check out the HierarchieView example. You see the following lines in form1.cs: bool msdeAvailable = false; if (msdeAvailable) { this.sqlDataAdapter1.Fill(this.dataSet11); this.sqlDataAdapter2.Fill(this.dataSet11); this.sqlDataAdapterShippers.Fill(this.shippersDataSet1); this.dataSet11.WriteXml("HVData.xml", XmlWriteMode.WriteSchema); } else { // Read from a xml file instead. ReadXml(this.dataSet11, "Data\\HVData.xml"); } When we run the sample we once set msdeAvailable = true. That will create an xml. And then when we ship that sample we set msdeAvailable = false. That way customers can check out our samples even if they don''t have Northwind MSDE on their system. Stefan

Administrator [Syncfusion]
Replied On May 25, 2004 11:11 AM UTC

i wasn''t able to convert some functions which get passed sql and take care of the connections, see putsval, getsval etc... in utils.cs. but i think you might be able to use the db included with msde, you''d have to modify the connection strings, i hope its straightforward enough to do. if that doesn''t work maybe you can tell me how i should convert the utils.cs functions. thanks Copy of gthubgr_4511.zip

Administrator [Syncfusion]
Replied On May 25, 2004 11:17 AM UTC

btw if you get it working, to duplicate the problem first open columns "2" then "1". other sequences do work fine.

Administrator [Syncfusion]
Replied On May 25, 2004 12:15 PM UTC

also, if you get it working, try uncommenting g.Table.TableDirty = true; g.Refresh(); in utils.loadsettings, then try opening any filter. nothing happens on this end.

Administrator [Syncfusion]
Replied On May 25, 2004 06:44 PM UTC

Colin, Do you have instructions how to initialize a MSDE database from the MDF and LDF file that is in your project? I copied the files to C:\Program Files\Microsoft SQL Server\MSSQL$NetSDK\Data but it does not show up and I can''t connect to it. I guess I have to register it somewhere ... I noticed that you wrote out a data.xml file. Can you attach that xml file? I would give that a try then if I can''t get MSDE working. Thanks, Stefan

Administrator [Syncfusion]
Replied On May 25, 2004 06:55 PM UTC

how about http://support.microsoft.com/default.aspx?scid=kb;en-us;208888 passing data.xml would be useless because of those utils.cs calls. tia

Administrator [Syncfusion]
Replied On May 26, 2004 09:58 AM UTC

Hi Colin, I got it working. I don''t have SQL Query Analyzer on my machine, so I couldn''t follow the steps from the article but I found out that I could create a new MSDE database within VS IDE and then just delete the created files and rename your files inside the Data folder. Also, as you already hinted, I had to modify the connection strings. I did the following test run with Suite Firt I select "Columns | Open", select 2. Then I select "Columns | Open", select 1. I attached the screenshots with the results. screen1 is before I hit open the first time, screen2 aftet the first time and screen3 after the second time. I noticed that for the second time that if I don''t click in the listbox the line if (f.ShowDialog() == DialogResult.OK && f.aname.Trim() != "") would always return false and therefore the code was not executed. But clicking around in the listbox got around this and then the code executed fine. In the screen shots I noticed that between screen2 and screen3 the width for the Consignee column is changing. Are you seeing a different behavior? Do you have other steps that show the problem and which columns should I look at then. Thanks, Stefan >how about http://support.microsoft.com/default.aspx?scid=kb;en-us;208888 > >passing data.xml would be useless because of those utils.cs calls. > >tia Copy of gthubgr_547.zip

Administrator [Syncfusion]
Replied On May 26, 2004 10:25 AM UTC

hi, here are some screen shots from my side, which i can consistantly reproduce. I open the app click open columns 2 then open 1, then i opened 3 then 1. its the consignee addr thats not getting resized as you''ll see in click1.jpg, it should look like click3then1.jpg. if it doesn''t happen there then its really strange! thanks scrshot_9539.zip

Administrator [Syncfusion]
Replied On May 26, 2004 10:28 AM UTC

what happens if you uncomment the tabledirty lines i mentioned, will the filters work? that would be strange again, i am running 2051.

Administrator [Syncfusion]
Replied On May 26, 2004 11:36 AM UTC

Hi Colin, I can now reproduce the problem. It''s only if I step through with debugger then it worked fine. So, something is wrong here. But I haven''t figure out what is wrong and how to work around it. I will let you know once I could track down the issue. Thanks, Stefan

Administrator [Syncfusion]
Replied On June 8, 2004 10:35 AM UTC

hi Stefan, have you had a chance to work on this, just curious about the progress. it must be hard to debug if it works when stepping through with the debugger. no rush, thanks

Administrator [Syncfusion]
Replied On June 9, 2004 12:36 PM UTC

Hi Colin, haven''t had a chance to get back to this yet. We were focused more on the base grid recently - we added RightToLeft support there. But the coming days focus will be back on grouping issues and then I''ll also try to fix this issue. Stefan


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon