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.

Dynamic data binding for autocomplete

Thread ID:

Created:

Updated:

Platform:

Replies:

100036 Jun 28,2011 12:35 PM Jul 14,2011 09:37 AM ASP.NET Web Forms (Classic) 5
loading
Tags: Grouping
Namita Jain
Asked On June 28, 2011 12:35 PM

Hi

I have a autocomplete drop down in a grouping grid. As soon as the user starts typing in - i need to make a call to fetch the data and bind the same to the control.
I am using the grid_TableControlCurrentCellChanged event to get the typed in data and then making a call. That works fine and i do get my data set.
But the probelm is - the data set doesn't get bound to the dropdown.
What i could make out was, for dynamic data binding the Grid_QueryCellStyleInfo event needs to be handled and the dataset be bound to the control again - Is that correct.
Also, i dont want to cache the dataset and make a call as soon as the user types in - because of which if i add code in the Grid_QueryCellStyleInfo event, i would have to make another call.

Do you have a better way of doing this?

I would really appreciate a quick response.

Thanks
-Namita


Namita Jain
Replied On June 28, 2011 02:33 PM

I am using the GridListControl (the autocomplete) in the Grouping grid


Namita Jain
Replied On June 30, 2011 10:34 AM

Can i get to hear anything on this issue please?


Ragamathulla B [Syncfusion]
Replied On July 6, 2011 03:17 AM

Hi Namita,

We regret for the delay in getting back to you.

You can set ‘AutoComplete’ to the combo box cell style’s ‘DropDownStyle’ property to apply the auto complete functionality. In the given sample, I have established combo box cell with cell type ‘GridListControl’ along with the following code.


// In Form1_Load

this.gridGroupingControl1.TableDescriptor.Columns["Custom"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.GridListControl;
this.gridGroupingControl1.TableDescriptor.Columns["Custom"].Appearance.AnyRecordFieldCell.DataSource = GetTheGridTable();
this.gridGroupingControl1.TableDescriptor.Columns["Custom"].Appearance.AnyRecordFieldCell.DisplayMember = "OrderID";
this.gridGroupingControl1.TableDescriptor.Columns["Custom"].Appearance.AnyRecordFieldCell.ValueMember = "OrderID";
this.gridGroupingControl1.TableDescriptor.Columns["Custom"].Appearance.AnyRecordFieldCell.DropDownStyle = GridDropDownStyle.AutoComplete;



Please refer to the following sample which illustrates the same.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCListControl-723279129.zip>

Let me know if this helps.

Regards,
Ragamathullah B.



Namita Jain
Replied On July 13, 2011 03:29 PM

I don't want to set the same datasource for all the cells in a given column. Each cell can have a different datasource - which is NOT populated on form load and would be populated at run time when the user starts typing(and would be the output of a web service).
I am able to bind different data sources to different cells. the only problem is - as soon as any item from the drop down is clicked, the datasource(for that particular drop down) gets lost.

Is there a way(any event??) i can persist the datasource?I hope you got what I want to convey.

Please advise if you can help on this?


Ragamathulla B [Syncfusion]
Replied On July 14, 2011 09:37 AM

Hi Namita,

Thanks for your interest in Syncfusion products.

You can bind different data source for each comboboxcell using ‘QueryCellStyleInfo’ event. The following code explain the same.


this.gridGroupingControl1.TableDescriptor.QueryCellStyleInfo += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventHandler(TableDescriptor_QueryCellStyleInfo);

void TableDescriptor_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.ColIndex == 4)
if (e.TableCellIdentity.RowIndex == 6)
e.Style.DataSource = GetTheGridTable2();
else if(e.TableCellIdentity.RowIndex == 7)
e.Style.DataSource = GetTheGridTable1();
}


Please refer to the following sample which illustrates the same.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCListControlDifferentDatasourceEachRow-624412195.zip

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.

;