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. Image for the cookie policy date

col widths problem

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

18 Replies

AD Administrator Syncfusion Team May 20, 2004 02:05 PM UTC

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

AD Administrator Syncfusion Team May 20, 2004 02:13 PM UTC

unfortunately that didn''t work.

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

AD Administrator Syncfusion Team 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

Live Chat Icon For mobile
Up arrow icon