AutocompleteExtender inside gridview - ajax

I am using an autocomplete extender inside a gridview. Inside the gridview, I have a country dropdown. When I select a country, the states should be populated in the autocomplete extender using textbox.
I am able to populate the countries and states. But when I have multiple rows in the gridview,
I select a country in row 1 of the gridview.
But all the StatesTextbox are updated with the states based on this selection. i.e, I am not able to choose which textbox/row should be updated on Dropdown selected event.
Could anyone help me on this issue? Appreciate your response!!

I fixed this by setting the context key of the autocompleteextender to the dropdownlist selected value and retrieved the value when I typein something in the statesearch textbox.

Related

Kendo grid. Event when selection is become empty

I need some event when my Kendo grid lose selection (no row selected).
https://dojo.telerik.com/#nick_kingston/IjIYOduw
Select one or more rows.
Filter by some field that so no selected rows show.
Expecting event appearance because now no row selected.
How to implement item 3?
There is no event like lostSelection. The change-event triggers if the user changes the selection only.
Once the filter was executed, the dataBound-event is triggered (as you can see on the demo page https://demos.telerik.com/kendo-ui/grid/events). There you could check for the list of selected items with the method select (https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/select)

slick grid - unheck all rows for paging, sorting and search events

I am using SlickGrid with the checkbox selector plugin and the pagination plugin. I want to only allow the user to select rows for the current page. I noticed that slickgrid remembers values that the user selects on a previous page. Only when a user selects a row on the current page does it uncheck the rows on a previous page. Is it possible to uncheck all rows on a page change event.
Similarly if the user does a search I want to unselect all rows.
Same with sorting, unselect all rows for the grid when the user does a sort.
Is it possible to do this?
The checkbox selector plugin was not designed for pager. Whenever you set checkbox as selected using the plugin, it remembers the row indices _selectedRowsLookup of the grid and re-apply the formatting when the grid invalidates. Thus, it will be the same rows check/unchecked on each page.
To achieve what you want, you have to customize the plugin where you need to:
Add a flag/field isSelected to your dataset that store if a record is selected
Set the formatter to check the dataContext.isSelected instead of using the _selectedRowsLookup
Change the handleSelectedRowsChanged to modify the field isSelected to true or false with the correct reference on the current page.
To select the rows of current page, change handleHeaderClick to only modify the rows displayed using the current pagingInfo
To clear the selection, reset the isSelected field to false and invalidate the grid rows.

How to achieve kendoui combobox auto-complete reverse look-up when editing?

Here is the scenario:
I have a kendo combobox and it is working as it should for adding records. It will look up records from it's data source as the user types, and assign the ID of the selected record to the FK field in the record being edited. I have paging in the datasource set to 30 records and this works nicely.
Now when I edit a record, the FK ID is bound to the combobox and it then looks up the record so it can display the text for it. Perfect. However if the record bound to the combobox has an ID that is not in the first page of data returned by the comboboxs auto-complete datasource, it just shows the FK ID instead of the text for the record in the combobox widget UI.
How can I get the combobox to look up the record by ID to display the text for it on, when loading an edit form?
Or is there a better solution? Can I somehow bind the text to the combobox for records being edited if I include it in the load record data?
Thank you for your time,
Regards,
Scott

Kendo UI MVC bind Grid to DataSource from MultiSelect widgets

We are using Kendo UI MVC and need to filter a large number of records and display them in a read-only DataGrid. The page has MultiSelect widgets that each let the user select from a list of distinct values for a specific database column. After the user has entered his selections in the MultiSelect widgets he will click a 'refresh' button to update the grid. The Grid's DataSource.Ajax.Read method should pass the user's selections to the server and display the results in the Grid.
I know how to populate the MultiSelect widgets and how to return data from the server via Ajax but I'm unclear on how to pass the user's selections to Grid.DataSource.Read().
What is the best way for the button to pass the user's selections to the DataSource, fire the Read method, and display the results in the Grid?
EDIT: Putting the widgets inside the Grid's ToolBar will meet our needs.
Embed the widgets in Grid.Toolbar.Template

ComboBox in windows forms Datagridview control

I have a datagridview on a windows form. It has clolumn [EmployeeNumber, EmployeeName and EmployeeDepartment].
I want to be able to edit values directly in the grid but i want EmployeeDepartment to be a combobox column, such that on cell edit, a combobox shows up with available options for the employee department. Has any one been able to implement such functionality?
The DataGridView actually has a DataGridViewComboBoxColumn. If you go to the column designer, and add a new column you'll notice you can select one of a few types. It behaves exactly as you have described - on edit, it appears. The DataGridView uses things called editing controls, and has various events for swapping the control into the cell on edit.
Either way, if all you want is a drop-down, that's available out of the box.
To populate the combo box with items, in the column editor you will notice that it has an Items property for manually setting items, or you can use the data binding properties: DataSource, DisplayMember, ValueMember. Data-binding has issues when an expected value is not in the items collection, you will get a lot of cell errors; but they can be avoided.
Some helpful links:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.aspx
http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/e8e2d9eb-fe39-42ab-9a18-2194dac54675/

Resources