New to KendoReactLearn 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

UseGridAIRequestOptions

Configuration options for the hook

Returns

UseGridAIRequestReturn

Object containing loading state and request methods
Not finding the help you need?
Contact Support