I'm relatively new to ASP, so it's a simple fix that I'm not looking (hope here is! ). I'm using C # in VisualStudio2010.
Actually, I have the table in SQL with the following columns: Product, Product Group, Attribute1Value, Attribute2Value, Attribute3Value
For each product group, the attribute definition is different Example For, ProductGroup1 can have Attribute1 size and Attribute1Value 2,3,5, etc. In ProductGroup2, the attribute is 1 quality and Attribute1Values will be standard, economy, premium etc.
I can only drag into a product group at a time and want to display my column header attribute definition (instead of header = size attribute 1 value, when applicable). "
What I want to do is pulling in a gridview column which is invisible with the column product group, attribute 1, attribute 2, attribute 3, and then assign the value within the column that I myself Columns can be used to reassign the header. I have been able to set column headers based on other variables (especially the value from a dropdown selected), but to set the variable equal to the gridview value There is a problem with the code.
When I tried
Secure Zero Page_load (Object Sender, EventArgs) {LblAttribute1.Text = GridView4.Rows [0 ] .cell [2] .text;} protected zero error eta bound (object sender, gridwvivorEventErgus E) {if (E. Rau.RowType == Data Controller type. Header) {E.RO.Kel [3]. = LLL Attribute 1 text;}} I got an error message that my index was out of bounds Halley thought this could be because only after selecting something from the dropdown, there are no rows on my gridview page load, but I do not know if they are all related, is there a better way to do this normally?
Sorry if it was done poorly. Please tell me which other information you need.
Thank you for your help!
Perhaps you can try to create specific classes for your different product groups, and then You can tie them as your grid. Proper (to resist raw data binding from SQL)
For example, you have said that the characteristic of ProductGroup1 represents the size. So create a class that is a clear representation of ProductGroup1, such as:
Public class ProductGroup1 {int id {get; Set;} int size {get; Set;}} Do the same for your other product groups (i.e. the product property of ProductGroup2 class).
You have mentioned that you are going to be binding only one product group at a time, so I am convinced that you have DB queries that are selecting data by product group. In this case, take the returned record from your SQL query and change each record to one of your classes (such as ProductGroup1 above).
You can then list product groups sections or arrays. Then you can tie this list or array into your data grid, like using the automatic binding on the column headers, because they will match all the properties that you define in your class.
Comments
Post a Comment