New to KendoReact? Learn about KendoReact Free.
useGridAIRequest
Updated on Feb 6, 2026
A custom hook that encapsulates the AI request logic for the Grid. This hook can be used by both GridToolbarAIAssistant and SmartBox components.
tsx
const { loading, streaming, sendRequest, cancelRequest } = useGridAIRequest({
requestUrl: '/api/ai/grid',
columns: gridColumns,
gridState: currentState,
gridRef: gridRef.current,
onStateChange: (newState) => setGridState(newState),
onMessages: (messages) => console.log(messages)
});
// Send a request
sendRequest('Sort by price descending');
// Cancel if needed
cancelRequest();
Parameters
options
Configuration options for the hook
Returns
Object containing loading state and request methods