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.

GridControl ComboBox events

Thread ID:

Created:

Updated:

Platform:

Replies:

101626 Nov 9,2011 05:47 AM Nov 17,2011 10:45 PM Windows Forms 8
loading
Tags: GridControl
reda
Asked On November 9, 2011 05:47 AM

hi
i use GridControl ComboBox to load data from table in data base
i want when i change the in ComboBox or close up the combobox
load anthother data from another table and put them in other col
======================

Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\databind.mdb")
Dim cmd As New OleDbCommand()

Dim da As New OleDbDataAdapter()
Dim ds As New DataSet()

con.Open()
With cmd

.Connection = con
.CommandType = CommandType.TableDirect
.CommandText = "select*from Categories"

End With
da.SelectCommand = cmd
da.Fill(ds, "Categories")
Me.GridControl1.ColStyles(2).CellType = "ComboBox"
Me.GridControl1.ColStyles(2).DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive
Me.GridControl1.ColStyles(2).DataSource = ds.Tables(0)
Me.GridControl1.ColStyles(2).DisplayMember = "CategoryName"
Me.GridControl1.ColStyles(2).ValueMember = "CategoryID"
Me.GridControl1.CurrentCell.ShowDropDown()
============================
i want to print CategoryID in col (1)


Ragamathulla B [Syncfusion]
Replied On November 10, 2011 05:05 AM

Hi Reda,

Thanks for the update.

To achieve the desired behavior. please refer the dashboard sample “GDBG Combo Columns Demo” . The following path contains the sample from the dashboard.

..\..\AppData\Local\Syncfusion\EssentialStudio\{installedVersion}\Windows\Grid.Windows\Samples\2.0\Data Bound\GDBG Combo Columns Demo

Let me know if you have any concern.

Regards,
Ragamathullah B


reda
Replied On November 10, 2011 06:00 AM

i see the Sample and there is no event using in the Sample


reda
Replied On November 10, 2011 06:33 AM

pl give me some help


Ragamathulla B [Syncfusion]
Replied On November 10, 2011 11:12 PM

Hi Reda,

Thanks for the update.

The combobox load another data from another table and putting them in other column/row by using ‘CurrentCellCloseDropDown’ event. The following code explains the same

void gridControl1_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
ArrayList array = new ArrayList();
array.Add(new MyClass(001, "John David"));
array.Add(new MyClass(002, "Tom"));
array.Add(new MyClass(003, "Bretney"));
array.Add(new MyClass(004, "Jessy"));
array.Add(new MyClass(005, "Bruch"));
array.Add(new MyClass(006, "Johny"));
this.gridControl1[3, 1].CellType = "ComboBox";
this.gridControl1[3, 1].DisplayMember = "Name";
this.gridControl1[3, 1].ValueMember = "ID";
this.gridControl1[3, 1].DataSource = array;
}

Please refer to the following sample which illustrates the same.

http://www.syncfusion.com/downloads/Support/DirectTrac/87137/GCComboBoxEvent-1789723124.zip

Please let me know if you have any further concerns.

Regards,
Ragamathullah B.



reda
Replied On November 11, 2011 03:54 AM

thank you so much it worked but if i use GridListControl instead of combo how can i change column display name of GridListControl
============
sorry if board you and thank you again for your help


Ragamathulla B [Syncfusion]
Replied On November 14, 2011 06:57 AM

Hi Reda,

Thanks for update.

You can change the display column when closed the dropdown by using 'CurrentCellCloseDropDown' event. The following code explains the same.

void gridControl1_CurrentCellCloseDropDown(object sender, PopupClosedEventArgs e)
{
gridControl1[6, 3].CellType = "GridListControl";
gridControl1[6, 3].DataSource = dataSet11.Customers;
gridControl1[6, 3].DisplayMember = "CustomerID";
gridControl1[6, 3].ValueMember = "CustomerID";
}


Please refer to the sample which illustrates the same.

http://www.syncfusion.com/downloads/Support/DirectTrac/87211/ComboBoxGLC1591933118.zip

please let me know if you have any further concerns.

Regards,
Ragamathullah B


reda
Replied On November 14, 2011 08:20 AM

sorry i dont mean columns i mean change the header columns caption for GridListControl
=============================
i mean the header of columns caption
im sorry
and thank you for helping


Ragamathulla B [Syncfusion]
Replied On November 17, 2011 10:45 PM

Hi Reda,

Thank you for the update.

We will update you with the respective details for your reported queries, in the Forum 101738. Please refer the forum 101738 for follow up. also We suggest you to logon your forum account with your username and password to view.

Here is the link:

http://www.syncfusion.com/support/forums/general/101738

Let me know if you have any concern.

Regards,
Ragamathullah B


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.

;