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.
How can I simulate listbox with grid control? All I need is to make the rows as read only and the curser to be invisible as well. I did everything by myself beside all I mentioned about the cursor.
I'd like to thank you, for your quick reply, but I have one more thing to make it better. I'd like to know, how can I change background color of the selected row according to user selection with arrows (with something like grd.selectedrowindext). For now, I can change backcolor, only with grd_CellClick handler.
Thanks in advance Allon
LSLingaraj S Syncfusion Team August 26, 2009 11:34 AM UTC
Hi Allon,
Thank you for the update.
If you want to select the row in GridControl, then please try using ListBoxSelectionMode property in GridControl to achieve this functionality.
Refer the code below: #### C# code #### this.gridControl1.ListBoxSelectionMode = SelectionMode.One; // It is used to change the selection color this.gridControl1.Model.Options.AlphaBlendSelectionColor = Color.Pink; ######## VB Code ########### Me.gridControl1.ListBoxSelectionMode = SelectionMode.One ' It is used to change the selection color Me.gridControl1.Model.Options.AlphaBlendSelectionColor = Color.Pink
GetSelectedRows method is used to get the selected row in GridControl.
Refer the code below: #### C# code #### GridRangeInfoList range = this.gridControl1.Model.Selections.GetSelectedRows(true, true); MessageBox.Show(range[0].Top.ToString()); ######## VB Code ########### Dim range As GridRangeInfoList = Me.gridControl1.Model.Selections.GetSelectedRows(True, True) MessageBox.Show(range(0).Top.ToString())