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

GridControl and ComboBox column VB.Net 2005

Thread ID:

Created:

Updated:

Platform:

Replies:

67573 Aug 23,2007 07:47 PM UTC Aug 29,2007 02:40 AM UTC WinForms 8
loading
Tags: GridControl
James
Asked On August 23, 2007 07:47 PM UTC

version 5.102.1.0

I am trying to populate a column's combobox with data at runtime. The grid will be a user maintainable grid, meaning, the user has to input data and click an outside button that will send the grid's data to SQL Server. The first column is a combobox that has been prefilled with data when the form first loads. Lots of the examples I have downloaded have not helped.

James
Replied On August 24, 2007 12:31 PM UTC

ok... this worked
Grid.ColStyles.Item(intCol).DataSource = dt
Grid.ColStyles.Item(intCol).DisplayMember = RetField
Grid.ColStyles.Item(intCol).ValueMember = RetField

now I am having a problem with the combo's behavior. I need to allow user typing... but what is typed must be valid in the combobox.


>version 5.102.1.0

I am trying to populate a column's combobox with data at runtime. The grid will be a user maintainable grid, meaning, the user has to input data and click an outside button that will send the grid's data to SQL Server. The first column is a combobox that has been prefilled with data when the form first loads. Lots of the examples I have downloaded have not helped.

J.Nagarajan [Syncfusion]
Replied On August 24, 2007 11:09 PM UTC

Hi James,

Thanks for your interest in Syncfusion product.

We glad to hear that your previous issue has been resolved. If you want to allow the user to type the valid test in the combobox then you have to set GridDropDownStyle to AutoComplete. Please refer to the following code snippet

Grid.ColStyles.Item(intCol).DropDownStyle=GridDropDownStyle.AutoComplete

I hope this will meet your requirement. Please let me know if you have any questions.

Thanks,
Nagaraj

James
Replied On August 27, 2007 12:03 PM UTC

I have been able to set the dropdown to editable with autocomplete enabled. I would like to see if there is a "validation" event or somthing that is triggered when the user has typed a valid selection. Once the user has inputed a value that is in the list, I intend to populate other fields in the row with queries from SQL. So far, I have been able to trap for the Enter key press, but would like to know how to "validate" the value typed in to make sure it is a valid selection.

>Hi James,

Thanks for your interest in Syncfusion product.

We glad to hear that your previous issue has been resolved. If you want to allow the user to type the valid test in the combobox then you have to set GridDropDownStyle to AutoComplete. Please refer to the following code snippet

Grid.ColStyles.Item(intCol).DropDownStyle=GridDropDownStyle.AutoComplete

I hope this will meet your requirement. Please let me know if you have any questions.

Thanks,
Nagaraj

James
Replied On August 27, 2007 12:37 PM UTC

Ok. Autocomplete only allows for a valid selection. I trapped the Validate event, but the grid(grid.currentcell.rowindex,1).cellvalue always brings back nothing. Why is the value not passed? I have also attempted using the "Text" value with no luck.

>I have been able to set the dropdown to editable with autocomplete enabled. I would like to see if there is a "validation" event or somthing that is triggered when the user has typed a valid selection. Once the user has inputed a value that is in the list, I intend to populate other fields in the row with queries from SQL. So far, I have been able to trap for the Enter key press, but would like to know how to "validate" the value typed in to make sure it is a valid selection.

>Hi James,

Thanks for your interest in Syncfusion product.

We glad to hear that your previous issue has been resolved. If you want to allow the user to type the valid test in the combobox then you have to set GridDropDownStyle to AutoComplete. Please refer to the following code snippet

Grid.ColStyles.Item(intCol).DropDownStyle=GridDropDownStyle.AutoComplete

I hope this will meet your requirement. Please let me know if you have any questions.

Thanks,
Nagaraj

James
Replied On August 27, 2007 07:08 PM UTC

>>>Bump<<<< I'm stuck here. Not able to get the value after CurrentCellValidated.


>Ok. Autocomplete only allows for a valid selection. I trapped the Validate event, but the grid(grid.currentcell.rowindex,1).cellvalue always brings back nothing. Why is the value not passed? I have also attempted using the "Text" value with no luck.

>I have been able to set the dropdown to editable with autocomplete enabled. I would like to see if there is a "validation" event or somthing that is triggered when the user has typed a valid selection. Once the user has inputed a value that is in the list, I intend to populate other fields in the row with queries from SQL. So far, I have been able to trap for the Enter key press, but would like to know how to "validate" the value typed in to make sure it is a valid selection.

>Hi James,

Thanks for your interest in Syncfusion product.

We glad to hear that your previous issue has been resolved. If you want to allow the user to type the valid test in the combobox then you have to set GridDropDownStyle to AutoComplete. Please refer to the following code snippet

Grid.ColStyles.Item(intCol).DropDownStyle=GridDropDownStyle.AutoComplete

I hope this will meet your requirement. Please let me know if you have any questions.

Thanks,
Nagaraj


J.Nagarajan [Syncfusion]
Replied On August 28, 2007 12:43 AM UTC

Hi James,

When you set the DropDownStyle to AutoComplete, you will be able to type only the entries that are in the choice list (or) the user input is restricted to items from the ChoiceList or DataSource but the user can type text into the text box and the text box will be filled with a matching choice.

In such case, you can't able to enter any invalid entries. If you set the DropDownStyle to Editable, then you would be able to edit invalid entries also. You can handle the CurrentCellValidateString to validate each character that is pressed. this event gets triggered for each key stroke.

Also refer to the following kb article for more details.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=340

Please let me know if you have any questions.

Regards,
Nagaraj

James
Replied On August 28, 2007 11:41 AM UTC

Maybe I didn't clarify. I know all about below. The problem is when it is validated... ie... they hit the enter key with a valid text, I cannot retrieve the values. I have done Me.Grid(Me.Grid.CurrentCell.RowIndex, 1).CellValue and Me.Grid(Me.Grid.CurrentCell.RowIndex, 1).Text without luck. Why? As stated before, this is on Grid_CurrentCellValidated event.

>Hi James,

When you set the DropDownStyle to AutoComplete, you will be able to type only the entries that are in the choice list (or) the user input is restricted to items from the ChoiceList or DataSource but the user can type text into the text box and the text box will be filled with a matching choice.

In such case, you can't able to enter any invalid entries. If you set the DropDownStyle to Editable, then you would be able to edit invalid entries also. You can handle the CurrentCellValidateString to validate each character that is pressed. this event gets triggered for each key stroke.

Also refer to the following kb article for more details.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=340

Please let me know if you have any questions.

Regards,
Nagaraj

J.Nagarajan [Syncfusion]
Replied On August 29, 2007 02:40 AM UTC

Hi James,

To retrieve the value of the cell that is validated in the currectcellvalidated event use the CurrentCell.Renderer.ControlText property. Please refer to the following code snippet

this.gridControl1.CurrentCellValidated+=new EventHandler(gridControl1_CurrentCellValidated);

void gridControl1_CurrentCellValidated(object sender, EventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
Console.WriteLine(cc.Renderer.ControlText + " " + "CurrentCellValidated");
}

I have attached the sample that demonstrates this completely. You can download the samle from the following page.

http://websamples.syncfusion.com/samples/Grid.Windows/F67573/main.htm

Please refer to the sample and let me know if you have any questions.

Thanks,
Nagaraj

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

;