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. Image for the cookie policy date
close icon

GridFilterBar with ''System.IndexOutOfRangeException''

Hi I have a form with one DBDG with 6 columns (Mapping1 to Mapping6). When i call it with "Customers Table" using the 6 columns its work ok. When i take work with "Type of Customers Table" using 3 columns i have this exception when i call the event GridFilterBar.wiregrid(my_DBDG). Additionaly i make the Column 4, 5 and 6 with ColName = "" and have private void GridFilterBarCreatingColumnHeader(object sender, GridFilterBarCreatingColumnHeaderEventArgs e) { if(e.ColName == "") e.Cancel = true; } But my problem persist. Thanks for your risponse. Regards

4 Replies

AD Administrator Syncfusion Team December 12, 2004 09:42 PM UTC

>>When i take work with "Type of Customers Table" using 3 columns i have this exception How are you making your customers table have 3 columns? Are you using GridBounds to do this or are you using your SQL query to do this? Can you modify our FilterBar sample to show this problem?


LF Liliana Faerman December 12, 2004 10:40 PM UTC

Clay, i call the class with the DBDG from 2 form windows differents, one for the table "Customers", with 6 columns in the SQL, and other with the table "Types of Customer" with 3 columns in the SQL. 1. query = "select campo1, campo2, campo3, campo4, campo5, campo6 from customer". 2. query = "select campo1, campo2, campo3 from [type of customer] When i call with the option 2, the grid refresh ok. I have a button for the user, if he press this button activate the FilterGrid, when press this button is the problem.


AD Administrator Syncfusion Team December 13, 2004 06:24 AM UTC

Try calling filterBar.UnwireGrid before changing the grid''s datasource and then calling filterBar.WireGrid after changing the datasource. Take a look at the SetTableIntoGridAndWireFilterBar method in the GridFilterBar sample we ship. It changes the datatables using this technique.


LF Liliana Faerman December 13, 2004 09:23 AM UTC

Thank''s Clay, works ok! Regards

Loader.
Live Chat Icon For mobile
Up arrow icon