I have binded the Grid to the Datasource using the Designer , there i selected the number of columns to be displayed but on giving the adapter.fill method , it returns all the columns
Hello Linija,
When binding a DataSource to a Grid through designer, if you have selected specific columns then the DataAdapter.Fill method will only render those columns in the Grid. I have tested this behavior and it is working like I described. In order to resolve this issue, try calling the below line of code to clear the DataAdapter before filling it:
this.categoriesTableAdapter.ClearBeforeFill = true;
Please try the above suggestion and let me know if I may be of further assistance.
Sincerely,Sahaja KokkalagaddaAssociate Software Developer
Hello Sahaja
Thanks for the update , but the problem still exists, please see the attachment . I really dont understand where the problem is.
There are two possible ways to select and render only certain columns in UltraGrid.
Method1: At run time, create unbound Grid columns and hide the unwanted columns by looping through them in Grid’s InitializeLayout event. This is the simple and recommended way to achieve this.
Method2: At design time, bind the Grid to a DataSource and create the required columns as unbound columns (with same DataType as DataSource). Note: Make sure the unbound columns band name matches with the DataSource band name.
Please use one of the above approaches to resolve this issue and let me know if you have any questions.
Here's an article with details on how to accomplish the second approach:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=6702
I have tried the second method binding the grid to sp , still it returns all columns.Please see the attachment