Hello Pete,
Can you please provide me with your sample, because it's difficult to find what's wrong with your code without debugging it?
In any case, I see that you are trying to set the BackColor of the TableEx control. I don't think that this is the best way to do what you want.
It's better to process ASPxPropertyEdititor objects only (FindItem(name) as ASPxPropertyEditor) and then set the color of their Editor object.
Alternatively, you can use the approach I used in the How to highlight the focused editor in DetailView example, to process ASPxWebControl objects only (check out the HighlightFocusedLayoutItemDetailViewController class for more details).
I suggest you implement one of these approaches in your sample and attach it here if it doesn't work. Then I could help you further.
See Also:
http://documentation.devexpress.com/#Xaf/CustomDocument2729
Thanks,
Dennis
Hello Dennis
Based on your response I have modified my code and still cannot change the color of the Caption and append astrisks (*).
Hi Pete,
Thanks for your patience.
You can modify your controller as follows:
Let me know if this suites you.[C#]... Protected Overloads Overrides Sub OnActivated() AddHandler View.ControlsCreated, AddressOf View_ControlsCreated AddHandler CType(CType(View, DetailView).LayoutManager, WebLayoutManager).ItemCreated, AddressOf WebLayoutManager_ItemCreated End Sub Private Sub WebLayoutManager_ItemCreated(ByVal sender As Object, ByVal e As ItemCreatedEventArgs) Dim editor As PropertyEditor = TryCast(e.DetailViewItem, PropertyEditor) If editor IsNot Nothing Then If editor.PropertyName = "Name1" Then Dim captionControl As Literal = DirectCast(DirectCast(e.TemplateContainer.Controls(0).Controls(0).Controls(0).Controls(0).Controls(0), System.Web.UI.Control), System.Web.UI.WebControls.Literal) captionControl.Text = "Some custom text1" TryCast(captionControl.Parent, WebControl).BackColor = Drawing.Color.Red End If End If End Sub ...
Thanks,
Dennis
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+