Hey.
I'm building my grid programmatic, and in my itembound method i need to do some lookups on spesific columns based on the Id.
So when i create the grid i need to specify which column is a lookup column.
I was hoping i could use attributes, but columns don't have this property.
itembound method
I'm building my grid programmatic, and in my itembound method i need to do some lookups on spesific columns based on the Id.
So when i create the grid i need to specify which column is a lookup column.
I was hoping i could use attributes, but columns don't have this property.
| public static void DefineColumn(string strFile, RadGrid hraGrid) |
| { |
| hraGrid.ItemDataBound += new GridItemEventHandler(default_ItemDataBound); |
| GridBoundColumn myCol = new GridBoundColumn(); |
| hraGrid.MasterTableView.Columns.Add(myCol); |
| myCol.attribute["Type"] = "TextLookup"; |
| myCol.DataField = ; |
| myCol.UniqueName = strBuf; |
| myCol.SortExpression = strBuf; |
| GridBoundColumn myCol2 = new GridBoundColumn(); |
| hraGrid.MasterTableView.Columns.Add(myCol); |
| myCol2.DataField = ; |
| myCol2.UniqueName = strBuf; |
| myCol2.SortExpression = strBuf; |
| } |
itembound method
| foreach (GridColumn col in e.Item.OwnerTableView.RenderColumns) |
| { |
| if (col.type == "TextLookup") |
| { |
| item[0].Text = (string)getText(iTextID); |
| } |
| } |
