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.

Dependent Data in GBDG

Thread ID:

Created:

Updated:

Platform:

Replies:

14871 Jun 7,2004 01:05 PM Jun 9,2004 09:22 AM Windows Forms 9
loading
Tags: GridControl
Kenneth Johnson
Asked On June 7, 2004 01:05 PM

I am using QueryCellInfo to load combobox lists depending on the selected item in other comboboxes. In general this works, but when adding more dependent columns to the grid, the response time explodes. I have been trying to cut this time down by using a "the list for this row/column has already been created" matrix. The matrix is first initialized to "run", and then set to "completed" in QueryCellInfo. What I am seeing is that the dependent comboboxes are now displaying the ValueMember instead of the DisplayMember and the list is empty even though I watched it load in the debugger. It seems that the QueryCellInfo code must be executed multiple times to sync up the list and the value to be displayed. Is this an accurate accessment? Any thoughts as to how I can cut down on the hits in QueryCellInfo? Ken

Administrator [Syncfusion]
Replied On June 7, 2004 01:46 PM

There is no way to control how may times QueryCellInfo will be hit. You may want to try populating your lists in CurrentCellShowingDropDown. In this way, the lists will only be populated when they are needed for the dropped list. Here is a KB that discusses one way you can do this. http://www.syncfusion.com/Support/article.aspx?id=567.

Kenneth Johnson
Replied On June 8, 2004 04:40 AM

That link took me to a post regarding smart client deployment. We're using the data bound grid. I had previously been told that the only way to revise the datasource was in QueryCellInfo.

Kenneth Johnson
Replied On June 8, 2004 04:42 AM

My bad on the post. I now see that the link is different.

Kenneth Johnson
Replied On June 8, 2004 05:13 AM

Correct me if I'm wrong. The DataTable is loaded with all the reference data. A DataView is the datasource of the combobox, and the filter is revised in the CurrentCellShowingDropDown event to view the required rows from the DataTable? I'll give it try and see how it goes. The only down side may be loading the entire table. Over 20,000 rows will be coming through a web service. I'll let you know. Ken As always, thanks for the response.

Administrator [Syncfusion]
Replied On June 8, 2004 05:48 AM

You do have the idea of that sample. If you do not want to load the 20K rows initially, you could just create a DataTable with the values being initially displayed in the grid, and set this as teh columns datasource. (If there more than 20K rows in the grid, then this would not save you anything...). Then in CurrentCellShowingDropDown, don''t use a DataView.Filter to get the values, but instead retrieve a new DataTable holding just the required values through your web service. This would add a web hit on each dropdown, so it may not gain much...

Kenneth Johnson
Replied On June 9, 2004 07:49 AM

More issues to resolve. The grid has three columns, part number, finish, and color. Part number is defined as a string, finish and color as Int32. I use the DisplayMember to display a string representing the finish/color, but the integer id is what is saved. Now that I am building the combobox lists in CurrentCellShowingDropDown with a DataView instead of in QueryCellInfo, existing parts display the numeric finish/color id when the grid is first displayed. How do I get the DisplayMember to display after first loading the grid? Also, after selecting the finish for a part, I get the error message "'finish string' is not a valid value for Int32." Both the DisplayMember and ValueMember properties are set in CurrentCellShowingDropDown. What am I missing? Thanks. Ken

Kenneth Johnson
Replied On June 9, 2004 07:54 AM

Are DisplayMember and ValueMember set to the corresponding DataView column names? ex. DisplayMember = "FinishName"; ValueMember = "FinishId"; Ken

Administrator [Syncfusion]
Replied On June 9, 2004 08:11 AM

Yes. In addition to setting these in CurrentCellShowingDropdown for the drop list, you also have to set these properties in the GridBoundColumn.StyleInfo for the column. In addition, you probably will have to set GridBoundColumn.StyleInfo.DataSource to a two-column datatable (DisplayMember & ValueMember) for the initial values that are shown in the grid. It is this action that would allow the grid to initially display the Displaymember instead of the ValueMember.

Kenneth Johnson
Replied On June 9, 2004 09:22 AM

Exactly what the doctor ordered. You da man. Ken

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.

;