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.

saving grid data

Thread ID:

Created:

Updated:

Platform:

Replies:

10366 Jan 29,2004 07:04 PM Feb 2,2004 12:10 PM Windows Forms 9
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 29, 2004 07:04 PM

Hi, I have some GridHierDataBoundGrids that allow the user to select new values from combo boxes or edit cell contents. I know this is probably a very basic question, but how can I save this data to the grid''s data source? The data comes from an xml data source. Thanks, CB

Administrator [Syncfusion]
Replied On January 30, 2004 01:25 AM

Are you populating a DataSet with the XML data using DataSet.ReadXml? If so, you would use DataSet.WriteXml to resave the file. If you are doing something else, you would have to do the ''WriteXml'' analog of whatever ''ReadXml'' technique you used.

Administrator [Syncfusion]
Replied On January 30, 2004 09:50 AM

Okay, Thanks, WriteXml is working for the grid except for a combox that I added. The combo does not retain its value when I switch to a new row or when I save to the datasource. I''m sorry for the simple question, but I am totally new to this grid control and a bit confused. I added a combo box style cell to the grid. The combo needs to read and write it''s value from the same data source as the rest of the grid but it''s dropdown list needs to be a choicelist. Here is the code I wrote for the combo. Can you tell me what property I am neglecting to set? Dim Items As New StringCollection() Items.Add("Masculine") Items.Add("Feminine") Items.Add("Neuter") style = CType(e.Grid, GridDataBoundGrid).GridBoundColumns ("Gender").StyleInfo style.CellType = "ComboBox" style.DataSource = Items style.DropDownStyle = GridDropDownStyle.Exclusive Thanks so much! CHuck >Are you populating a DataSet with the XML data using DataSet.ReadXml? If so, you would use DataSet.WriteXml to resave the file. > >If you are doing something else, you would have to do the ''WriteXml'' analog of whatever ''ReadXml'' technique you used.

Administrator [Syncfusion]
Replied On January 30, 2004 10:02 AM

Instead of: style = CType(e.Grid, GridDataBoundGrid).GridBoundColumns ("Gender").StyleInfo style.CellType = "ComboBox" style.DataSource = Items style.DropDownStyle = GridDropDownStyle.Exclusive try style = CType(e.Grid, GridDataBoundGrid).GridBoundColumns ("Gender").StyleInfo style.CellType = "ComboBox" style.ChoiceList = Items style.ExclusiveChoiceList = True

Administrator [Syncfusion]
Replied On January 30, 2004 11:56 AM

Thanks again, that worked great. The only problem I''m having now is that when I switch to a different row in the parent grid of the one that has the combo, the combo does not save the value I picked. Thanks, Chuck >Instead of: > > >style = CType(e.Grid, GridDataBoundGrid).GridBoundColumns ("Gender").StyleInfo >style.CellType = "ComboBox" >style.DataSource = Items >style.DropDownStyle = GridDropDownStyle.Exclusive > > >try > >style = CType(e.Grid, GridDataBoundGrid).GridBoundColumns ("Gender").StyleInfo >style.CellType = "ComboBox" >style.ChoiceList = Items >style.ExclusiveChoiceList = True >

Administrator [Syncfusion]
Replied On January 30, 2004 03:58 PM

Is something ReadOnly? Your grid columns style, or the whole grid, or the datatable or something else ??? Can you reproduce this problem in one of the ComboBoxes in the Syncfusion\Essential Suite\Grid\Samples\CellTypes\ComboboxCells sample? Can you prepare a little sample project showing this problem and post it here, or submit a Direct Trac support incident and include the sample project there?

Administrator [Syncfusion]
Replied On January 31, 2004 02:55 PM

No, nothing is readonly. I looked into the problem more and found that the combo switches back to the value of the original record rather than the value I selected from the picklist whenever I click on the record selector of the parent grid. The original value is not one of the selections from the picklist- maybe this is the problem? For example: the record has the value ''unknown'', next I choose ''choice one'' from the picklist, next I click on the record selector of the parent grid and then go back to the child grid and combo and the combo is set back to ''unkown''. It doesn''t matter whether or not I move to a different record. If I avoid clicking the record selector the new value is saved. I could not reproduce this behavior with the sample. Any ideas? I really stuck and I have to get this project done soon. Thanks so much! Chuck >Is something ReadOnly? Your grid columns style, or the whole grid, or the datatable or something else ??? > >Can you reproduce this problem in one of the ComboBoxes in the Syncfusion\Essential Suite\Grid\Samples\CellTypes\ComboboxCells sample? > >Can you prepare a little sample project showing this problem and post it here, or submit a Direct Trac support incident and include the sample project there?

Administrator [Syncfusion]
Replied On January 31, 2004 05:45 PM

If you are setting style.ExclusiveChoiceList = True, then the value in the grid cell should in the comboboxes choice list. Can you prepare a sample project showing the problem and post it here? Or create a Direct Trac support incidence, and post a sample there.

Administrator [Syncfusion]
Replied On February 2, 2004 11:46 AM

Hi, Thanks for your help. I''ve attached a sample project showing the issue. To reproduce: 1. Open second grid in hierarchy, 2. go to dropdown called ''gender'' 3. select a value from the dropdown list 4. click on record selector of parent grid or go to the next record in the 2nd grid 5. return to first record in second grid and check to value of gender dropdown - you will note that it reverted back to its original value rather than saving the change you made I really appreciate the help! Also can you give me an example of some code to create a dropdown list type of cell that is sorted in descending order by the last column? I will also be looking at the syncfusion samples for this info! Chuck >If you are setting style.ExclusiveChoiceList = True, then the value in the grid cell should in the comboboxes choice list. > >Can you prepare a sample project showing the problem and post it here? Or create a Direct Trac support incidence, and post a sample there. > > Test2104_8220.zip

Administrator [Syncfusion]
Replied On February 2, 2004 12:10 PM

Hi, Here is the data file to test with. You need to store in at C:\ Thanks again, Chuck >Hi, > >Thanks for your help. I''ve attached a sample project showing the issue. To reproduce: > >1. Open second grid in hierarchy, >2. go to dropdown called ''gender'' >3. select a value from the dropdown list >4. click on record selector of parent grid or >go to the next record in the 2nd grid >5. return to first record in second grid and check to value of gender dropdown - you will note that it reverted back to its original value rather than saving the change you made > >I really appreciate the help! Also can you give me an example of some code to create a dropdown list type of cell that is sorted in descending order by the last column? I will also be looking at the syncfusion samples for this info! > >Chuck > >>If you are setting style.ExclusiveChoiceList = True, then the value in the grid cell should in the comboboxes choice list. >> >>Can you prepare a sample project showing the problem and post it here? Or create a Direct Trac support incidence, and post a sample there. >> >> > >Test2104_8220.zip > > Data_8447.zip

CONFIRMATION

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.

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.

;