SelectCell not working

Hi.

 sfDataGrid1.DataSource = Nothing

 sfDataGrid1.Columns.Clear()

 sfDataGrid1.AutoGenerateColumns = True

 sfDataGrid1.DataSource = DataGrid_DataTable


Up to this place - ok.


 Dim record = Me.sfDataGrid1.View.Records(0)


Error - sfDataGrid1.View is nothing.

As I will add before msgbox (""), after closing the window - it works ok.


msgbox("")

Dim record = Me.sfDataGrid1.View.Records(0)


Q: How can I check if sfDataGrid1.View is... ready (not nothing) after sfDataGrid1.DataSource = DataGrid_DataTable ?



1 Reply

DM Dhanasekar Mohanraj Syncfusion Team April 20, 2022 02:10 PM UTC

Hi Tomasz,


We have checked the reported scenario in our end, SfDataGrid.View will be created only after the datagrid loaded. If you are accessing the View before datagrid getting loaded it will be returning null. Please revert us if you need further assistance for this.


Regards,

Dhanasekar M.


Loader.
Up arrow icon