Hi There!
I am assigning a dataset at runtime to a webgrid's datasource (in designer the datasource is blank).
Me.WebDataGrid1.DataSource = DSMe.WebDataGrid1.DataMember = "orders"Me.WebDataGrid1.DataBind()
Grid shows correctly, no problem.
Now I want to hide two columns, but the me.Webdatagrid.Columns.Count is always 0. I tried with AutoGenerateColums set to True, set to False no way to get the columns in the collection. The .rows.count property shows the exact numbers of rows,
So I can't hide a columns because
Me.WebDataGrid1.Columns.FromKey("GUID").Hidden = True
returns an error becaus the columns could'nt be founded.
Any idea?
Shilpi,
The columns are not available when automatically generated as this mimics how the Microsoft GridView works. As such you do need to define the columns rather than having them automatically generated. If you would be interested in seeing this behavior change then you should submit a product idea to have the automatically generated columns available in the code behind on the product ideas site.
Is this the only way to accomplish hiding columns by not auto generating the columns. I was able to do that using ultrawebgrid, don't understand why this would be different?
Thanks, Shilpi
Hello Mrfunky,
To take advantage of column hiding and the approach suggested by Valerie you will need to use NetAdvantage 2009 Vol. 2 or later. Column Hiding was a new feature that was added in the release of 9.2. For more information, please see the following article:
http://help.infragistics.com/NetAdvantage/ASPNET/Current/CLR4.0/?page=Web_Whats_New_in_2009_Volume_2.html
Please let me know if I can be of any further assistance.
Hi,
I'm using NET2009.1 webdatagrid and hidden property does not exist, what I can do?
thanks
Were you able to assign your dataset at ruintime as desired?
Valerie