Exception using Pager

Using this code I get an exception "Cannot find column 0"

gridGroupingControl.DataSource = myList;
var pager = new Pager();
pager.PageSize = 100;
pager.Wire(gridGroupingControl);

The "myList" variable is a simple list of custom objects and there are a few hundred records (which display fine if I remove the call to Wire()).

Putting a breakpoint on the call to pager.Wire(...) I see that there are no columns defined in the DataSource.

Exception call stack:

System.IndexOutOfRangeException: Cannot find column 0.
   at System.Data.DataColumnCollection.get_Item(Int32 index)
   at Syncfusion.GridHelperClasses.Pager.FillPage(DataTable table)
   at Syncfusion.GridHelperClasses.Pager.RecordNavigationBar_ArrowButtonClicked(Object sender, ArrowButtonEventArgs e)
   at Syncfusion.Windows.Forms.ArrowButtonBar.OnArrowButtonClicked(ArrowButtonEventArgs e)
   at Syncfusion.Windows.Forms.RecordNavigationBar.OnClickedButton(InternalButton button)
   at Syncfusion.Windows.Forms.InternalButtonBar.OnClickedButton(InternalButton button)

5 Replies

SG Santhosh Govindasamy Syncfusion Team October 4, 2023 04:52 PM UTC

Hi Aaron LeMasters,

We have checked the reported issue with the provided details, but we are unable to reproduce the reported issue on our end. It works as expected, for your reference Here we have attached the  sample , so could you please share the below mentioned details?

Details:

1.How did you generate the columns?

2Where did you generate the column? Is this before assigning a data source or after assigning a data source?

3.kindly share your syncfsuion product version and also framework version.

It will be helpful for us to proceed further.

Regards,
Santhosh.G


Attachment: GridGroupingControlDemo_a668dc6e.zip


AL Aaron LeMasters October 4, 2023 06:55 PM UTC

I am not generating the columns. The columns are generated by the control automatically when I assign the DataSource member to the IList. I'm using Syncfusion nuget packages 23.1.38 with .NET 7.0



CM Chidanand Murugaiah Syncfusion Team October 5, 2023 01:56 PM UTC

Hi Aaron LeMasters,

 

We created the sample using the mentioned version of .NET 7.0. Unfortunately, we are still unable to replicate the reported scenario. It works as expected. For your reference, we have attached the sample.

 

Could you please provide the following additional information?

 

  • Could you please provide a sample in which the issue replicates?
  • If possible, can you please replicate the issue in the sample which we have provided.

 

Providing these details will help us better understand the issue and work towards finding a solution promptly.

 

Regards,

Chidanand M.


Attachment: GridGroupingControl_Net7_0_4dd56fa4.zip


AL Aaron LeMasters October 5, 2023 06:45 PM UTC

Please send me a message with an email address where I can send the sample code.



CM Chidanand Murugaiah Syncfusion Team October 6, 2023 10:43 AM UTC

Hi Aaron LeMasters,


You can create a seperate support ticket from your account to discuss this issue privately. otherwise please share the code in this email: [email protected]. We will maintain confidentiality and get back to you as soon as possible.


Regards,

Chidanand M.



Loader.
Up arrow icon