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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding a text box cell of a GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

20591 Oct 21,2004 11:50 AM UTC Oct 22,2004 06:48 AM UTC WinForms 3
loading
Tags: GridControl
Areti Stamatourou
Asked On October 21, 2004 11:50 AM UTC

I am using the trial version of the Essential Grid control. I want to bind a column of a datasource in a cell into a GridControl. The way i do this is: this.myGridControl[0,1].CellType = "TextBox"; this.myGridControl[0,1].DataSource = myDataSet; this.myGridControl[0,1].DisplayMember = "myDataSet.Name"; // The column of the the table this.gridControl1[0,1].ValueMember = "myDataSet.Name"; I can'' t see anything in the cell. My final scope is to bind some cells of the grid with columns of the datasource and to do a record navigation. It'' s possible to do that? Areti

Administrator [Syncfusion]
Replied On October 21, 2004 12:02 PM UTC

The grid does not support simple binding to a single grid cell. The style.DataSource, style.DisplayeMember, style.ValueMember are used for complex binding to cells with celltype=ComboBox or celltype=GridListControl. In this case, the databinding provides the list for these dropdowns just as with the standard Windows Forms ComboBox control. If you want to use this binding to show foreign keys in what looks like a textbox, you can set the style.CellType = "ComboBox" and also set style.ShowButtons = GridShowButtons.None.

Areti Stamatourou
Replied On October 22, 2004 03:37 AM UTC

Good Morning Clay Thanks for your response. I have done your solution but i don''t see anything in the field. How can i set the list index of the combo box? And i can combine the fields of the grid with a record navigation control? >The grid does not support simple binding to a single grid cell. The style.DataSource, style.DisplayeMember, style.ValueMember are used for complex binding to cells with celltype=ComboBox or celltype=GridListControl. In this case, the databinding provides the list for these dropdowns just as with the standard Windows Forms ComboBox control. If you want to use this binding to show foreign keys in what looks like a textbox, you can set the style.CellType = "ComboBox" and also set style.ShowButtons = GridShowButtons.None. >

Administrator [Syncfusion]
Replied On October 22, 2004 06:48 AM UTC

>I have done your solution but i don''t see anything in the field. This sample, Grid\Samples\DataBound\GDBGcombos, shows databound comboboxes in a griddataboundgrid. It was done entirely with the designer, so to see the code involved, you would look at the designer generated code. There is also this sample that shows how to set up comboboxes from code. Grid\Samples\CellTypes\ComboboxCells. >How can i set the list index of the combo box? Normally, you do not set the index, but instead set the value that should be seen in the grid cell. (The grid generally works with the cell values, and not indexes in the droplist. The only time the grid maintains knowledge of these indexes is when the grid is actually displaying the dropdown (more or less)). >And i can combine the fields of the grid with a record navigation control? The default support is to navigate rows, not fields. See this sample. Grid\Samples\DataBound\RecordNavDataBoundGrid If you can post a little sample project showing how you are trying to set up up your combobox cell, we can try to spot the problem here.

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.

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

;