I am using WinForms (C#) along with Telerik UI controls. I have a RadPageView that has the ViewMode set to Stack. I also have the ViewElement.StackPosition set to Top and the ViewElement.ItemSelectionMode set to ContentAfterSelected.
It is a simple section-stack type control that will pop the header of the section to the top of the control when clicked, with the content of that section directly underneath the header.
The issue that I am having is that when I click on one of the sections, and the header goes to the top, this action also changes the big bold header of the parent RadPageView, but I do not want it to. I can change the text of the RadPageView by setting the ViewElement.Header.Text property on the RadPageView, but as soon as I click on one of the sections again it gets set to the section's header. Essentially, it then just has two headers right in a row that say the exact same thing.
I want to be able to set the header text of the RadPageView and not have it change when the selected page changes.
I am fairly new to this whole Telerik thing, so I am sure it is just some simple property, I am just done looking for it at this point. Any help would be greatly appreciated.
Related
I'm styling WPF's Calendar control and I've reached a point in XAML where there's a grid with no elements in it, just divided by rows and columns where the day numbers are.
I've snooped and decompiled (void PopulateGrids()) and have learned that in code-behind the Calendar is creating CalendarDayButton and feeding it to the grid.
I need to change the style/theme in-order to change the colors (of those CalendarDayButton) and I'm not sure how to do that.
I've tried applying a style to all CalendarDayButton in said grid, but that didn't work.
Any suggestions?
P.S. I'd rather stay away from code-behind because what I'm working on is a style in a resource-dictionary and not a user-control.
Go to the Microsoft page for Calendar Styles and Templates, copy the style code into your resources block and make changes as needed. If you need to create additional properties for settings etc then you can do so with an attached property, that way you don't need to create a new calandar control. If you're having difficulty figuring out which parts of the template correspond to things you're seeing on-screen then put a breakpoint in your code somewhere, add the calandar control variable name to your watch window and click on the little magnifying glass to bring up the WPF visualizer...that will let you traverse the visual tree and visually see which part of the control each section is rendering.
I am creating a customized grid in windows phone. I had done with all, but I am unsuccessful in
changing the grid selected row background color. I had tried the rowbackground property and also changed rowbackground color in grid selection_changed event. But nothing helped. Grid is displaying some default color when the row is selected. I searched some forums and found xaml code but no use. Anybody help me with xaml code else programmatically?
Create a new Style / template using blend which specifies the desired colours for the selected visual state.
to do this, you are best off using Expression Blend. You should already have it installed as it comes as part of the wp7 sdk or toolkit.
In the objects and timeline select your grid.
If you can't see it add a temporary one somewhere and use that and remove it at the end.
With a grid selected, right click it and select Edit Template\Edit a Copy
Decide whether you want this to be local or reused and select appropriately.
This will then give you a copy ofthe styling that is used for this control.
Find the section VisualStateGroup - and somewhere in there you should find the Selected visual state.
Style this accordingly to what you are after.
Make sure you give this Style/template a suitable name and ensure your original grid points to this style, and it should then pick up the new selected row colour.
I've come across the strangest bug pertaining to DataGridViews in Windows Forms.
I have a TabControl, that is supposed to contain a docked DataGridView in each tab page. I thought it would be convenient that the grid is focused upon changing the tab page, so that the user could simply hover the mouse over the grid and start scrolling when he changes the page. So, I just put a grids[tabs.SelectedIndex].Focus() in the event handler for changing the tab page.
However, something really strange happened. In my test application, I have three tab pages. If I try scrolling the grid right after starting the application, it doesn't work; I have to click in the grid first. I was expecting this. However, if I change the tab page, I can't scroll in any of the other grids until I click, except for the first one!
So, if I switch pages to the second page, then back to the first, I can automatically scroll that grid without clicking, but if I then switch to the third, I have to click for the grid to focus.
I had a look at the CanFocus properties of the grids, and it seems that only the first grid has it set to True. They are all created programmatically, and all in the same way. I don't see why they would be different.
Any ideas?
Inactive tab pages have their Visible property set to false. The documentation for CanFocus says:
In order for a control to receive
input focus, the control must have a
handle assigned to it, and the Visible
and Enabled properties must both be
set to true for both the control and
all its parent controls
Well, I solved it. Stupid programming error on my part, I had grids[tabs.TabIndex].Focus() instead of grids[tabs.SelectedIndex].Focus().
Oh well.
UI is created in VS 2008. I'm using C# .... I need to let the user move/focus between text fields from top to bottom by clicking tab button. How can i do it?
On the Layout toolbar (will normally show up if you're in Design View) click on the buttom on the most right (it's called tab order).
Now on every element on your designer will come up a little box with a number. Just click all your elements in the order you like and they will automatically be re-ordered.
If you like to do it manually, just take ho1 advice and change the property manually.
You just set up the TabIndex property properly, so that it's sequential from top to bottom. Then it'll work automatically and you won't need any code to move around the focus.
So in other words, set the top TextBox TabIndex to 1, the next one you set to 2 etc and then one at the bottom will have the highest number (of the textboxes, you probably want to have even higher indexes for any OK buttons and similar so that the user can jump to them after editing all the textboxes).
You can find more info about it here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tabindex.aspx
I'm trying to create a DataGridView cell class which hosts a control (all the time, not just while editing). So far, my approach has been to add the control to the grid and try to synchronise its position with that of the cell.
Would it be possible instead to keep the cell offscreen, route mouse and keyboard events to it, and paint it onto the cell?
UPDATE: By 'offscreen', I don't mean that it should be added to another control such that it isn't displayed; I mean that it should never be added to another control at all.
You can create a control without adding it to the form, then using it as the Cell editor whenever you need to. Usually with grids, when you click on a cell to edit it, it's going to either create a new control and put it in the right place, or it's going to use an existing control. You can make this process a lot easier by creating your own custom cell / column types. See this MSDN page: http://msdn.microsoft.com/en-us/library/7fb61s43.aspx.
Most grids (including DataGridView and 3rd Party Grids) have a facility for adding custom cells.