|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datagrid ... is this the control from hell?datagrid. can someone point me in the direction of anything that could help me determine how this is done? I have: - retreived my data - processed my data - displayed my data My desired result would be something along the lines of: .... <td>Heading 1</td><td class=NewStyle>Heading 2</td>... I will know what headings I need to alter at the data processing (business) layer. I will send the information to the web page along with the data to be displayed. What I can't determine how to do is programatically target a specific column name. Any assistance will help keep my sanity.
Show quote
Hide quote
"Bill" <B***@discussions.microsoft.com> wrote in message Can you turn off headings for the datagrid and create your own headingnews:E40F3AB9-68E2-479A-BF2C-AA61927AB9CF@microsoft.com... > I am trying to programatically alter the style of x column headings on a > datagrid. can someone point me in the direction of anything that could help > me determine how this is done? > > I have: > - retreived my data > - processed my data > - displayed my data > > My desired result would be something along the lines of: > > ... <td>Heading 1</td><td class=NewStyle>Heading 2</td>... > > I will know what headings I need to alter at the data processing (business) > layer. I will send the information to the web page along with the data to be > displayed. What I can't determine how to do is programatically target a > specific column name. > > Any assistance will help keep my sanity. > > control with the styles you need? Mike I found a solution.
When the data source is bounded to the datagrid control I can use the ItemDataBound event to then interrogate what item type is being bounded. i.e.: Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound If e.Item.ItemType = ListItemType.Header Then End If End Sub I can then: e.Item.Cells(0).CssClass = "NewClassName" Because I know what column names I want to adjust (in the bl layer at run time) I can pass that dynamic information back and rip through it (replacing the e.Item.Cells(Integer) with the particular cell number). Cheers
Why don't child control events trigger OnBubbleEvent?
Datalist - Image loads on localhost but not on server Valid values for properties Distributing OWC11 About CreateChildControls() Looking for an Autocomplete DropDownList looking for tab control / tabstrip in VS 2005 beta2 Validation on dynamic fields Object reference not set to an instance of an object - newpost Multiple Label tags with same ID |
|||||||||||||||||||||||