The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am using griddatabound control. I have following two queries:
1) How to programatically select a particular cell say cell(10,10) in grid. 2) When I select a cell in the grid using mouse, the cell click event gets fired. How do i get the cell selected event when i navigate through cells using tab key or up/down arrow keys.
HAhaneefm Syncfusion Team May 29, 2007 09:56 PM UTC
Hi Dinesh,
1) How to programatically select a particular cell say cell(10,10) in grid? >>>>>>>>>>>>>> You can use the Model.Selections property to manages selected ranges in the grid. It allows you to add and remove selections, determines selection state of a specific cell. Here is a code to select (2,2) cell in a grid.
//highlight the cell this.grid1.Model.Selections.Add(GridRangeInfo.Cell(2,2)); //highlight the row this.grid1.Model.Selections.Add(GridRangeInfo.Row(RowIndex)); //highlight the cell this.grid1.Model.Selections.Add(GridRangeInfo.Cell(RowIndex,ColIndex); //highlight the cell this.grid1.Model.Selections.Add(GridRangeInfo.Col(CoIIndex));
2) When I select a cell in the grid using mouse, the cell click event gets fired. How do i get the cell selected event when i navigate through cells using tab key or up/down arrow keys. >>>>>>>>>>>>>> You can try handle the Model.SelectionChanging event to detect the cell selection in a grid. Please try this and let me know if this helps.
Best regards, Haneef
DUdinesh upretiMay 30, 2007 10:27 AM UTC
hi,
this.grid1.Model.Selections.Add(GridRangeInfo.Cell(2,2)); does makes the cell appear as selected but it doesnot sets the CurrentCell property. I want to programatically set this CurrentCell property.
Thanks
dinesh
>Hi Dinesh,
1) How to programatically select a particular cell say cell(10,10) in grid? >>>>>>>>>>>>>> You can use the Model.Selections property to manages selected ranges in the grid. It allows you to add and remove selections, determines selection state of a specific cell. Here is a code to select (2,2) cell in a grid.
//highlight the cell this.grid1.Model.Selections.Add(GridRangeInfo.Cell(2,2)); //highlight the row this.grid1.Model.Selections.Add(GridRangeInfo.Row(RowIndex)); //highlight the cell this.grid1.Model.Selections.Add(GridRangeInfo.Cell(RowIndex,ColIndex); //highlight the cell this.grid1.Model.Selections.Add(GridRangeInfo.Col(CoIIndex));
2) When I select a cell in the grid using mouse, the cell click event gets fired. How do i get the cell selected event when i navigate through cells using tab key or up/down arrow keys. >>>>>>>>>>>>>> You can try handle the Model.SelectionChanging event to detect the cell selection in a grid. Please try this and let me know if this helps.