We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Index was outside the bounds of array

Thread ID:

Created:

Updated:

Platform:

Replies:

28533 May 4,2005 02:56 AM May 4,2005 04:40 AM Windows Forms 3
loading
Tags: GridControl
Prathima Venkobachar
Asked On May 4, 2005 02:56 AM

I am using GridGroupingControl.When I bind the datatable to the grid.datasource, I get "Index was outside the bounds of array" error. I am fetching dataset from the oracle database and create my own datatable from the dataset and binding it to the grid. If I directly bind the dataset what I get from the database doesn''t give any error.But when I create my own table and bind it to grid, this throws an error. Any help on this will be appreciated. Thanx in advance. Prathima

Administrator [Syncfusion]
Replied On May 4, 2005 03:25 AM

Here is a sample that dynamically creates a DataTable and sets it to a GridGroupingControl.DataSource. http://www.syncfusion.com/Support/user/uploads/GGC_DataTable_8aa440a7.zip Does it work OK for you? If not, what version of our libraries are you using? If the sample works and you cannot spot any differences with what you are doing, can you post a call stack from when you get the exception? Also, where are you trying to do this work, and what is the state of the GridGroupingControl when you try to set this datasource?

Prathima Venkobachar
Replied On May 4, 2005 04:15 AM

I am doing exactly what is done in the given sample. But little bit different in the structure of the code. I have created a user control where in I will have grid and set other properties related to the grid like RecordValueChanging,CellDoubleClicked etc. I have a class to get the dataset from the oracle database. I have a class to create a datatable structure which I require based on some criteria. I have a class to load data from the Dataset to the datatable I have created. Finally I have a class to build the grid and bind it to the datasource.This class I am also using to apply styles to the grid. I pass the grid instance to class whereever required. What do you mean by state of the gridgrouping control..? I am using 3.0.1.0 version. >Here is a sample that dynamically creates a DataTable and sets it to a GridGroupingControl.DataSource. > >http://www.syncfusion.com/Support/user/uploads/GGC_DataTable_8aa440a7.zip > >Does it work OK for you? If not, what version of our libraries are you using? > >If the sample works and you cannot spot any differences with what you are doing, can you post a call stack from when you get the exception? Also, where are you trying to do this work, and what is the state of the GridGroupingControl when you try to set this datasource?

Prathima Venkobachar
Replied On May 4, 2005 04:40 AM

Hi, I have fixed the problem. I was not setting the primary key for my newly created Datable. But in my usercontrol I was setting primary key column which was comming null. Thanx for the Reply. Parthima

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;